PHP Chapter 7

19 Questions | Total Attempts: 41

SettingsSettingsSettings
Please wait...
PHP Quizzes & Trivia

Welcome to the seventh chapter of our ongoing quizzes on the vastly popular server-side scripting language, PHP, in which we will be talking all about flat-file and relational databases, primary keys and SQL commands. How much do you know?


Questions and Answers
  • 1. 
    A flat-file database consists of a single table.
    • A. 

      True

    • B. 

      False

  • 2. 
    What is the correct term for the individual pieces of information that are stored in a database record?
    • A. 

      element

    • B. 

      Section

    • C. 

      Field

    • D. 

      Container

  • 3. 
    What is the name of one table’s primary key when it is stored in another table? (Choose all that apply.)
    • A. 

      Key symbol

    • B. 

      Record link

    • C. 

      Foreign key

    • D. 

      Unique identifier

  • 4. 
    Breaking tables into multiple related tables to reduce redundant and duplicate information is called         .
    • A. 

      Normalization

    • B. 

      Redundancy design

    • C. 

      Splitting

    • D. 

      Simplification

  • 5. 
    Suppose you have a relational database for a dry cleaning company. Each customer of the drycleaning company can have multiple items in a cleaning order. What type of relationship is this?
    • A. 

      One-to-one

    • B. 

      One-to-many

    • C. 

      Many-to-one

    • D. 

      Many-to-many

  • 6. 
     ______ has become somewhat of a standard data manipulation language among many databasemanagement systems. 
    • A. 

      Java

    • B. 

      SQL

    • C. 

      ASP.NET

    • D. 

      PERL

  • 7. 
    Files created by different database management systems are completely interchangeable.
    • A. 

      True

    • B. 

      False

  • 8. 
    What is the default value of the mysql command’s -h argument?
    • A. 

      Database

    • B. 

      Mysqlmonitor

    • C. 

      Mysqladmin

    • D. 

      Localhost

  • 9. 
    What character must terminate SQL commands in the MySQL Monitor? 
    • A. 

      Colon (:)

    • B. 

      Semicolon (;)

    • C. 

      ampersand (&)

    • D. 

      Period (.)

  • 10. 
    With what characters do you quote identifiers that include special characters? 
    • A. 

      Quotation marks ('

    • B. 

      Double quotation marks (")

    • C. 

      Backticks (`)

    • D. 

      Tildes (~)

  • 11. 
    SQL keywords are case sensitive in the MySQL Monitor.
    • A. 

      True

    • B. 

      False

  • 12. 
    Which of the following statements displays the available databases in your MySQL installation? 
    • A. 

      SHOW DATABASES;

    • B. 

      SHOW DATABASES();

    • C. 

      LIST FILES;

    • D. 

      GET LIST();

  • 13. 
    What’s the first thing you should do after creating a new database?
    • A. 

      Save the database.

    • B. 

      Restart the MySQL Monitor.

    • C. 

      Select the database.

    • D. 

      Create a table.

  • 14. 
    A GRANT statement does not create new user accounts.  (pg 409)
    • A. 

      True

    • B. 

      False

  • 15. 
    Which of the following keywords performs a reverse sort of database records? 
    • A. 

      DESC

    • B. 

      REVERSE

    • C. 

      DESCEND

    • D. 

      SORTR

  • 16. 
    Which of the following is the correct string for a filter that narrows a recordset to include only records in which the State field is equal to Massachusetts?
    • A. 

      "WHERE State = 'Massachusetts'"

    • B. 

      "State = 'Massachusetts'"

    • C. 

      "WHERE 'State' = Massachusetts"

    • D. 

      "'State' = 'Massachusetts'"

  • 17. 
    A ________ table creates a one-to-many relationship for each of the tables in a many-to-manyrelationship. A _______ table contains foreign keys from the two tables in a many-to-many relationship, along with any other fields that correspond to a many-to-many relationship. A _______ table is often called a linking table or a cross-reference table.
  • 18. 
    American National Standards Institute ______
  • 19. 
    To add multiple records to a database, you use the _______ _______ statement with a local text file that contains the records you want to add.