Kodewick
Comece a aprender →
Inicial←→0 / 70

Cidade conhecida

#045InicialIS NOT NULL2 min

A escola quer mandar pelo correio as fotos do dia de esportes, mas só para os alunos que informaram a cidade. Na tabela students, escolha o name e a city dos alunos cuja city não está vazia.

As tabelas
students
  • idPK
  • name
  • class
  • age
  • city
scores
  • idPK
  • student_idFK
  • subject
  • score

scores.student_id → students.id

students
idnameclassagecity
1Amy1A12Leeds
2Ben1A13York
3Cara1B12NULL
4Dan1B14Leeds
5Eva1A12Hull
6Finn1C13NULL
7Gus1C12York
7 linhas
scores
idstudent_idsubjectscore
11math92
21art78
32math65
42art88
53math74
64math55
74art90
85math81
95artNULL
107math99
10 linhas
query.sql
SELECT name, city
FROM students
-- seu código aqui: WHERE city IS NOT NULL fica com quem tem cidade
;
Ctrl + Enter também executa
Resultado

Executar mostra o que sua consulta devolve. Quando parecer certo, Enviar.