Database Foundations - Quiz Explanation

The answers you selected are indicated below, along with text that explains the correct answers.
 
1. Which item below refers to a specific item of information (for example, a last name) within a table?
Please select the best answer.
  A. A column
  B. A row
  C. A table
  D. A database
  The correct answer is A.
A column is the item that holds specific information in a table. Rows contain complete records or individual sets of information; tables store multiple rows of data; and a database contains one or more tables.

2. What clause do you use if you want to create a column that does not allow blank values?
Please select the best answer.
  A. NOT BLANK
  B. REQUIRED
  C. NOT NULL
  D. NOT NULLABLE
  The correct answer is C.
The NOT NULL clause will cause the engine to disallow empty values for the column.

3. What benefits do indexes provide for your queries?
Please select the best answer.
  A. Faster query times
  B. Sorting
  C. Better use of the database engine (less work in retrieving your results)
  D. Both A and C
  The correct answer is D.
Sortng is provided by the ORDER BY clause, not by the index. Indexes are largely for optimization, providing the database engine with the information it needs to fulfill your query in a timely manner.

4. Which of the statements below is correct?
Please select the best answer.
  A. CREATE NEW INDEX New_Index on MyTable (MyColumn)
  B. CREATE INDEX ON MyTable(MyColumn) NAME New_Index
  C. CREATE INDEX New_Index ON MyTable(MyColumn)
  D. CREATE INDEX ON MyTable(MyColumn) AS New_Index
  The correct answer is C.
The proper statement calls out the index name first and then the table and column or columns that will be used. Note that you can refer to more than one column--simply separate the column names with a comma.

5. Which of the following statements is incorrect regarding indexes?
Please select the best answer.
  A. Indexes are largely for optimizing the query of a table.
  B. Indexes control the sort order for information in the table.
  C. Indexes provide a logical path for the engine to consider when it extracts information from the table.
  D. Indexes are manually created using SQL commands.
  The correct answer is B.
Indexes do not control the sort order of information. To control the sort order, use the ORDER BY clause.