Intro Relational Database - Queries Consider the following relational database E
ID: 3732472 • Letter: I
Question
Intro Relational Database - Queries
Consider the following relational database Employee SSN Lastname Firstname Age Participation Emp Proj Project CodeTitle Cost Jack Jackie Niki Alberto Brabham 88 Stewart Lauda Ascari 78 68 36 Moon120 Mars 140 Jupyter 140 Venus 140 4 Formulate queries that find: 1. 2. 3. 4. In relational algebra: the lastname of employees working on the Mars project In SQL: the age of employees working on the Mars project In SQL: the projects with only one employee, showing the project code In relational algebra: the projects with only one employee, showing the codes of the projects and the lastnames of the employees.Explanation / Answer
1.
Lastname (Employee SSN = Emp Participation Proj = Code Project)
is for projection operation and is for join operation
2.
Select Age from Employee inner join Participation on Employee.SSN = Participation.Emp inner join Project on Participation.Proj = Project.Code where Project.Title = 'Mars';
3.
Select Proj from Participation inner join Employee on Participation.Emp = Employee.SSN group by Proj having count(SSN) = 1;
4
Code,Lastname ( count(SSN) = 1(Employee SSN = Emp Participation Proj = Code Project)
Do ask if any query. Please upvote if the answer is helpful.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.