Question: Hello, I need help for CS (RELATIONAL DATABASE SYSTEMS) class homework. It must be done in SQL Language 1. Write the following queries in relational

Hello, I need help for CS (RELATIONAL DATABASE SYSTEMS) class homework. It must be done in SQL Language

1. Write the following queries in relational algebra, using the schema blow, where the primary keys are underlined.

Sailors(sid, sname, rating, age)

Reserves(sid, bid, day)

Boats(bid, bname, color)

a. Find names of sailors who have reserved boat 103 (i.e., bid = 103).

b. Find names of sailors who have reserved a red boat.

c. Find names of sailors who have reserved a red or a green boat.

d. Find names of sailors who have reserved a red and a green boat.

2. Write the following queries in relational algebra, using the university schema I gave you in class.

a. Find the names of all students who have taken at least one Comp. Sci. course.

b. Find the IDs and names of all students who have not taken any course offered before 2009.

3. Write the following queries in relational algebra, using the schema below, where the primary keys are underlined.

employee (pname, street, city)

works (pname, cname, salary)

company (cname, city)

manages (pname, manager_name)

a. Find the names, street addresses, and cities of residence of all employees who work for First Bank Corporation and earn more than $10,000.

b. Find the names of all employees in this database who live in the same city as the company for which they work.

Thank you.

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!