- Executores
-
Aprender
Aprender Python Exemplos executáveis, NumPy, pandas e mais Aprender IA / Machine LearningRedes neurais, ML e LLMs do zero Aprender C e C++ Ponteiros, memória, STL e C++ moderno Aprender C#Fundamentos, POO, LINQ, async e exercícios .NET Aprender MatplotlibGráficos de linha, barras, dispersão e pizza com visualizadores Aprender RustOwnership, traits, tratamento de erros e threads Aprender GoSlices, interfaces, goroutines e channels Algoritmos em Python Busca, ordenação, recursão e visualizações O(n) Algoritmos em C e C++ Compare implementações em C e C++ Programação para crianças Aprenda a programar brincando!
- QuizzesNovo
- DesafiosNovo
- Para professoresNovo
- Atualizações
- Me pague um café
Classic SQL Interview Queries
This SQL quiz walks through the classic interview queries and the traps hidden in each one. You will work out second highest and Nth highest salaries, find and delete duplicates, rank rows per group and compare employees with their managers.
Pergunta de exemplo
Pergunta 1 de 10What does this print?
CREATE TABLE employees (id INTEGER, name TEXT, salary INTEGER);
INSERT INTO employees VALUES
(1, 'Ann', 9000), (2, 'Bob', 9000), (3, 'Cy', 7000), (4, 'Dee', 5000);
SELECT MAX(salary) FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
Mostrar a resposta
B. 7000 The subquery finds the top salary (9000), and the outer query takes the largest salary below it. Ties at the top do not matter, so this returns the second highest distinct salary, 7000.
O que este quiz cobre
- Second and Nth highest salary, with ties
- Finding and deleting duplicate rows
- Top N per group with window functions
- Self joins, like employees earning more than their manager
- Rows with no match (anti-joins)
Perguntas frequentes
Preciso de uma conta?
Não. Qualquer pessoa pode jogar. Entre para guardar seu XP, sequência, badges e histórico.
Posso refazer?
Pode. Sua melhor nota fica salva, e as perguntas e respostas são embaralhadas a cada vez.