Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1. (80 points) Consider the relational database defined below: create table professor ( professor_ID varchar ( 1 0 ) , professor_name varchar ( 3

Problem 1. (80 points) Consider the relational database defined below: create table professor ( professor_ID varchar ( 1 0 ) , professor_name varchar ( 3 0 ) , ZIP_code char ( 5 ) , salary numeric (10 , 2 ) , primary key ( professor_ID ) ) ;

create table student ( student_ID varchar ( 1 0 ) , student_name varchar ( 3 0 ) , ZIP_code char ( 5 ) , primary key ( student_ID ) ) ;

create table advisement ( professor_ID varchar ( 1 0 ) , student_ID varchar ( 1 0 ) , start_date date , primary key ( professor_ID , student_ID ) , foreign key ( professor_ID ) references professor , foreign key ( student_ID ) references student ) ;

Express in SQL each of the following queries: (e) (10 points) Find the IDs of the professors not advising any student (use a left outer join and is null).

(f) (10 points) Find the ID of each student advised by SOME of the professors who advise student S001 (i.e., student whose ID is S001).

(g) (10 points) Find the ID of each student advised by ALL of the professors who advise student S001 (i.e., student whose ID is S001).

(h) (10 points) Find the ID(s) of the professor(s) that advise the largest number of students.

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

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

6. What is process reengineering? Why is it relevant to training?

Answered: 1 week ago