"SQL skills" is a bit of a trigger phrase for me because it's very much overloaded, since SQL work ranges from developing a database (that is, writing the database server itself) through designing a database (using a DBMS someone else wrote to implement a data system), through writing queries and doing DBA work. People tend to lump these things together without carefully understanding what job they're looking for (or what candidate they want to hire) or how to best build a data team or ...
Anyway! Since you asked specifically about querying, I can leave out all the rest:
A beginner:
- Knows the tool. Can setup and use a command-line tool, a GUI tool, knows a couple of each at least. Can diagnose connection problems. Understands how to save, load, manipulate files.
- Knows the tool: understands and can diagnose errors about queries the tool might give -- doesn't say "I don't know what 'Syntax error in your SQL statement' means" and instead just fixes it themselves.
- Can write queries and understands all join types, sub-selects, GROUP BY, and ORDER BY clauses
- Understands how to test queries for correctness
- Understands data types and casting
- Familiar with data representation
- Understands constraints, default values, and auto-increment sequences
- Very familiar with available built-in functions (for strings, aggregation, date math, etc ...)
- These skills apply to at least one DBMS and tool set.
- You've asked only about querying, but certainly someone who's a beginner at writing queries can read and understand (if not write) a data model. They can find their way through the database and look at constraints and understand which relations exist and what they mean.
Intermediate:
- Appropriate use of transactions
- Able to implement error handling
- Understands DBMS query execution model: parsing, compilation, optimization, caching, concurrency control
- Starting to understand DBMS implementation-specific features: remote queries, I/O, recompiled, parameter management, ...
- Solid ideas about when the database should do the work and when the client application should do the work (wrt to sorting, representation, formatting, aggregation, etc)
- Understands locking, isolation levels, and concurrency control
- Appropriately applies more structural query models -- views, CTEs, pivot, stored procedures, UDFs, ...
- Working with windowed functions
- Starting to show competency with multiple DBMSes
- Better at understanding models, including complicated relationships. Some ideas about when one relationship model might be better than another.
Advanced:
- Mastery of skills in more than one DMBS product
- Understands query plans or EXPLAIN output
- Understands non-traditional RDBMS constructs and SQL application (column stores, streaming or distributed stores, ...) and their applications
- knows how to diagnose and correct query performance issues
- Able to identify and correct indexing problems with appropriate indexes and types
- Capable of identifying and remedying concurrency issues
- Knows when the model is the problem rather than the query (or indexes or ...) and can work to help fix it. Not strictly query-related, but I think it's inextricable.
But, I'm wondering: why are you asking? Are you a recruiter? Maybe a non-technical hiring manager? Maybe, if we know what you're after, then we can give a more relevant answer.
EDIT: added some notes about model concepts.