Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1. (80 points) Consider the relational database defined below: create table passenger ( passenger_ID varchar (10), passenger_name varchar (30), passenger_city varchar (30), primary key
Problem 1. (80 points) Consider the relational database defined below: create table passenger ( passenger_ID varchar (10), passenger_name varchar (30), passenger_city varchar (30), primary key (passenger_ID)); create table seat ( train_number varchar (10), seat_number varchar (10), primary key (train_number, seat_number)); create table reservation ( reservation_number varchar(10), passenger_ID varchar (10), train_number varchar (10), seat_number varchar (10), departure_station varchar(10), departure_time timestamp, arrival station varchar(10), arrival time timestamp , fare numeric(8, 2), primary key (reservation_number), foreign key (passenger_ID) references passenger, foreign key (train_number, seat_number) references seat); Problem 2. (20 points) Consider the relational database defined in Problem 1. Express in rela- tional algebra each of the following queries: (a) (10 points) Show the train number of each train that has more than 1000 seats. (b) (10 points) Find the train(s) with the largest number of seats (i.e., trains with more seats or the same number of seats compared to every other train). For each of these trains, show the train number
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