Question: Provide resulting relation (table with tuples) for each query. Using these tables. The table in a. is already completed as an example a. Retrieve first

 Provide resulting relation (table with tuples) for each query. Using these

tables. The table in a. is already completed as an example a.

Provide resulting relation (table with tuples) for each query. Using these tables. The table in a. is already completed as an example

a. Retrieve first name, last name, and date of birth of all female employees with salary less than 43000.

SQL query ->

SELECT Fname, Lname, Bdate FROM EMPLOYEE WHERE Sex = 'F' AND Salary

Relational Algebra ->

Fname, Lname, Bdate ( Sex = 'F' AND Salary

Retrieve first name, last name, and date of birth of all female

b. Retrieve project names and project locations of all projects that belong to the Research department.

SQL query ->

SELECT p.Pname, p.Plocation FROM PROJECT AS p JOIN DEPARTMENT AS d ON p.Dnum = d.Dnum WHERE d.Dname = "Research"

Relational Algebra ->

p . Pname, p .Plocation d . Dname = "Research" ( p PROJECT p . Dnum = d . Dnum d DEPARTMENT)

c. Retrieve first name, last name, and salary of all employees who work less than 22 hours on project 2.

SQL query ->

SELECT e.Fname, e.Lname, e.Salary FROM EMPLOYEE AS e JOIN WORKS_ON AS w ON e.Ssn = w.Essn WHERE w.Hours

Relational Algebra ->

e.Fname, e.Lname, e.Salary ( (w.Hours (w.Essn=e.Ssn) WORKS_ON w ))

d. Retrieve name, date of birth, and relationship of all male dependents of employees who work for department 5.

SQL query ->

SELECT d.Dependent_name, d.Bdate, d.Relationship FROM DEPENDENT AS d JOIN EMPLOYEE AS e ON d.Essn = e.Ssn WHERE d.Sex = 'M' AND e.Dno = 5

Relational Algebra ->

d.Dependent_name, d.Bdate, d.Relationship ( (d.Sex = 'M' and e.Dno = 5) (DEPENDENT d (d.Essn=e.Ssn)EMPLOYEE e))

e. Retrieve first name, last name, and date of birth of employees who manage departments with projects located in Stafford.

SQL query ->

SELECT e.Fname, e.Lname, e.Bdate FROM EMPLOYEE AS e JOIN PROJECT AS p ON e.Dno = p.Dnum WHERE p.Plocation = "Stafford"

Relational Algebra ->

e . Fname, e . Lname, e . Bdate p . Plocation = "Stafford" ( e EMPLOYEE e . Dno = p . Dnum p PROJECT)

FMDA CVEE DEPARTMENT DEPT_LOCATIONS WORKS ON PROJECT DEPENDENT EMPLOYEE \begin{tabular}{|l|l|l|l|l|l|l|l|l|c|} \hline Fname & Minit & Lname & Ssn & Bdate & Address & Sex & Salary & Super_ssn & Dno \\ \hline \end{tabular} DEPARTMENT \begin{tabular}{|c|c|c|c|} \hline Dname & Dnumber & Mgr_ssn & Mgr_start_date \\ \hline \multicolumn{3}{|c|}{} \\ \hline \end{tabular} DEPT_LOCATIONS \begin{tabular}{|l|l|} \hline Dnumber & Dlocation \\ \hline \end{tabular} PROJECT \begin{tabular}{|c|c|c|c|} \hline Pname & Pnumber & Plocation & Dnum \\ \hline \end{tabular} WORKS_ON \begin{tabular}{|l|l|l|} \hline Essn & Pno & Hours \\ \hline \end{tabular} DEPENDENT \begin{tabular}{|l|l|l|l|l|} \hline Essn & Dependent_name & Sex & Bdate & Relationship \\ \hline \end{tabular} \begin{tabular}{|l|l|l|l|l|} \hline Fname & Lname & DO3 & SEX & Salary \\ \hline Alicia & Kays & 10/24/2000 & F & 42000 \\ \hline Brandy & Simmons & 11/5/1994 & F & 40000 \\ \hline Missy & Elliot & 96/1995 & F & 38000 \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!