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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started