Test your expertise with advanced SQL questions commonly faced in interviews at top companies. This quiz gauges your knowledge of complex SQL concepts, syntax, and best practices.
If you want to assign a rank to each employee's salary in descending order within the same result set (without collapsing rows), which SQL window function is best suited for this task?
Which table constraint ensures that a column contains only unique, non-NULL values and is used to uniquely identify each row in a table?
What type of SQL JOIN returns all rows from both tables, with NULLs in places where a match does not exist?
If you need to remove all data from a table and also free the storage space used, which SQL statement should you use?
Which clause should you use to filter the results of a GROUP BY aggregation, such as finding departments with average salary above $70,000?
Which SQL query correctly finds the second highest salary from an 'employees' table?
Which form of normalization ensures that every non-prime attribute is fully functionally dependent on the primary key but not on a subset of any composite key?
To select only unique city names from a table named 'addresses', which SQL keyword should you use in your SELECT statement?
In the statement 'SELECT AVG(age) FROM users;', what is the purpose of AVG()?
Given two SELECT queries for customer IDs, which operator should you use to combine their results while including all duplicates?