select fname, lname from employee |
select fname, lname from employee where dno = 4 |
Name and address of all employees: SELECT fname, lname, address, dno FROM employee |
|
You can see some resemblance between SQL and Relational Algebra....
Previously: info on employees in the Research department SELECT fname, lname FROM employee, department WHERE dno = dnumber AND dname = 'Research' |
Find project 'ProductX': SELECT pnumber, pname FROM project WHERE pname = 'ProductX' |
Previously: find ssn of employees working on ProductX: SELECT essn FROM works_on, project WHERE pname = 'ProductX' AND pno = pnumber |
Projects in 'Stafford': SELECT pnumber, pname, plocation FROM project WHERE plocation = 'Stafford' |