Coin163

首页 > 132.View the Exhibit and examine the structure of the SALES and PRODUCTS tables.

132.View the Exhibit and examine the structure of the SALES and PRODUCTS tables.

相关标签: 1z0-051 structure

2020腾讯云10周年活动,优惠非常大!(领取2860元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1040

2020阿里云最低价产品入口,含代金券(新老用户有优惠),
入口地址https://www.aliyun.com/minisite/goods

相关推荐:60.View the Exhibit and examine the structure of CUSTOMERS table.

60.View the Exhibit and examine the structure of CUSTOMERS table. Evaluate the following query: SQL>SELECT cust_id, cust_city FROM customers WHERE  cust_first_name NOT LIKE 'A_%g_%' AND cust_credit_limit BETWEEN 5000 AND 15000 AND cust_cred

132.View the Exhibit and examine the structure of the SALES and PRODUCTS tables.
In the SALES table, PROD_ID is the foreign key referencing PROD_ID in the PRODUCTS table,
You want to list each product ID and the number of times it has been sold.
Evaluate the following query:


SQL>SELECT p.prod_id, COUNT(s.prod_id)
FROM products p sales s
ON p.prod_id = s.prod_id
GROUP BY p.prod_id;

Which two JOIN options can be used in the blank in the above query to get the required output? (Choose two.)
A.JOIN
B.FULL OUTER JOIN 
C.LEFT OUTER JOIN
D.RIGHT OUTER JOIN


答案:BC
解析:题目说列出每一个产品ID,那么可以想到,

相关推荐:159.View the Exhibit and examine the structure of the CUSTOMERS table.

159.View the Exhibit and examine the structure of the CUSTOMERS table. NEW_CUSTOMERS is a new table with the columns CUST_ID, CUST_NAME and CUST_CITY that have the same data types and size as the corresponding columns in the CUSTOMERS table

left join,这里由于sales表中的proid是PRODUCTS表
的外键,因此如果使用full join的话和left join效果是一样的

原文

132.View the Exhibit and examine the structure of the SALES and PRODUCTS tables. In the SALES table, PROD_ID is the foreign key referencing PROD_ID in the PRODUCTS table, You want

------分隔线----------------------------