Microsoft Word - Homework 2.docx Database Design Homework Assignment 2 Due: Wednesday 09/29/ XXXXXXXXXX:59 pm) Type or neatly write the answers to these questions. If you type your answers, feel free...

1 answer below »
if you can write the answer using the computer that's nice.




Microsoft Word - Homework 2.docx Database Design Homework Assignment 2 Due: Wednesday 09/29/2021 (11:59 pm) Type or neatly write the answers to these questions. If you type your answers, feel free to type join, outer left join, semi right join, etc.., to replace the join symbols. Question 1: (18 points) Consider the following relational database schema: person (name, streetName, houseNumber, city, zipCode, phoneNumber) job (name, company, position, salary, manager-name) company (name, city, zipCode) Specify a relational algebra expression for each of the following queries: (a) Find the names of all people who work for Ethna. (b) Extract information in person of all people who work for Ethna. (c) Extract information in person of all people who work for Ethna and earn more than $30,000. (d) Find the names of all people who live in the same zipCode as the company they work for. (e) Find the names of all people who do not live in the same zipCode as the company they work for. (f) Find the names of all people who live in the same city, with the same zip code, and on the same street as their manager. (g) Find the names, salaries, and positions of all people who live in New Haven and work in New York. (h) Find the names of all people who live in New Haven and do not work in New York. (i) Find the names of all people who live in New Haven or work in New York. For each of the queries above, list the names of the relational algebra operations you used. Question 2: (5 points) For every join operation you use in Question 1, specify whether it is a theta join, an equijoin, or a natural join. Give the most specific classification; for example, do not classify a natural join as an equijoin. Also, if each of these operation is an outer join or semi join. Question 3 (5 points) Assume that the cardinalities of person, job, and company are c1, c2, and c3 respectively. What are the cardinality and degree of each of the relations resulting from the relational algebra operations you wrote in Question 1? Question 4 (12 points) Write MySQL commands for each of the queries in Question 1(a) to (f). Make sure that the MySQL commands you write generate a valid relation.
Answered 1 days AfterSep 26, 2021

Answer To: Microsoft Word - Homework 2.docx Database Design Homework Assignment 2 Due: Wednesday 09/29/...

Mani answered on Sep 27 2021
133 Votes
DBAssignment
Database Design
Assignment No. 2
Q1 :
We have following DB information given -
person (name, streetName, houseNumber, ci
ty, zipCode, phoneNumber)
job (name, company, position, salary, manager-name)
company (name, city, zipCode)
a. Names of all people who work for Ethna :
∏name (σ company = ‘Ethna’ (job))
b. Extract information in person of all people who work for Ethna:
∏p.name, streetName, houseNumber, city, zipCode, phoneNumber (σ company = ‘Ethna’ (job person
p))
c. Extract information in person of all people who work for Ethna and earn more than
$30,000:
∏p.name, streetName, houseNumber, city, zipCode, phoneNumber (σ company = ‘Ethna’ AND salary > 30000
(job person p))
d. Find the names of all people who live in the same zipCode as the company they work for:
∏ p.name (person p p.zipcode = zipcode (∏ j.name, c.zipCode (job j j.company = c.name
company c))
e. Find the names of all people who do not live in the same zipCode as the company they
work for:
∏ p2.name (σ p2.name != p.name ((person p p.zipcode = zipcode (∏ j.name, c.zipCode (job j
j.company = c.name company c)) person p2))
1
f. Find the names of all people who live in the same city, with the same zip code, and on the
same street as their manager:
∏ name (σ e.zipcode = m.zipcode AND e.streetName = m.streetName (σ ( job name = name
person ) e σ ( job name...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here