Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

Q.1. Taxonomic classification of peafowl, Tiger and cow ?

Answered: 1 week ago

Question

Q .1. Different ways of testing the present adulterants ?

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago