Question 1
Click the Exhibit button.
CREATE FUNCTION deptemployees (idept VARCHAR(3))
RETURNS TABLE (empno CHAR(6),
firstname VARCHAR(12),
lastname VARCHAR(15))
LANGUAGE SQL
READS SQL DATA
NO EXTERNAL ACTION
DETERMINISTIC
RETURN
SELECT empno, firstnme, lastname
FROM employee
WHERE workdept = deptemployees.idept;
Referring to the exhibit, what contains the proper way to invoke the DEPTEMPLOYEES() user-defined function to return all of the employees that work in department D11?
SELECT * FROM TABLE(deptemployees('D11'))
SELECT * FROM deptemployees('D11')
SELECT * FROM deptemployees('D11') AS D11dept
SELECT * FROM TABLE(deptemployees('D11')) AS D11dept
Correct answer: D