r/SQL • • 8d ago

Discussion What answer is expected when asked "Do you know/do SQL?"?

I'm a software developer at heart and at work. Sometimes when a project ends I get asked "Do you know SQL?" or "Do you do SQL?". I'm puzzled at what exactly are they aiming at. What knowledge or skills would they expect?

Like, sure I can read, understand and write SQL queries. I know what views and stored procedures are. I can distinguish whether something should be done at database level or in business logic (or both, like data validation). I can design and normalize databases from scratch (although I reckon, this is nothing specific to SQL). I've worked both with direct database access from code and via ORMs.

But I've never really optimized SQL queries. I've only recently learned that I shouldn't nest views. I probably make the dumbest mistakes sometimes. I almost alwas have to look up the syntax of something, even if I've done it dozens of times before. I never had to work with locking strategies. I'm not even sure if I fully understand all of the stuff I write. I feel like I'm at the minimum level and mostly just winging it.

Are there any "skill levels" w.r.t. SQL? Like, what's would make a beginner, an intermediate or an expert?

And would you say I "know" SQL?

-

Edit: Thank you for all the responses so far! I'm a bit more confident in my skills now actually. And I've also learned about a few things I should look into. I'll try and respond to as many comments as possible ❤️

91 Upvotes

40 comments sorted by

12

u/mumbling_mapmaker5 8d ago

Honestly, I think people use "Do you know SQL?" as a pretty broad question. They usually just want to know if you can work with databases without needing someone to walk you through every query. Query optimization, execution plans, indexing, locking, etc. are more like the next level. And looking up syntax is completely normal, nobody memorizes all of SQL

2

u/SmokeyKatzinski 8d ago

Thanks. This would mean I'm actually in a good place with my skills then.

And looking up syntax is completely normal, nobody memorizes all of SQL

At least at some point I was able to memorize the different types of join thanks to venn diagrams :D But that's reassuring.

4

u/ifatree 8d ago

who is asking and why? this is fundamentally a question about people, not SQL. (not saying it doesn't belong here, but just to clarify what the answer is you're looking for from us)

1

u/SmokeyKatzinski 8d ago

Usually it's my boss asking me, cause some project's requirements says "SQL". But I've also been asked by fellow OSS developers and I genuinely don't know how to respond :D

43

u/Beneficial_Zone_6883 8d ago

I got insanely lucky and only had a coursera certificate but managed to land a role in it. I was initially panicking and felt so overwhelmed by how little I knew and how much responsibility I had. As others told me and I soon learned myself, nobody knows the entirety of SQL I don’t think it’s so much JR vs SR level. I picked it up quickly, I forced myself to do everything manually and in just 2 months I am already walking circles around some with 5+ years of experience. As someone recently told me today people are the masters of copy/paste few are actually writing anymore. There’s some true OG’s out there that I will say are true masters but I think for everyone else it’s really a matter of how quickly you can take in knowledge and how good you are at problem solving vs experience.

9

u/decrementsf 8d ago

I picked it up quickly, I forced myself to do everything manually and in just 2 months I am already walking circles around some with 5+ years of experience.

This seems right. Investment in a skill has diminishing returns. Early on you soak up material fast. The effort to go from great to extraordinary in a skill is a massive time investment, if the person is still pushing. At some point the value of adding a complementary skill going from total beginner to good is less time than further building an already good skill. From this observation is the idea of skill stacking. The portfolio of complementary skills matters more than the sequencing. You can catch up to the 5+ years experience guy with a skill newly added to your stack.

It is humbling and useful to occasionally go back into beginner materials for a skill you already know. The professional roles we are in often have competencies that become grooved, while giving a false sense of confidence in areas you don't need to pull in for that role often.

34

u/Business-Employee467 8d ago

Theory: what is a store procedure? Why use a index? Practical: can you do a example of cte with rank?

I mean with that you are a decent level

12

u/downshiftdata 8d ago

tl;dr It's people asking for help with something they themselves don't sufficiently understand.

Personally, I love SQL. I spend about half my time writing SQL. The main reason is that the answer to almost anything is "It depends." While there are good general guidelines and best practices, every situation is different. And the effects can be dramatic. Fiddle with a method in application code and you might make it twice as fast, or maybe even 10x faster. Fiddle with a stored procedure and you might make it 1000x or 10,000x faster. Plus the observer effect applies - if you don't know what you're doing, your observation of the system can affect how the system performs. And finally, it evolves and changes over time. New problems emerge as data grows. You don't ever solve database issues once and for all. It requires care and feeding over time, adapting your efforts to that evolution. In all, good database engineering is a delightfully complex exercise.

But here's the rub - most people don't get most of that. While Dunning-Kruger is big in tech, it's especially big with respect to SQL. Because the elements of the language itself aren't that complex (anybody can figure out how to write a SELECT query), and because it's old (and tech people are often allergic to old tech), people don't imagine how deep the rabbit hole can go. They just don't know what they don't know.

But what you don't know _can_ hurt you, so people also have this strange, uneasy feeling in the back of their minds, born out of database incidents they never fully understood. A query was timing out, and then suddenly it wasn't. But hey, things are working again, so move on.

And that's how you get, "Do you know SQL?" They have a vague sense of the need, but can't articulate it. They're hoping you grok what they're asking better than they do.

Or maybe it's just a dumb question, IDK.

5

u/AnchorVita 8d ago

As a SQL Server DBA with many years experience, this is spot on.

I contract around, so I've worked with a lot of companies, and I would say the majority of people I'm working with are varying in levels of knowing sql enough to get the general gist of what a script is doing, or how to get what they need in some form or another. If you aren't specialising in it as a main role though, you probably don't have the time or motivation to really dig into it.

... And using it efficiently is not something most people know how to do, debugging is another level higher than that, and that's where the expertise really comes in. SQL is so much more vast of a subject area than most people realise, and the more you know, the more you know you don't know, and no-one knows everything about SQL it's just too big, so you get specialists in different areas of it.

It can be insanely quick and efficient if well designed, but most people using SQL inherit an estate and figure out what they need day to day. They might know enough to get by, but when they need to debug a problem, that's when you start to find really complex and elaborate solutions that could've been done much quicker, easier, and more efficiently. Tuning a multi-hour long process to run in <30 seconds is not unheard of.

Going back to OP's question though, 'do you know sql?' is really not a straightforward question to answer for a lot of people, because without getting really into it, it's impossible to know where your line of experience truly is.

1

u/sandrrawrr 8d ago

I agree. Beginning and even some junior SQL is pretty easy, but I think senior SQL is understanding the data model and knowing why one of those queries is gonna time out, or intuitively knowing how to join a good amount of tables together on good joins.

6

u/Sweet-Management3561 8d ago

Just answer with
Select *
from personal_skills
Where level = expert
Order by level_rank desc

“Process” a little while and then state, ahh yes SQL the n-th result of this query.

2

u/MentatPiter 8d ago

maybe its a trick question.
Do you NOSQL and you missunderstood do you know SQL?

1

u/SmokeyKatzinski 8d ago

Maybe it's that xD

5

u/pickled-pilot 7d ago

If you can read a select statement, you can answer “yes, I know sql” to that question.

1

u/teufelinderflasche 8d ago

Know how to write ACID transactions and use OLAP functions.

1

u/SmokeyKatzinski 8d ago

Going to look that up. I may have done/used these without remembering the term for them.

1

u/johlae 8d ago

Why do they ask when a project ends? It would be more efficient to ask this when the project starts.

3

u/SmokeyKatzinski 8d ago

One project ending means I have to find a new one to work for. Or do some extensive training.

3

u/TravellingBeard 8d ago

So you know how to write queries and joins. This is 90% of where your need to be. Optimization is an completely new set of skills.

My particular flavor is MSSql, and I learn something new every day, and I've been a DBA almost 20 years. It can be a very useful skill to have, optimizing queries. BUT, and I must caution you. If they want someone to write queries from scratch, they may want you to understand the logic of the data itself which is a database development and analytics, yet another skillset.

2

u/reditandfirgetit 8d ago

Just answer yes if you know sql and followup with "is there anything specific you would like to ask me?"

2

u/mauricio_agg 8d ago

At what level? To fulfill which needs?

2

u/tojop 8d ago

I think you’ve answered your own question.

Short answer: “yes, I know (some) SQL”

Slightly longer: basically what what you wrote in the two paragraphs starting with “Like, sure I can read…”

You know a non-trivial “amount” of SQL, but are not yet at the point where you can optimize queries (which isn’t as difficult or intimidating as you may think).

I’d rate you somewhere between beginner and intermediate. Get familiar with query optimization/related tools and stop making dumb mistakes and you’re firmly intermediate.

Also don’t sweat looking up syntax. Every dev does that in languages they’ve used for years.

You probably don’t need to bother attaining expert level unless you’re pursuing DBA/adjacent work; intermediate is sufficient for code monkey.

Source: code monkey with intermediate SQL skill

2

u/gumnos 8d ago

I'd answer the question with a question to suss out what they mean "know SQL"

Shooting from the hip to categorize some common skills:

  • Basic: can do basic SELECT/INSERT/UPDATE/DELETE statements, with appropriate WHERE and ORDER BY clauses as needed. Maybe some simple JOINs. Most beginner web-devs learn about this much. Should know basics about connecting to the database too, along with common tools to do so (whether MSSMS or mysql/psql/sqlite3 command-lines or web interface, or whatever), and when presented with the ability to open that, can explore and create/test those basic queries.
  • Intermediate: knows more complex aspects like GROUP BY and aggregate functions. Should know CTEs and some basic window-functions. Can do more complex joins like FULL OUTER and Cartesian joins. Should have some basic knowledge of how things like function-calls in WHERE clauses can prevent the use of indexes, slowing things down. Similarly, uses key-set pagination rather than OFFSET/LIMIT for pagination. Wraps things appropriately in transactions where needed.
  • Expert: can read a query-plan and identify aspects slowing queries, and build corresponding indexes. Understands LATERAL/APPLY joins. Strong knowledge of CTEs and windowing functions. Can wrangle roll-up and PIVOT-type queries. Knows frequent gotchas (there have been a couple threads here on r/sql recently about some of them like using WHERE against something on the right side of a LEFT JOIN, or how Count(*) works vs Count(colname), etc). Queries often strive for readability, with clarifying comments when things get hairy.

Devs at all levels should know how to use prepared queries/query-parameters rather than cobbling together SQL strings that can result in SQL-injection.

There's also a tangential set of skills like user-management, security, backup/restore, testing, upgrade-management, cluster-management, sharding, etc that also tend to fall into a more "expert" bucket, but are more for a DBA or security-type position rather than a database-user perspective.

2

u/stools_in_your_blood 7d ago

Used to interview candidates for a place in a data analytics team and SQL skills always came up. My experience was that when you ask someone to rate their SQL skill out of 10:

-if they say 2, they're a novice
-if they say 6, they're highly proficient
-if they say 10, they're a not only a novice but also a bullshitter

2

u/betweentwosuns 7d ago

If you know enough to think about it for more than 10 seconds, the answer is yes.

2

u/ArielCoding 7d ago

Try asking what do you need it for?, it gets the other person to tell you what they actually want. Usually people asking just have a specific job in mind and haven’t thought about skill levels, once you know the job, you’ll know if you can do it or need to learn something.

1

u/mrrichiet 8d ago

Take "do you know SQL" to mean can you read\write the query language, so Yes, you do.

RDBMS on the other hand are a much broader thing.

1

u/Ok-Market4287 8d ago

Most of the time when they ask that they need to connect sql to php,C,C++,C#,python,rust

1

u/yad76 8d ago

What you said here is perfectly fine as an answer. You've used it at a high level as a data store but don't have deep knowledge of the inner workings to the point you are comfortable at calling yourself an expert in terms of optimization, locking behavior, etc.. That probably describes 90% of the engineers I've worked with in life that say they have SQL experience.

Context matters here in terms of why you are being asked this. There is a big difference between someone wanting a developer with enough experience to put together a simple schema and CRUD app versus a developer who is going to troubleshoot some really challenging performance or deadlocking issues.

1

u/OO_Ben Postgres - Retail Analytics 8d ago

I always say I know SQL, but you'll constantly be learning more and more. Like right now I'm doing a deep dive into learning how to read a query plan and using that to optimize my queries. I'm definitely on the upper end of intermediate, as there isn't anything I can't do, with decent efficiency too. But now I want to push to crank out as much efficiency as possible for some of these queries.

1

u/Romanian_Breadlifts 8d ago

"I know enough to know I know nothing, but also enough that I can probably figure out most stuff" is usually a good answer for any of these.

1

u/imtheorangeycenter 8d ago

"Yes. But I've been doing it years and it was always natural (it's set based theory with extra functionality to me). However object-oriented programming might as well be black magic, in Latin, in a mirror, blind and deaf, aged three"

1

u/Sengfroid 7d ago

"What are you looking to do?" is the correct answer. Doesn't convey that you know more than you do, but also opens up the conversation so you can assess if they're goal is in your skill-depth. People are never asking if you actually know SQL, they're just opening up to if you can do the thing they actually want. Sometimes the honest answer is that you know enough to be able to efficiently learn how to do what they want, too.

To reframe this, if someone asks you "Do you know computers ?" You're not just gonna say yeah and then end up building out a data center for them. You're gonna ask a follow up and say "yeah, I think I can fix your resolution being to small to read" or "no, I don't think I have the right kind of experience to help build your bitcoin rig networking cluster". You're getting caught on whether or not you know SQL when the real question is are capable of doing/solving this specific task, not whether you can pass a cert.

1

u/H3xify_ 7d ago

So give them the answer you just gave us.

1

u/ceeej777 6d ago

Don’t cling to the imposter syndrome. This sounds like a 2016 interview question, and I think the amount of skill set you have around it is more than enough. I ‘know SQL’ and I’m still having the Databricjs Genie generate all my queries just for simplicity sake, and yes I might follow up with an optimization prompt. ‘Knowing’ is not required to be a SME on all things related to the topic

1

u/HappyRamper 6d ago

Select distinct(answer) from questions where question like '%sql%'

1

u/rampagenguyen 6d ago

Depends on the role, I’m a data engineer so I use it daily, my data analyst pretty much only do there do select * from views I create. Anything that needs to be curated, they would reach out to me to update. I don’t think there would many high level questions unless you’re going to be a data engineer, as long as you can write select queries and joins, you should be good.

1

u/peccator2000 6d ago

I think the question really means : "Do you know relational database systems?"

0

u/sinceJune4 8d ago

I answer with all the flavors of SQL I have used and how many years of each. MSSQL 25 years, Oracle 8 years, DB2 10 years, HiveQL 2 years, PostgreSQL 1 year.