分数 20
全屏浏览题目
切换布局
作者 柯海丰
单位 浙大城市学院
在产品表(products)
中查询最多的库存数量(UnitsInStock)
,并重命名为maxUnitsInStock
提示:请使用SELECT语句作答。
表结构:
列名 | 数据类型 | 长度 | 主码 | 说明 |
---|---|---|---|---|
ProductID | int | 11 | √ | 产品编号 |
ProductName | varchar | 40 | 产品名称 | |
SupplierID | int | 11 | 供应商编号 | |
CategoryID | int | 11 | 种类编号 | |
QuantityPerUnit | varchar | 20 | 数量 | |
UnitPrice | decimal | 10,4 | 单价 | |
UnitsInStock | smallint | 2 | 库存数量 | |
UnitsOnOrder | smallint | 2 | 订购数量 | |
ReorderLevel | smallint | 2 | 再次订购量 | |
Discontinued | bit | 1 | 中止 |
表样例
products
表:
ProductID | ProductName | SupplierID | CategoryID | QuantityPerUnit | UnitPrice | UnitsInStock | UnitsOnOrder | ReorderLevel | Discontinued |
---|---|---|---|---|---|---|---|---|---|
1 | Chai | 1 | 1 | 10 boxes x 20 bags | 18 | 39 | 0 | 10 | |
2 | Chang | 1 | 1 | 24 - 12 oz bottles | 19 | 17 | 40 | 25 | |
3 | Aniseed Syrup | 1 | 2 | 12 - 550 ml bottles | 10 | 13 | 70 | 25 | |
4 | Chef Anton's Cajun Seasoning | 2 | 2 | 48 - 6 oz jars | 22 | 53 | 0 | 0 | |
5 | Chef Anton's Gumbo Mix | 2 | 2 | 36 boxes | 21.35 | 0 | 0 | 0 | |
6 | Grandma's Boysenberry Spread | 3 | 2 | 12 - 8 oz jars | 25 | 120 | 0 | 25 | |
7 | Uncle Bob's Organic Dried Pears | 3 | 7 | 12 - 1 lb pkgs. | 30 | 15 | 0 | 10 | |
8 | Northwoods Cranberry Sauce | 3 | 2 | 12 - 12 oz jars | 40 | 6 | 0 | 0 | |
9 | Mishi Kobe Niku | 4 | 6 | 18 - 500 g pkgs. | 97 | 29 | 0 | 0 | |
10 | Ikura | 4 | 8 | 12 - 200 ml jars | 31 | 31 | 0 | 0 |
输出样例:
maxUnitsInStock |
---|
120 |
select max(UnitsInStock) maxUnitsInStock
from products