CRUD Statements  «Prev  Next»

Inserting Data into SQL-Server - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. The Department table has the following definition:
Column Name Datatype
DeptID Int
Description Varchar(50)

Please select the best answer.
  A. The statement will succeed because the syntax is correct.
  B. The statement will succeed because the DeptID of 5 does not exist.
  C. The statement will fail because the DeptID of 5 does exist.
  D. The statement will fail because literal values are not properly entered.

2. Paul has a table named DistributedTransactionHistory. He needs to write a long query that references this table name many times. What is the best technique for dealing with long names such as this?
Please select the best answer.
  A. Alias the table name so that a shorter name can be referenced in the query
  B. Rename the table to something smaller
  C. Place the data into a table of a different name
  D. Simply reference the long table name in the query

3. Victoria needs to insert data into the SalaryHistory table from the Salary table. What keyword would be used to retrieve data from the Salary table?
Please select the best answer.
  A. SELECT
  B. EXISTS
  C. INSERT
  D. FROM

4. Alison is about to issue a subquery to insert data into the DepartmentManager table for each of the three records in the Department table. What other way can she issue the query?
Please select the best answer.
  A. There is no other way to issue the query.
  B. She can use an IN clause and explicitly list the three values.
  C. She can join the two tables together.
  D. She can create a new table and insert the contents of both the DepartmentManager and Department tables.

5. David wants to write a distributed INSERT statement. What must he do first?
Please select the best answer.
  A. Link the server with the sp_linkserver system stored procedure
  B. Simply include the server in the FROM clause
  C. Link the server with the sp_addlinkserver system stored procedure
  D. Simply include the server in the LINK clause

6. What type of index hurts queries the most when inserting many rows of data with values that are in between existing rows of data?
Please select the best answer.
  A. Clustered
  B. Non-clustered
  C. Table scan
  D. Query Plan
Correct answers:

Your Score: 0