Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago

Question

What is quality of work life ?

Answered: 1 week ago