1. What will the following SQL script return?

/*
SELECT *
FROM
EMPLOYEES
WHERE TYPE = 'CASHIER'
*/

A. It will return all rows and columns from the EMPLOYEES table.
B. It will return the CASHIER column for all rows in the EMPLOYEES TABLE.
C. It will return all rows and columns from the EMPLOYEES table where the TYPE column = 'CASHIER'
D. It will return nothing.

2. Which of the following commands will cause a name column query set to be listed in reverse alphabetical order?

A. SORT BY NAME
B. ORDER BY PIN Z-A
C. ORDER BY NAME REVERSE
D. ORDER BY NAME DESC

3. If you want to select all rows from the STUDENTS table where the ID number is any number from 100-500, which of the following WHERE conditions would you use?

A. WHERE ID FROM 100 TO 500
B. WHERE ID IN (100,500)
C. WHERE ID BETWEEN 100 AND 500
D. WHERE ID RANGE 100-500

4. Which of the following relational operators is used to test for inequality?

A. *=
B. !=
C. less than-greater than signs (can't put them here; the text following them disappeared)
D. -=

5. The symbol * can be used in the SELECT CLAUSE of a SELECT statement in TSQL to return ...

A. ...all rows in a table.
B. ...all columns in a table.
C. ...only the rows indicated in the WHERE CLAUSE.
D. ...only the columns indicated in the FROM CLAUSE.

6. The statement below can be best described as what type of TSQL statement?

SELECT my_value INTO @ my_new_table from my_old_table

A. DDL
B. DML
C. DXL
D. DDL

7. Which of the following TSQL statements will restrict the returned result set to 100 rows?

A. LIMIT 100
B. RETURN 100
C. SET ROWCOUNT 100
D. SET LIMIT 100

8. Consider the following table:

MY_TABLE:
ID COLUMN1 COLUMN2
---- ------- -------
101 AAAA 1111
101 AAAA 1111
103 CCCC 2222
104 DDDD 1212

Which of the following statements will return a different result than the others?

A. SELECT * FROM MY_TABLE
B. select * from my_table
C. Select ID,COLUMN1,COLUMN2 from My_Table
D. SELECT Distinct * FROM My_Table

9. Which of the following is a correct implementation of the GROUP BY CLAUSE?

A. SELECT COUNT(*), AGE, OCCUPATION FROM MY_TABLE GROUP BY AGE
B. SELECT COUNT(*), AGE FROM MY_TABLE GROUP BY AGE
C. SELECT AGE, OCCUPATION FROM MY_TABLE GROUP BY COUNT(*)
D. SELECT AGE, FROM MY_TABLE GROUP BY OCCUPATION

10. The WHERE CLAUSE in a TSQL statement determines ...

A. ...what columns will be returned.
B. ...how the rows will be sorted.
C. ...what rows will be returned.
D. ...how the rows will be grouped together.