Graded Quiz: Views, Stored Procedures and Transactions

11. A stored procedure can:

  • Be written in different languages
  • Accept information
  • Return results
  • All of the above

12. What does ACID stand for?

  • Atomic, Consistent, Isolated, Durable
  • Alternative, Creative, Isolated, Durable
  • Atomic, Consistent, Initiated, Duplicated
  • Asynchronous, Complete, Individual, Direct

13. Which of the following SQL statements will create a view named EMP_VIEW with an employee’s First name, last name, and ID, based on the EMPLOYEES tables?

  • CREATE VIEW EMP_VIEW (EMP_ID, FIRSTNAME, LASTNAME)

    AS SELECT EMP_ID, F_NAME, L_NAME

    FROM EMPLOYEES;

  • CREATE VIEW EMP_VIEW (EMP_ID, FIRSTNAME, LASTNAME)

    FROM EMPLOYEES;

  • CREATE VIEW EMP_VIEW (EMP_ID, FIRSTNAME, LASTNAME)

    AS SELECT EMP_ID, F_NAME, L_NAME;

  • NEW VIEW EMP_VIEW (EMP_ID, FIRSTNAME, LASTNAME)

    AS SELECT EMP_ID, F_NAME, L_NAME

    FROM EMPLOYEES;

14. Which of the following SQL statements will create a view that lists only the employees in department number 7?

  • CREATE VIEW EMP_VIEW (EMP_ID, FIRSTNAME, LASTNAME)

    AS SELECT EMP_ID, F_NAME, L_NAME

    FROM EMPLOYEES

    WHERE DEP_ID = 7;

  • CREATE VIEW EMP_VIEW (EMP_ID, FIRSTNAME, LASTNAME)

    AS SELECT EMP_ID, F_NAME, L_NAME

    WHERE DEP_ID = 7;

  • CREATE VIEW EMP_VIEW (EMP_ID, FIRSTNAME, LASTNAME)

    AS SELECT EMP_ID, F_NAME, L_NAME

    FROM EMPLOYEES

    IF DEP_ID = 7;

  • CREATE VIEW EMP_VIEW (EMP_ID, FIRSTNAME, LASTNAME)

    WHERE DEP_ID = 7

    AS SELECT EMP_ID, F_NAME, L_NAME

    FROM EMPLOYEES;

15. You are developing an application that helps users transfer money from one bank account to another. In tests, the source account is debited, but the target account is not credited. Which of the following SQL commands undoes all the changes made during the transfer to leave the database in a stable state?

  • ROLLBACK
  • COMMIT
  • BEGIN
  • DROP

Graded Quiz: JOIN operations

16. An INNER JOIN returns only the rows that match. (T/F)

  • True
  • False

17. A LEFT OUTER JOIN displays all the rows from the right table, and combines matching rows from the left table. (T/F)

  • True
  • False

18. When using an OUTER JOIN, you must explicitly state what kind of OUTER JOIN you want - a LEFT JOIN, a RIGHT JOIN, or a FULL JOIN. (T/F)

  • True
  • False

19. Which of the following are valid types of JOINs?

  • LEFT OUTER JOIN
  • RIGHT OUTER JOIN
  • FULL OUTER JOIN
  • FULL LEFT JOIN
  • All of the above

20. A FULL JOIN returns only the rows that match. (T/F)

  • True
  • False

Leave a Reply