Kodewick
开始学 →
基础←→0 / 70

奥斯陆或罗马

#017基础查询约 3 分钟

宠物医院要在奥斯陆和罗马办活动,想通知那里的主人。从 owners 表里选出 city 是 'Oslo' 或 'Rome' 的人,要 name 和 city 两列。

用到的表
owners
idnamecityphone
1LenaOslo555-0101
2MarcoRomeNULL
3PriyaOslo555-0103
4OmarCairoNULL
5SofiaRome555-0105
5 行
pets
idnamekindageweightowner_id
1Biscuitdog3121
2Mochicat541
3Pepperdog8202
4Nemofish1NULL3
5Lunacat233
6Rexdog1130NULL
7Kiwibird4NULL5
8Tofucat75NULL
8 行
query.sql
-- 在这里写:用 WHERE city IN (…) 留下这两个城市的
SELECT name, city
FROM owners;
Ctrl + Enter 也能运行
结果

写好了先点「运行」看看结果,没问题再点「提交」。