SQL Queries, Constarints
SQL Queries, Constarints
SQL-99: SchemaDefinition,
Constraints, and Queries and Views
EMPLOYEE.LNAME, DEPARTMENT.DNAME
Query 8: For each employee, retrieve the employee's name, and the
name of his or her immediate supervisor.
Q1C: SELECT *
FROM EMPLOYEE
WHERE DNO=5
Q1D: SELECT *
FROM EMPLOYEE, DEPARTMENT
WHERE DNAME='Research' AND
DNO=DNUMBER
E.FNAME=D.DEPENDENT_NAME
FNAME=DEPENDENT_NAME)
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 8- 39
THE EXISTS FUNCTION (contd.)
Query 6: Retrieve the names of employees who have no
dependents.