21-30 câu SQL
10 Questions
0 Views

21-30 câu SQL

Created by
@BuoyantOakland8071

Podcast Beta

Play an AI-generated podcast conversation about this lesson

Questions and Answers

  1. (0.150 Point) Which of the following SELECT statements lists the highest retail price of all books in the Family category?

  • A. SELECT MAX(retail) FROM books WHERE category - 'FAMILY': (correct)
  • B. SELECT MAX(retail) FROM books HAVING category = 'FAMILY';
  • C. SELECT retail FROM books WHERE category 'FAMILY' HAVING MAX(retail);
  • D. None of the above
    1. (0.150 Point) Consider the following schema: T_CUSTOMER(CUST_ID, CUST_NAME, CUST_ADDRESS) T_ORDER(ORDER_ID, ORDER DATE, CUST_ID) What are the names of all customers who have placed orders?

  • A. SELECT T_CUSTOMER.CUSTOMER_ID, CUSTOMER_NAME, ORDER_ID FROM T_CUSTOMER, T_ORDER
  • B. SELECT T_CUSTOMER.CUSTOMER_ID, CUSTOMER_NAME, ORDER_ID FROM T_CUSTOMER WHERE T_CUSTOMER.CUSTOMER_ID=T_ORDER.CUSTOMER_ID;
  • C. SELECT T_CUSTOMER.CUSTOMER_ID, CUSTOMER_NAME, ORDER_ID FROM T_CUSTOMER, T_ORDER WHERE T_CUSTOMER.CUSTOMER_ID=T_ORDER.CUSTOMER_ID; (correct)
  • D. None of the above
    1. (0.150 Point) Consider the following schema: T_CUSTOMER(CUST_ID, CUST_NAME, CUST_ADDRESS) T_ORDER(ORDER_ID, ORDER_DATE, CUST_ID) List customer name, identification number, and order number for all order listed in the ORDER table. Include order number even if there is no customer name and identification number available.

  • A. SELECT T_CUSTOMER.CUSTOMER_ID, CUSTOMER_NAME, ORDER_ID FROM T_CUSTOMER LEFT JOIN T_ORDER ON T_CUSTOMER.CUSTOMER_ID=T_ORDER.CUSTOMER_ID;
  • B. SELECT T_CUSTOMER.CUSTOMER_ID, CUSTOMER_NAME, ORDER_ID FROM T_CUSTOMER RIGHT JOIN T_ORDER ON T_CUSTOMER.CUSTOMER_ID=T_ORDER.CUSTOMER_ID; (correct)
  • C. SELECT T_CUSTOMER.CUSTOMER_ID, CUSTOMER_NAME, ORDER ID FROM T_CUSTOMER INNER JOINT ORDER ON T_CUSTOMER.CUSTOMER_ID=T_ORDER.CUSTOMER ID;
  • D. SELECT T_CUSTOMER.CUSTOMER_ID, CUSTOMER_NAME, ORDER_ID FROM T_CUSTOMER,T ORDER WHERE T_CUSTOMER.CUSTOMER_ID=T_ORDER.CUSTOMER_ID,
    1. (0.150 Point) Select DatePart(yy, '20/01/2021') As 'Năm'

    <p>B. 2021</p> Signup and view all the answers

    1. (0.150 Point) Table: Customer(CUSTOMER_ID, CUSTOMER_NAME, CUSTOMER_ADDRESS) Give the following authorization command GRANT SELECT ON T_CUSTOMER(CUSTOMER_NAME, CUSTOMER_ADDRESS) TO USER The user that executes the SELECT * FROM T_CUSTOMER statement after being authorized is true, false or not possible

    <p>B. FALSE</p> Signup and view all the answers

    1. (0.150 Point) Which of the following SQL statements are used to establish a security scheme for a database?

    <p>C. Grant, Revoke</p> Signup and view all the answers

    1. (0.150 Point) A trigger fires in response to .....and ...statements

    <p>C. Insert, Delete, Update</p> Signup and view all the answers

    1. (0.150 Point) Consider the following steps:
    • Transaction A retrieves record R at time T
    • Transaction B retrieves the same record at time T + 1
    • Transaction A updates the record at time T+2 (base on value seen at time T)
    • Transaction B updates the same record at time T+3 (base on value seen at time T+1) What is the result of the above sequence of steps?

    <p>B. Transaction A's update would be overwritten by transaction B's update B1</p> Signup and view all the answers

    1. (0.150 Points) Which of the following statements contains an error?

    <p>D. SELECT empid WHERE empid = 56949 AND lastname = 'SMITH';</p> Signup and view all the answers

    1. (0.150 Points) What are the benefits of Triggers?

    <p>D. All of the above</p> Signup and view all the answers

    Use Quizgecko on...
    Browser
    Browser