10-98 3-1-(a) 查询电影“M3”中的男影星
本题目要求编写SQL语句,
查询电影M3
中的男
影星。
提示:请使用SELECT语句作答。
select name
from MovieStar join StarsIn on MovieStar.name=StarsIn.starName
where movieTitle='M3' and gender='M'
10-99 3-1-(b) 查询st1制片公司的总裁
本题目要求编写SQL语句,
查询st1
制片公司的总裁。
提示:请使用SELECT语句作答。
select MovieExec.name
from MovieExec join Studio on MovieExec.certID=Studio.presCertID
where Studio.address='sta1'
10-100 3-1-(c)查询在st1公司于2018年制作的电影中出演的影星
本题目要求编写SQL语句,
查询在st1
公司于2018
年制作的电影中出演的影星。
提示:请使用SELECT语句作答。
select distinct starName
from StarsIn,Movie
where StarsIn.movieTitle=Movie.title and StarsIn.movieYear=Movie.year and year=2018 and studioName='st1'
10-101 A1-2根据所在国家查找订单信息
在订单表(orders)
中找出所在国家(ShipCountry)
是Germany
或Brazil
或France
的订单编号(OrderID)
和顾客编号(CustomerID)
提示:请使用SELECT语句作答。
select OrderID,CustomerID
from orders
where ShipCountry='Germany' or ShipCountry='Brazil' or ShipCountry='France'
10-102 A1-3查询顾客表中所有不重复的城市
查询出顾客表(customers)
中所有不重复的所在城市(City)
提示:请使用SELECT语句作答。
select distinct City
from customers
10-103 A1-4在产品表中找出库存数量大于50的产品的信息
在产品表(products)
中找出库存数量(UnitsInStock)
大于50
的产品编号(ProductID)
,产品名称(ProductName)
提示:请使用SELECT语句作答。
select ProductID,ProductName
from products
where UnitsInStock>50
10-104 3-1-(d)查询比电影《M1》时间更长的电影
本题目要求编写SQL语句,
查询比电影M1
时间更长的电影。
提示:请使用SELECT语句作答。
select title,year
from Movie
where length>100
10-105 3-1-(e)查询比a1更富有的行政长官
本题目要求编写SQL语句,
查询比a1
更富有的行政长官。
提示:请使用SELECT语句作答。
select MovieExec.name
from MovieExec,Studio
where MovieExec.certID=Studio.presCertID
and netWorth>111 and certID in(select presCertID from Studio)
10-106 A1-5在顾客表中找出特定名字的顾客信息
在顾客表(customers)
中找出公司名(CompanyName)
中包含字符串th
的顾客编号和公司名称
提示:请使用SELECT语句作答。
select CustomerID,CompanyName
from customers
where CompanyName like '%th%'
10-107 3-2-(a)查询配置了容量至少为1G字节硬盘的便携式电脑的生产厂商及其速度
本题目要求编写SQL语句,
查询配置了容量至少为1G字节硬盘的便携式电脑的生产厂商及其速度。
select maker,speed
from laptop,product
where laptop.model=product.model
and hd>=1 and type='便携式电脑'