1.
Which set of SQL statements must be run prior to the EXECUTE statement shown below so that the INSERT statement can be executed successfully?
EXECUTE s1 USING :v1;
2.
Which type of join condition specifies that the result table will contain a row for each row from the Table to the left, concatenated with each row from the table to the right?
3.
Given the two tables shown below:
TAB1
LETTER GRADE
A 80
B 70
C 60
TAB2
LETTER GPA
A 4
C 2
D 1
and the successful execution of the following query:
SELECT * FROM tab1 FULL OUTER JOIN tab2 ON tab1.letter = tab2.letter;
How many rows will be returned?
4.
Given the two tables shown below:
COUNTRIES
COUNTRY CONTINENT_ID
Greece 1
Germany 1
Canada 2
CONTINENTS
ID CONTINENT
1 Europe
2 North America
3 Asia
A user wants the following result:
COUNTRY CONTINENT
Greece Europe
Which query should the user submit to achieve the result?
5.
Table T1 and view V1 were created by executing the statements shown below:
CREATE TABLE t1 (c1 INT CHECK (c1 < 275), c2 CHAR(3));
CREATE VIEW v1 AS SELECT c1, c2 FROM t1 WHERE c1 > 250
WITH LOCAL CHECK OPTION;



Which statement will execute successfully?
6.
Table T1 and views V1 and V2 were created by executing the statements shown below:
CREATE TABLE t1 (c1 INT, c2 CHAR(3));
CREATE VIEW v1 AS SELECT c1, c2 FROM t1 WHERE c1 > 100;
CREATE VIEW v2 AS SELECT * FROM v1 WHERE c2 IS NULL WITH
CASCADED CHECK OPTION;
Which statement will execute successfully?
7.
A table named INVENTORY was created by executing the SQL statement shown below: CREATE TABLE inventory (part_no INTEGER, quantity INTEGER, price DECIMAL(7,2), status CHAR(2)); If items are indicated to be out of stock by setting STATUS to NULL and QUANTITY to zero, which SQL statement updates the INVENTORY table to indicate that all items with part numbers below 150 are out of stock?
8.
Given the SQL statement shown below:
UPDATE address SET number_street =
(SELECT address FROM employee
WHERE address.empid = employee.empid)
WHERE number_street IS NULL
Which comment is true?
9.
.Which combination of statements can be used to delete qualifying rows from a table named EMP?
10.
An application uses the statement shown below to give employees in department "E11" a bonus equal to 10 of their salary:
UPDATE emp
SET bonus = (SELECT .10 * salary FROM emp y WHERE empno = y.empno)
WHERE CURRENT OF c1;
Which statement should be used to define cursor C1?