27. View the Exhibit and examine the structure of the PRODUCT_INFORMATION
table.You want to see the product names and the date of expirat ion of warranty
for all the products, if the product is purchased today. The products that
have no warranty should be displayed at the top and the
products with maximum warranty period should be displayed at the bottom.
Which SQL statement would you execute to fulfill this requirement?
查看表结构,如果是今天购买的,想要看到产品名,所有商品保修期,没有保修的排在顶端,最大保修日期的排在低端。
SQL> SELECT product_name, category_id, SYSDATE+warranty_period AS "Warranty
2 expire date" FROM product_information3 ORDER BY SYSDATE+warranty_period
4 ;
SELECT product_name, category_id, SYSDATE+warranty_period AS "Warranty
expire date" FROM product_information
ORDER BY SYSDATE+warranty_period
实验:
SQL> SELECT product_name, category_id, SYSDATE+warranty_period AS "Warranty expire date"
2 FROM product_information
3 ORDER BY SYSDATE+warranty_period
4 ;
PRODUCT_NAME CATEGORY_ID Warranty expire date
-------------------------------------------------- ----------- --------------------
Screws <S.32.S> 19 2013/8/1 15:32:08
Screws <Z.16.S> 19 2013/8/1 15:32:08
Screws <Z.24.S> 19 2013/8/1 15:32:08
Screws <Z.28.P> 19 2013/8/1 15:32:08
Base ISO CP - BL 29 2013/8/1 15:32:08
Client ISO CP - S 29 2013/8/1 15:32:08
OSI 8-16/IL 29 2013/8/1 15:32:08
IC Browser Doc - S 29 2013/8/1 15:32:08
Client ISO CP - S 29 2013/8/1 15:32:08
Client ISO CP - V 29 2013/8/1 15:32:08
OSI 1-4/IL 29 2013/8/1 15:32:08
MB - S900/650+ 15 2013/8/1 15:32:08
WSP DA-130 15 2013/8/1 15:32:08
WSP DA-290 15 2013/8/1 15:32:08
Cable Connector - 32R 19 2013/8/1 15:32:08
Cable Harness 19 2013/8/1 15:32:08
Paper Tablet LW 8 1/2 x 11 32 2013/8/1 15:32:08
Pens - 10/FP 32 2013/8/1 15:32:08
Business Cards Box - 250 32 2013/8/1 15:32:08
Business Cards - 1000/2L 32 2013/8/1 15:32:08