Which of the following will retrieve the rows that have a missing value in the MIDINT
column?
ANS: D
ANS: C
3. Assuming that proper privileges exist which of the following will NOT allow access to
data stored in table TABLE1 using the name TAB1?
ANS: B
Whish of the following will cause EMPNO to be incremented automatically each time a row
is inserted into the EMPLOYEE table?
a. An index
b. A view was defined with the WITH CHECK OPTION clause specified
c. A stored procedure
d. A trigger
ANS: D
5. Assume table TAB1 contains 100 rows, which of the following queries return half of the
rows available?
a. SELECT * FROM tab1 FIND FIRST 50 ROWS
b. SELECT * FROM tab1 FETCH FIRST 50 ROWS ONLY
c. SELECT * FROM tab1 WHILE ROW_NUM < 50
d. SELECT * FROM tab1 MAXROWS 50
ANS: B
ANS: B
ANS: A
ANS: C
TAB1 TAB2
------------------------- ---------------------
COL_1 COL_2 COL_A COL_B
------------------------- ----------------------
A 10 A 21
B 12 C 23
C 14 D 25
ANS: D
MEDIUM
10. Which of the following can NOT be done using the ALTER TABLE statement?
a. Add a new column
b. Drop a check constraint
c. Change a column’s name
d. Change the length of the VARCHAR column
ANS: C
ANS: B
ANS: C
13. USERA needs to be able to read and modify existing rows in TABLE1. Which of the
following statements will give USERA only the privileges needed?
ANS: C
15. Which of the following is not a valid reason for defining a view on a table
a. Restrict users access to a subset of table data
b. Ensure that rows entered remain within the scope of a definition
c. Produce an action as a result of a change to a table
d. Provide users with an alternate view of a table data
ANS: C
TAB1
-------------------------
COL_1 COL_2
-------- --------
A 10
B 20
C 30
D 40
E 50
DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM tab1 ORDER BY col_1
OPEN c1
FETCH c1
FETCH c1
FETCH c1
COMMIT
FETCH c1
CLOSE c1
FETCH c1
a. 20
b. 30
c. 40
d. 50
ANS: C
17.
NAME POINTS
------------------------- ---------------------
NAME NUMBER NAME POINTS
------------------------- ----------------------
BILL 10 BILL 234
TOM 12 HARRY 56
HARRY 14 BRET 61
JOHN 177 BARRY 76
BARRY 22 COLE 20
How many rows would be returned if the following SELECT statement were executed?
a. 0
b. 5
c. 10
d. 25
ANS: D
SALES
-------------------------
INVOICE_NO CHAR(20) NOT NULL
SALES_DATE DATE
SALES_PERSON CHAR(20)
REGION CHAR(20)
SALES INTEGER
If the following SELECT statement is executed which describes the order of rows in the
result data set
ANS:D
TAB1
-------------------------
COL_1 COL_2
-------- --------
A 10
B 20
C 30
A 10
D 40
C 30
Which of the following statements will return only one record for each set of repeated
rows found in the final result data set produced?
YEAR_2002 YEAR_1962
------------------------- ---------------------
EMPID NAME EMPID NAME
------------------------- ----------------------
1 MICK 1 MICK
2 KEITH 2 KEITH
3 WOODS 3 JONES
4 WATTS 4 BILL
5 DARRYL 5 TONY
6 CHUCK 6 IAN
If the following SQL statement is executed, how many rows will be returned
a. 0
b. 6
c. 10
d. 12
ANS:C