Basic Queries  «Prev  Next»

Essential SQL - Quiz

Each question is worth one point. Select the best answer for each question.
 
1. Which of the following statements is correct?
Please select the best answer.
  A. SELECT CustNo, LName, FName ORDER BY Zip
  B. SELECT * FROM CustTable ORDER BY State
  C. SELECT * FROM CustTable ORDER BY St = 'AZ'
  D. SELECT * FROM CustTable ORDER BY CustNo

2. Which of the following statements will delete inactive customer records?
Please select the best answer.
  A. DELETE * FROM CustTable WHERE Status = 'I'
  B. DELETE FROM CustTable WHERE Status = 'I'
  C. DELETE FROM CustTable
  D. DELETE * WHERE Status = 'I'

3. Which of the following statements correctly changes customers in Ohio to inactive status?
Please select the best answer.
  A. UPDATE CustTable SET Status = 'I' WHERE ST = 'OH'
  B. UPDATE CustTable (Status) WHERE ST='OH' VALUES ('I')
  C. UPDATE Status FROM CustTable WHERE ST = 'I'
  D. UPDATE Status WHERE ST='OH' SET Status = 'I'

4. Which of the following statements adds a record to CustTable and correctly assigns values to the CustNo, LName, and FName columns?
Please select the best answer.
  A. INSERT (CustNo,LName,FName) INTO CustTable VALUES ('00005','Jones','Tom')
  B. INSERT INTO CustTable (CustNo,LName,FName) VALUES ('00005','Jones','Tom')
  C. INSERT INTO CustTable (CustNo, LName,FName) VALUES ('Jones','Tom')
  D. INSERT VALUES ('00005','Jones','Tom') INTO CustTable (CustNo, LName,FName)
Correct answers:

Your Score: 0