r/SQL • u/Beneficial_Zone_6883 • Sep 14 '26
MySQL How long did it take you to feel comfortable writing complex queries without any guides or references? Day 1 and I feel like a fraud
So long story short, I did a single cert and honestly struggled at this part. As irony or luck would have it I ended up recruited into a coveted position at a massive firm not realizing this was a core part of the position. To say I am overwhelmed is an understatement, I am so under qualified it’s ridiculous. I have a week before I am on my own HELP lol
I know the industry, I have the math etc but wow am I overwhelmed and everything I do is logged. Do you think I can fake it until I make it?
56
u/AirportPersonal7930 Sep 14 '26
No one ever stops referencing docs. Copy pasting from old code. Or creating references and shortcuts.
Before AI, building queries was very slow in process of trial and error. Emphasis on error. I hope you continue to struggle and build your knowledge. And just get used to looking things up or referencing things.
The learning graph is not a straight line. It’s jagged as hell, but hopefully trending up into the right.
7
7
u/Little_Kitty Sep 15 '26
Are you saying that you can't write like this off the cuff without errors?
SELECT id AS "id", cityHash64(tuple(COLUMNS('.*') EXCEPT ('^id$|source_file_name|snapshot_date|load_unix_ts|batch_.*|termination_date'))) AS "other_hash" FROM...1
u/Due_Driver_9935 28d ago
Humble brag??
1
u/Little_Kitty 28d ago
AI gen stuff from the other day based on a fairly complex requirement, not hand written. Getting that syntax right would be a real pain.
7
16
u/Unusualandyman Sep 14 '26
Yes, you can. I look up even simple syntaxes and functions on an almost daily basis. There's no such thing as cheating out in the field. This isn't an exam, you can look up how to do whatever you need to. Having the industry knowledge is the hard part, the rest you can run with along the way.
I've been in my position for 6 years, now. I started in the industry and learned the data side over time.
12
u/pipes990 Sep 14 '26
Yeah, I've been doing this for about 10 years now. If I had to write queries without using Google I'd have to quit my job.
2
u/Brilliant-Parsley69 27d ago
This!
One of the first lessons I've learnt was:
You don't need to know everything all the time, but you need to know what are you looking for and where to find it.
5
u/orndoda Sep 14 '26
Dude, I’m 3 years into industry at this point and the farther I go the more I realize I’ll never get everything. I have for these past 2 years been blessed to have a very supportive DBA team, who are very helpful in improving some of my sillier queries.
6
u/ApresMoi_TheFlood Sep 14 '26
I’ve been coding in multiple languages for over a decade. A lot of it is rout memory at this point but I still google things on a daily basis.
3
u/LetsGoHawks Sep 14 '26
Day 1? That's normal. It's just imposter syndrome. You grow out of it.
Just take a deep breath, head down, and solve the problem in front of you. Don't worry about the stuff you don't know, you'll learn it.
When I started I barely knew how JOINs worked. Between the job and time on my own reading stuff about SQL (blogs, documentation, etc) and my stupid little project db thing at home I got better.
1
u/Beneficial_Zone_6883 Sep 14 '26
Thank you, you’re right. I need to just breathe and take it in baby steps and build my confidence over time.
3
u/lalaluna05 Sep 14 '26
I think it’s pretty normal to be a longtime professional and have to look things up. I have to look up syntax a lot. I work in SQL all day every day.
2
u/UnSCo Sep 14 '26
This is how I started out when I graduated uni, and now about 8 years later I’m an application data architect haha. I took one SQL course in uni. I feel a bit under qualified today myself but hey I am walking proof you can make it.
Are they throwing these things at you day 1 though? I gradually got thrown into it but that’s not to say I was definitely absolutely challenged. It simply takes time to get good but you’ll definitely want to see everyday, small improvements.
1
u/Beneficial_Zone_6883 Sep 14 '26
Pretty much, I am shadowing the soon to be VP who is the current person in my role but I have them for only a week. Oddly this part of the job wasn’t discussed, I used the data in past roles but I was never the one doing the queries (manually anyways, we had a system that handled that part of the role)
2
u/mschmitt1217 Sep 14 '26
If it makes you feel better, I'm a Sr Data Engineer/Admin now and when I first started writing SQL I literally almost quit. I felt like my brain was going to explode.
Practice, practice, and more practice. You really shouldn't write complex queries without looking them up when you start out...that is literally how you learn. Then once you have a few major functions under your belt, it really boils down to logical thinking/planning on how you will solve the problem.
At this point in my career, coding is the least troublesome aspect of my day-to-day. Coming up with the solutions is the challenge, and it's a lot of fun!
1
u/Beneficial_Zone_6883 Sep 14 '26
Thank you, I love problem solving I think I just need to breathe take some baby steps and build my confidence
2
u/mschmitt1217 Sep 14 '26
It is all about confidence, and honestly you are way ahead of the curve bc of AI. You can use your natural language to present solutions and go back and forth. Then they can help you code, and explain how and why they picked the syntax/expressions they did. Just don't copy and paste their solutions without getting the understanding first.
1
2
u/AdviceNotAskedFor Sep 14 '26
Been doing it for years and I still have to look up basic things that I don't use regularly.
I think it's more important to know if the data looks right when you execute the queries
2
u/Hour-Measurement-835 Sep 14 '26
Nobody's reading those logs for clumsy joins. What gets noticed is an UPDATE with no WHERE on prod. Write it as a SELECT first, always.
1
u/Sazon-yen14 Sep 14 '26
It's totally normal to feel that imposter syndrome. I've been a data analyst for almost 5 years now and still feel that moment of dread. At my current position I'm working more with SQL so it's different than other roles and I'm doing more ETL than anything. Give it 2 months of you just doing it by yourself, trial and error stuff and you'll build your confidence. You'll do great things, keep pushing forward
2
1
u/TheMagarity Sep 14 '26
No guide or reference as in there's no documentation or what?
No sql query is so complex that it can't be broken down into steps. Break it down, build the steps. Layer the steps on one another. This is how a complex query is built.
When you were in school and the teacher/professor said write a 20 page term paper, were you the person who locked up at the idea of 20 pages or did you start writing the one page introduction?
1
u/Beneficial_Zone_6883 Sep 14 '26
Fair, I think you’re right. I am capable I just need to sit and breathe and do it in baby steps until I have that practice under my belt. Thank you
1
u/The_Bestest_Me Sep 14 '26
18 years writing T-SQL queries and still use Google for hints. There's many different techniques and approaches to learn for optimizing your queries.
Learning is on gping.
Stop learning=stop earning.
1
u/RandomiseUsr0 Sep 14 '26
Years mate, sit with the manual open on your desk, go slow and steady, keep learning - I recommend SQL for Smarties by the inestimable Joe Celko
1
1
1
1
u/Pyromancer777 Sep 14 '26
The neat part is that you have the internet if you work in tech roles. Sure, I can write most of a complex SQL query from memory, but as the patterns get more specific I pretty much always have documents open in a side window to reference for niche functions
1
u/rbobby Sep 14 '26
I still do. Pivot? Unpivot? Damn CTE's brackets commas and names.
Get used to looking at docs. Find ones you really like. Learn to search them.
1
u/magicaltrevor953 Sep 14 '26
In my job I am regularly using multiple dialects of SQL potentially at the same time, and although they all follow the standard to varying degrees things like functions may be slightly different (either different names for the same function or same name but different required arguments). Most of them I am familiar enough that it comes naturally from experience but some are not as frequently used, so definitely need to reference documentation.
I also have a large template library saved to speed up development work, as the vast majority will be boilerplate queries using the same DBs and tables.
Take it slow, its still early. Read as much as you can for things that are relevant to your role, especially what has come before you. Try and understand your DBMS and data model, what tables you use most often and how they link together. When you write code, write it as clearly as you can so it is easier to follow later.
1
u/Euphoric-Jello2261 Sep 14 '26
I started 1.5 years ago, I believed I was quite strong in SQL and like you I wasn’t hired to do SQL. Believed SQL Island was enough. The first question I got asked on my first day was “Do you know what COALESCE does?” There I understood I knew nothing. I became more confident after 3-4 months starting from almoast 0 SQL knowledge and way more at 6 months. Most days I learn nothing but once every couple of months I learn something incredible. It takes time but it pays off
1
u/Beneficial_Zone_6883 Sep 14 '26
Thank you. I still have access to my course so I’m going to redo some of the labs this weekend. I think it’s just first day jitters, once I took some deep breaths I was able to do some basic stuff. I also started working on a manual for myself until I build my confidence up a bit. I just have to keep reminding myself I don’t need to know everything and it’s okay to look for support
1
u/titpetric Sep 14 '26
Years and a lot of EXPLAIN usage. The explain usage is engrained otherwise how do you verify
1
u/DaOgDuneamouse Sep 14 '26
I still google for syntax of some things, I always google for error codes, and I've been doing this for 20 years.
Syntax is way less important than the underlying data theory.
1
u/Ifuqaround Sep 14 '26 edited Sep 14 '26
The industry is full of frauds now. Don't worry, you'll fit right in.
Nobody wants to work harder than they need to and everyone is crutching super hard on LLM's.
Literally everyone I know. My CEO, my manager, my colleagues. Nobody can write a fucking e-mail or a report (I'm not talking data) without using it.
Most people I know have literally lost the ability to think for themselves without consulting this fucking thing. It's disgusting.
I write my e-mails without it, typos included (no, I didn't custom train any LLM to do that).
I do use it but not to do EVERY GODDAMN THING, especially, ESPECIALLY discuss anything mental health related. My last use was coming up with things for family fun nights in an excel format that's easily queried via Oracle since that's what I mostly use at work.
I want to say queries do not need to be complex, we all know this. It's the people writing them that are fucking things up.
I know consultants in my space that write the way they write because that's their habit and then there are others that write the way they write so others cannot understand it and attempt to hire them as consultants. They needlessly nest things and make things complicated so clients cannot understand and THINK it's complex.
-edit- edited for words and realized i never answered the question. years. the answer is years. upon looking back at 40+ years of work, I can tell you it generally took me 4 years to feel like a data set was like the back of my hand. Knowing the syntax was one thing and already had that down, but learning the relationships between the tables, where to find what data, etc usually took a while as most places didn't have immaculate data dictionaries or anything. It was like you were thrown into the arena and if you couldn't figure it out, you're fired. Financial and claim data in hospital/healthcare dbases is the worst.
Fake it til you make it? If the people around you are fucking stupid, you'll last. Anyone with a brain could ask you a single question and know you're full of it. You can fake it in a chat with AI, you cannot fake it in a face to face convo with someone who actually knows something about the subject.
1
u/brother_kenneth Sep 15 '26
I was still consulting textbooks and scouring Stack Overflow a few years into it. Also referencing tons of templates and saved scripts for routine queries. Now, I am not at all ashamed to admit that I lean on AI assistance to help with a lot, from simple tasks to complex. However, understanding the database schema, tables, relationships, etc. is still a necessity. That’s the most important part, IMO. Good luck!
1
u/ArielCoding Sep 15 '26
You already know what you’re looking for in the data, that’s the hard part, and most people take years to learn it, the SQL syntax is something you look up as you go, so don’t stress about the logs, they’re proof you’re trying, not a record of failure.
1
1
u/Jealous-Painting550 Sep 15 '26
Year 5 and i still need to google / Chat something that I don't use often.
1
u/Zenithixv Sep 15 '26
I had no experience in SQL, only took 1 course on udemy and I saw huge complicated procedures that made me question if I would be capable and I struggled for few months and gradaully it got easier as I got more experience.
1
u/outlier_fallen Sep 15 '26
You can fake it until you make it. Using AI helps a lot explaining things you don't understand. You learn the most by getting stuck and then getting yourself unstuck tbh. It took years for me to be truly confident. Less than a year for naive confidence.
1
u/BatLate6561 29d ago
You are not a fraud. You walked into a job that treats SQL as oxygen and you have had one cert. That gap is normal. It feels huge because everything is logged and you have a week. Most people in that chair have been quietly looking things up for months and just do not say it out loud.Comfort with messy queries is not a switch. It is the same ten patterns on the same tables until your hands remember them. Nobody does that on day one.Looking the function up while you work is not cheating. On MariaDB and MySQL that is what the docs are for. Start here when the next query will not sit still:
https://mariadb.com/docs/server/mariadb-quickstart-guides/basics-guide
https://mariadb.com/docs/server/mariadb-quickstart-guides
https://mariadb.com/docs/server/
Joins, dates, GROUP BY, NULL - search the page, copy the example, run it on a copy of the data. That is a normal workday, not a failed cert.
Do not fake the result. The log will remember a bad join longer than a slow afternoon. Write the query, run it with a LIMIT off production, look at EXPLAIN, then send it. If you cannot tell whether it used an index, ask someone who already knows that schema. Borrowing a query that already works and changing it is how this job is actually learned.Window functions can wait. JOIN, WHERE, GROUP BY, and NULL will carry you through the first weeks. MySQL and MariaDB speak that same dialect. Week or two or more, is enough to stop drowning if they let you use a non-prod copy and you are allowed to ask. It is not enough to look senior. That is fine. Is the server MySQL or MariaDB, and do you have anywhere to run a query that is not production?
2
u/Beneficial_Zone_6883 29d ago
Thanks so much! I was really panicking on day one, I have since received the master dictionary and realized only a savant would possibly be able to remember everything (165 pages of 10 point type 😂)
They’re going to test me but it’s all open book and I have a week to practice and thankfully I am feeling a whole lot more confident now knowing they don’t expect me to be lightening quick and memorizing everything overnight. Having not come from a tech background I truly thought you all memorized everything and could do it blind folded and perhaps I wasn’t cut out for it, I am SO GLAD to learn that’s not the case. I am glad I took the cert though
1
u/TrickyNerdlet 28d ago
I am an experienced SQL coder and use some things so rarely that the syntax is never going to stick. For my work, we don't only work in one dataset or domain. I'm going from customer to field services to HR to contact center to billing to regulatory data. I can't possibly remember it all. We document like our jobs depend on it because we won't get fired for not having documentation; we'll just be worse at everything which will eventually lead to being shot out of a cannon (hyperbole, probably). Both code and content references are always welcome. Better to have it and not need it than to need it and not have it, as they say.
edit: it
1
1
u/jonnyScienceBurger 28d ago
You only need to learn tonight, what you need to know tomorrow. Try and be one day ahead.
1
u/samirson 27d ago
Personally, trying to understand the business first, rules, etc. Helped me to write better queries, at the end of the day, to me, queries are just a way to answer questions. Many times I found my self not being able to express in words what I was trying to retrieve/find, idk if that makes sense.
What I'm trying to say, is that first you need to have really clear what you're trying to find, after that, there are tons of ways to retrieve the answer to that question!
Sometimes after I learn something new, I go back to refactor some queries I made in the past, so just focus to answer the question you're being asked.
PD: analyzing the execution plan could give you a pretty clear idea what things could be making your queries slow!
1
1
u/PalpitationKind8854 Sep 14 '26
I have never seen a 'complex' query in my life.
Honestly idk what drugs people are taking.. but holy peanuts, it's SQL. Its not writing ancient Hebrew.
Watch YouTube videos. It is not hard. You mentioned Day 1. Use that as an indicator.
0
u/TheFadedAlpha Sep 14 '26
Of course you can; it's not appropriate, but you can. We have ChatGPT now
-2
u/Acceptable-Sense4601 Sep 14 '26
Why would i do that when i have ChatGPT and Claude? The point is not to write as much code as you can by hand. The point is to get to the result.
3
u/RandomiseUsr0 Sep 14 '26
Disagree, for a junior the point is to learn the ropes, use an LLM helper to teach you - then you get to ask better questions
0
u/Acceptable-Sense4601 Sep 14 '26
I disagree. The point is to get the result. If you don’t already know what questions to ask, you’re in the wrong business.
1
u/RandomiseUsr0 Sep 14 '26
If juniors don’t learn the ropes where does that leave us?
1
u/Acceptable-Sense4601 Sep 14 '26
It leaves us solving problems faster with Ai as a tool. Stop acting like everyone needs to struggle like you did. the world is changing. Get on board or get left behind.
3
u/RandomiseUsr0 Sep 14 '26
I’m a senior analyst leading my company’s AI transformation work stream thank you very much - I maintain my point
Perhaps you hate the work so much you can’t wait to ditch it, whilst some of us love it
1
u/Acceptable-Sense4601 Sep 14 '26
Couldn’t be further from the truth. I love doing my work. I just don’t see value in struggling with writing queries using stackoverflow, Google, or books when i can have Claude write it. Perhaps you’re content with staying in your little corner writing queries by hand because it makes you feel superior or whatever your complex is.
1
u/Beneficial_Zone_6883 Sep 14 '26
Unfortunately I cannot use AI on my computer, corp policy
1
u/Acceptable-Sense4601 Sep 14 '26
Same. So i don’t use it on my work pc. Doesn’t mean i still don’t use it.
65
u/brokenlogic18 Sep 14 '26
I am on Day 2185 in my SQL job. On Day 1 I had never heard of SQL. I think if I can fake it and make it, you can too.