Database Application Pre-Test

  1. Which table from the StayWell student accommodation database stores information about the locations where StayWell administrators work as they contribute property rentals and maintenance?




    D. OFFICE
  2. At KimTay Pet Supplies, there is a ______ relationship between sales rep and customers.




    D. one-to-many
  3. A relational database is named for its relations, also known as ________.




    B. tables
  4. The column or collection of columns that uniquely identifies a given row in a table is that table's ______.




    D. primary key
  5. In one style of entity-relationship(E-R) diagram, diamonds are used to describe _________.




    B. relationships
  6. Each SQL statement ends with a(n) _________.




    A. semicolon
  7. Which command is used to activate a database in MySQL?




    D. USE followed by the database name and a semicolon
  8. In Oracle, dates are enclosed in single quotation marks and have the format ______.




    C. DD-MON-YYYY
  9. In SQL nulls ________.




    D. are allowed by default
  10. A value of which of the following data types should be enclosed in single quotation marks as it is added to a table row using an SQL command?




    A. CHAR
  11. Bradford would like to display a table called CUPCAKES so he can inspect several rows he just added. Which SQL statement should be use?

    A. SELECT* FROM CUPCAKES;
    B VIEW* CUPCAKES;
    C. SHOW TABLES;
    D. DROP TABLE CUPCAKES;
    A. SELECT* FROM CUPCAKES;
  12. In a SQL SELECT statement, the FROM clause and the WHERE clause (when used) must appear on separate lines.

    A. True
    B. False
    B. False
  13. When a compound condition is used for an SQL query, that condition is true when  ______.




    B. any of the two or more of its simple conditions connected by the OR operator is true
  14. Which of the following symbols can be used with the LIKE operator as a wildcard to represent any collection of characters in SQL for MySQL, Oracle, or SQL Server?




    A. %
  15. When Marley wants to specify the results order for an SQL query, she includes a(n) _______.




    C. ORDER BY clause
  16. The table produced by an SQL subquery ______.




    D. is deleted after the query is evaluated
  17. London is writing an SQL query, and would like to separate order data by the bakery location where the order was placed in order to perform calculations for each location. Which clause would be most helpful for this query?




    A. GROUP BY BAKERY_ID
  18. Which clause should you use to help construct an SQL command that retrieves data from two tables, CUSTOMER and SALES_REP, that have a matching REP_ID column?




    C. WHERE (CUSTOMER.REP_ID = SALES_REP.REP_ID)
  19. To create a condition that is true if one or more rows are obtained when an SQL subquery is executed, you can precede the subquery with which operator?




    D. EXISTS
  20. Table aliases are used in SQL for simplicity and for self-joins.

    A. True
    B. False
    A. True
  21. You can use the ALL and ANY operators in SQL to ______.




    A. produce a single column of numbers
  22. Which of the following joins compares the tables in the FROM clause and lists only those rows that satisfy the condition in the WHERE clause?




    D. inner
  23. The first step when creating a new table from an existing table in SQL is to _______.




    C. describe the new table with the CREATE command
  24. Which SQL command to update an existing table is formatted correctly?




    B. UPDATE PRODUCTS SET PRICE = 5.45 WHERE (PROD_ID = '24');
  25. In SQL, how does adding rows to a table when it is initially created compare with adding rows to an existing table that already contains data?




    B. The procedure is the same.
  26. In SQL, a DELETE FROM command that specifies a table name but not a WHERE clause ________.




    C. removes all rows from the table
  27. Micah would like to update his PROSPECTS table to avoid sending promotional messages to e-mail addresses that are no longer valid. Thus, he needs to change the value of the EMAIL column to null for prospects with invalid addresses. He is starting with the prospect with ACC_NO 143907. Which SQL command should he execute?




    C. UPDATE PROSPECTS SET EMAIL = NULL WHERE (ACC_NO = '143907');
  28. To add a new column with SQL, use the ADD NEW COLUMN clause of the ALTER TABLE command.

    A. True
    B. False
    B. False
  29. To use the COMMIT command in Oracle, you must clear the check mark from which check box?




    A. Autocommit
  30. Which SQL command should Carla use when she wants to remove the SWEATERS table and all the data it contains from her database?




    C. DROP TABLE SWEATERS;
  31. In SQL, a defining query is used to ______.




    C. create a view for database users
  32. Why is the fact that views provide data independence considered a benefit?




    C. Users can continue accessing the database the same way if its structure evolves.
  33. What happens if a user accessing a table via a view attempts to add a row with a duplicate primary key value that exists in the table but is not visible in that user's view?




    A. The DBMS will reject the addition.
  34. The main mechanism for providing access to a database is the ______.




    A. GRANT command
  35. What is the major purpose of a database index?




    D. speed up data retrieval
  36. If Lorrie realizes that the disadvantages of an index she created for her database outweigh the benefits, what command should she use on the index?




    B. DROP INDEX
  37. A database's system catalog _______.




    C. is itself a relational database
  38. You use the LEGAL clause of the ALTER TABLE command to ensure that only legal values satisfying a particular condition are allowed in a given column.

    A. True
    B. False
    B. False
  39. SQL is _____.




    A. a nonprocedural language
  40. Which is true of the MySQL query SELECT UPPER(GENUS), SPECIES FROM ZOO_ANIMALS?




    B. It will display the values from the GENUS column in uppercase letters.
  41. Which MySQL statement would you use to display a grid based on the CUPCAKES table with a list of values from the FLAVOR column beside their prices from the PRICE column rounded to the nearest whole number?




    D. SELECT FLAVOR, ROUND(PRICE, 0) AS PRICE_TO_NEAREST_DOLLAR FROM CUPCAKES;
  42. What are the two arguments of the DATE_ADD function, in order?




    A. date you wish to add an interval to, interval value and unit
  43. Percy's MySQL query includes the expression: DATEDIFF(EVENT_DATE, CURDATE()) AS RESULT. What will be displayed in the RESULT column?




    B. the number of days between EVENT_DATE and today's date
  44. If you concatenate "956" and "4676," what is the result?




    B. "9564676"
  45. In PL/SQL, which attribute can you use to ensure that a variable has the same data type as a particular column in a table?




    B. %TYPE
  46. James wants to write a MySQL procedure to retrieve a single row from a table, so he prepares a script with an embedded _______.




    C. SQL query against the table's primary key
  47. What does the embedded SQL command UPDATE CLIENTS SET PHONE_NO = I_NEW_PHONE WHERE CLIENT_ID = I_CLIENT_ID; do?




    D. changes the PHONE_NO value associated with the CLIENT_ID that matches I_CLIENT_ID in the CLIENTS table to the I_NEW_PHONE value
  48. A pointer to a row in the collection of rows retrieved by an SQL command is called a _________.




    B. cursor
  49. In MySQL, what happens when a user calls a procedure without error handling that retrieves data from a single row, but enters an invalid primary key argument?




    A. a NULL value is displayed
  50. In SQL Server, the INSERTED table within a T-SQL trigger is a temporary system table that contains a copy of the values that the last SQL command inserted.

    A. True
    B. False
    A. True
Author
jdavis123
ID
358700
Card Set
Database Application Pre-Test
Description
Updated