Examine the data from the ORDERS and CUSTOMERS table. ORDERS

题目
单选题
Examine the data from the ORDERS and CUSTOMERS table. ORDERS ORD_ID ORD_DATE CUST_ID ORD_TOTAL 100 12-JAN-2000 15 10000 09-MAR- 101 40 8000 09-MAR- 102 35 12500 15-MAR- 103 15 12000 104 25-JUN-2000 15 6000 105 18-JUL-2000 20 5000 106 18-JUL-2000 35 7000 107 21-JUL-2000 20 6500 04-AUG- 108 10 8000 CUSTOMERS CUST_ID CUST_NAME CITY 10 Smith Los Angeles 15 Bob San Francisco 20 Martin Chicago 25 Mary New York 30 Rina Chicago 35 Smith New York 40 Linda New York Which SQL statement retrieves the order ID, customer ID, and order total for the orders that are placed on the same day that Martin places his orders?()
A

SELECT ord_id, cust_id, ord_total FROM orders, customers WHERE cust_name='Mating' AND ord _ date IN ('18-JUL-2000','21-JUL-2000');

B

SELECT ord_id, cust_id, ord_total FROM orders Where ord_date IN (SELECT ord_date FROM orders WHERE cust_id = (SELECT cust_id FROM customers WHERE cust_name = 'MARTIN'));

C

SELECT ord_id, cust_id, ord_total FROM orders Where ord_date IN (SELECT ord_date FROM orders, customers Where cust _ name = 'Martin');

D

SELECT ord_id, cust_id, ord_total FROM orders WHERE cust_id IN (SELECT cust_id FROM customers WHERE cust name = 'Martin');

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

下列语句错误的是( )

A.select * from orders where ordername is not null;

B.select * from orders where ordername<>null;

C.select * from orders where ordername is null;

D.select * from orders where ordername not is null;


正确答案:D,B 

第2题:

Examine the data from the ORDERS and CUSTOMERS tables.Evaluate the SQL statement:What is the result when the query is executed?()

A.

B.

C.

D. The query fails because the subquery returns more than one row.

E. The query fails because the outer query and the inner query are using different tables.


参考答案:D

第3题:

—Miss. Eldon, please look again for those orders from the Diamond Store.—They’re not with the other orders, sir. They () be there, but they’re not.

A、may

B、can

C、will

D、ought to


参考答案:D

第4题:

现有客户表customers(主键:客户编号cid),包含10行数据,订单表orders(外键:客户编号cid),包含6条数据。执行sql语句:select * from customers right outer join orders on customers.cid=orders.cid。最多返回()条记录。

  • A、10
  • B、6
  • C、4
  • D、0

正确答案:B

第5题:

Click the Exhibit button and examine the data from the ORDERS and CUSTOMERS tables.Evaluate the SQL statement:SELECT *FROM ordersWHERE cust_id = (SELECT cust_idFROM customersWHERE cust_name = ‘Smith‘);What is the result when the query is executed?()

A.A

B.B

C.C

D.D

E.E


参考答案:A

第6题:

The ORDERS table has these columns:ORDER_ID NUMBER(4) NOT NULLCUSTOMER_ID NUMBER(12) NOT NULLORDER_TOTAL NUMBER(10,2)The ORDERS table tracks the Order number, the order total, and the customer to whom the Order belongs.Which two statements retrieve orders with an inclusive total that ranges between 100.00 and 2000.00 dollars? ()

A. SELECT customer_id, order_id, order_total FROM orders RANGE ON order _ total (100 AND 2000) INCLUSIVE;

B. SELECT customer_id, order_id, order_total FROM orders HAVING order _ total BETWEEN 100 and 2000;

C. SELECT customer_id, order_id, order_total FROM orders WHERE order _ total BETWEEN 100 and 2000;

D. SELECT customer_id, order_id, order_total FROM orders WHERE order_total>= 100 and <= 2000;

E. SELECT customer_id, order_id, order_total FROM orders WHERE order_total>= 100 and order_total <= 2000;


参考答案:C, E

第7题:

Examine the data from the ORDERS and CUSTOMERS table.Which SQL statement retrieves the order ID, customer ID, and order total for the orders that are placed on the same day that Martin places his orders?()

A.

B.

C.

D.


参考答案:B

第8题:

下面检索结果一定不是一行的命令是( )

A.select distinct * from orders ;

B.select * from orders limit 1,2;

C.select top 1 * from orders;

D.select * from orders limit 1;


正确答案:C,A,B 

第9题:

Your company uses a SQL Server 2005 database. This database contains a trigger named trg_InsertOrders, which fires when order data is inserted into the Orders table. The trigger is responsible for ensuring that a customer exists in the Customers table before data is inserted into the Orders table. You need to configure the trigger to prevent it from firing during the data import process. You must accomplish this goal while using the least amount of administrative effort.  Which two Transact-SQL statements can you use to achieve this goal?()

  • A、 ALTER TABLE OrdersDISABLE TRIGGER trg_InsertOrders 
  • B、 DROP TRIGGER trg_InsertOrders 
  • C、 DISABLE TRIGGER trg_InsertOrders ON Orders 
  • D、 ALTER TRIGGER trg_InsertOrders  ON Orders NOT FOR REPLICATION 
  • E、 sp_settriggerorder@triggername= 'trg_InsertOrders', @order='None'

正确答案:A,C

第10题:

假设订单表orders用来存储订单信息,cid代表客户编号,money代表单次订购额,现要查询每个客户的订购次数和每个客户的订购总金额,下面()sql语句可以返回正确结果。

  • A、select cid,count(distinct(cid)),sum(money) from orders group by cid
  • B、select cid,count(distinct(cid)),sum(money) from orders order by cid
  • C、select cid,count(cid),sum(money) from orders order by cid
  • D、select cid,count(cid),sum(money) from orders group by cid

正确答案:D

更多相关问题