ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 047-132

047-132

原创 Linux操作系统 作者:jbymy2000 时间:2012-03-19 09:58:28 0 删除 编辑
132. View the Exhibit and examine the structure for the ORDERS and ORDER_ITEMS
tables.You want to display ORDER_ID, PRODUCT_ID, and TOTAL (UNIT_PRICE
multiplied by QUANTITY) for all the orders placed in the last seven days.
Which query would you execute?
A. SELECT order_id, product_id, unit_price*quantity "TOTAL"
FROM order_items oi JOIN orders o
ON (o.order_id=oi.order_id)
WHERE o.order_date>=SYSDATE-7
B. SELECT o.order_id,oi.product_id, oi.unit_price*oi.quantity "TOTAL"
FROM order_items oi JOIN orders o
USING (order_id)
WHERE o.order_date>=SYSDATE-7
C. SELECT o.order_id, oi.product_id, oi.unit_price*oi.quantity "TOTAL"
FROM order_items oi JOIN orders o
WHERE o.order_date>=SYSDATE-7
ON (o.order_id=oi.order_id).
D. SELECT o.order_id, oi.product_id, oi.unit_price*oi.quantity "TOTAL"
FROM order_items oi JOIN orders o
ON (o.order_id=oi.order_id)
WHERE o.order_date>=SYSDATE-7
answer:D
USING里面的内容不能在select里面出现

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11312660/viewspace-718946/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 047-131
下一篇: 047-133
请登录后发表评论 登录
全部评论

注册时间:2012-01-10

  • 博文量
    416
  • 访问量
    273375