- 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é
Quiz de SQL: Subqueries
This SQL quiz covers subqueries: a query nested inside another one in WHERE, SELECT or FROM. You will predict the output of scalar, IN, correlated and derived-table subqueries and learn why some of them fail.
Pergunta de exemplo
Pergunta 1 de 10What does this print?
CREATE TABLE products (name TEXT, price INTEGER);
INSERT INTO products VALUES ('pen', 2), ('book', 12), ('bag', 30), ('cup', 5);
SELECT name
FROM products
WHERE price > (SELECT AVG(price) FROM products)
ORDER BY name;
Mostrar a resposta
A. bag The subquery runs first and returns one value, the average 49 / 4 = 12.25. Only the bag costs more; the book at 12 is just below it.
O que este quiz cobre
- Comparing against a scalar subquery like
AVG(...) IN (subquery)and why it never duplicates rows- Correlated subqueries that run per outer row
- Subqueries in
FROM(derived tables) and their aliases - When a subquery can be rewritten as a join
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.