Question

Consider the database consisting of the following relations: Flights(Fl#: integer, From: string, To: string, Distance: integer,...

Consider the database consisting of the following relations:

Flights(Fl#: integer, From: string, To: string, Distance: integer, departs: Time, Arrives: time)

Flight Instance(Fl#: integer, Day: date, Aid: Integer)

Aircraft(Aid: integer, Make: string, Model: string, CrusingRange: string)

Certified(Eid: integer, Make: string, Model: string) Employee(Eid: integer, Ename: string, Salary: integer)

Fight Attendant(Fl#: integer, Day: date, Eid:integer, Role: string)

The Flight table contains general information about the flights whereas the Flight Instance is about a flight number on a specific date. Aircraft list the aircrafts in the company, the make is the company that made the aircraft (e.g. Boing, Airbus) and the model is for example 747 for Boing or 321 for Airbus. The table Certified tells which employees can y which airplanes, the tables Fight Attendant assigns employees to specific flights with a role (e.g. captain). Finally, the table Employee lists the employees of the airline company. Express the following queries in Algebra and SQL:

List the crew members of the flight 123 on May 5, 2006

List the flight attendants who ew to Chicago at list once since January 1st 2006.

Find the employees who ew only to Chicago.

List the employees who have been to all the cities

List pairs of employees who worked together on at least one flight.

Which employee has own the largest number of flights (SQL only)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.select e.Eid,e.ename from employee e join flight attendant f on e.Eid=f.eid join on flightinstance i on f.fi=i.fi where fi=123 and date='25-05-2006'

2.select e.eid,e.ename frome employee e join flightattendant f on e.eid=f.eid join flights l on f.fi=l.fi join flight instance i on f.fl=i.fl where l.from='EW' and l.to='chicago' and i.date='01-01-2006';

3. select e.eid,e.ename frome employee e join flightattendant f on e.eid=f.eid join flights l on f.fi=l.fi join flight instance i on f.fl=i.fl where l.to='chicago';

4.select e.eid,e.employees from employees e join flightattendants f on e.eid=f.eid join flights i on i.fi=f.fi where i.fi=f.fi;

Note: for any quires please comment and we cant understand the question properly, we are supposed to answer only 3 questions

Add a comment
Know the answer?
Add Answer to:
Consider the database consisting of the following relations: Flights(Fl#: integer, From: string, To: string, Distance: integer,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider the following relations for an airline company: Flights (flno: integer, from: string, to: string, distance:...

    Consider the following relations for an airline company: Flights (flno: integer, from: string, to: string, distance: integer, departs: time, arrives: time) Aircraft (aid: integer, aname: string, cruising_range: integer) Certifed (pid: integer, aid: integer) Pilots (pid: integer, pname: string, salary: integer) (word in bold are primary keys) Note that every pilot is certified for some aircraft. Write the following queries in relational algebra: 1- Find the flight numbers of flights departing from ‘Amsterdam’ or ‘London’ between 8:00am and 11:00am, and arriving...

  • Problem 1 Consider the following relations containing airline flight information, where the keys are underlined ghts(no:...

    Problem 1 Consider the following relations containing airline flight information, where the keys are underlined ghts(no: integer, from: string, to: string, distance: integer, departs: time, arrives: time) aircraftlaid: integer, aname: string, crusingrange: integer) certified(eid: integer,aid: integer) employees(eid: integer, ename: string, salary: integer) Note that the employees relation describes pilots and other kinds of employees as well; every pilot is certified for some aircraft (otherwise, he or she would not qualify as a pilot), and only pilots are certified to fly....

  • The following relations keep track of airline flight information: Flight (flno: int, from: varchar(20), to: varchar(20),...

    The following relations keep track of airline flight information: Flight (flno: int, from: varchar(20), to: varchar(20), distance: real, departs: time, arrives: time, price: real) Aircraft (aid: int, aname: varchar(20), cruisingrange: real) Certified (eid: int, aid: int) Employee (eid: int, ename: varchar(20), salary: real) Note that the Employee relation describes pilots and other kinds of employees as well; every pilot is certified for some aircraft, and only pilots are certified to fly. Write each of the following queries in SQL. 1....

  • Any help appreciated! Question 1 (5 points). Answer each of the following questions briefly. The questions...

    Any help appreciated! Question 1 (5 points). Answer each of the following questions briefly. The questions are based on the following relational schema: Emp( eid: integer, ename: string, age: integer, sala1l1: real) Works( eid: integer, did: integer, pet_time: integer) Dept(did: integer, dname: string, budget: real, managerid: integer) 1. Give an example of a foreign key constraint that involves the Dept relation. 2. Write the SQL statements required to create the preceding relations, including appropriate versions of all primary and foreign...

  • Consider the following relational schemas: Employee (eid: integer, ename: string, Job_title: string, Years_of_experience: integer) Project (pid:...

    Consider the following relational schemas: Employee (eid: integer, ename: string, Job_title: string, Years_of_experience: integer) Project (pid: integer, pname: string, parea: string, mid: integer, budget: integer) Works_on (eid: integer, pid: integer) Manger (mid: integer, mname: string, deptid: integer) The meaning of these relations is straightforward; for example, Works_on has one record per Employee-Project pair such that the Employee Works_on the Project. 1. Write the SQL statements required to create these relations, including appropriate versions of all primary and foreign key integrity...

  • Suppose a database has the following three relations. Movie (mid: integer, title: string, director: string, releaseDate:...

    Suppose a database has the following three relations. Movie (mid: integer, title: string, director: string, releaseDate: date) PlaysAt (theaterID: integer, movieId: integer, showDate: date) Theater (tID: integer, name: string, phone: string, screencount: integer) "movieID" in PlaysAt is a foreign key referencing "mid" in Movie. "theaterID" in PLaysAt is a foreign key referencing "tID" in Theater. Write the following queries in both relational algebra and SQL. Find the titles of movies playing on 2 / 26 / 2019 and the IDs...

  • What happened on United flight 3411?What service expectations do customers have of airlines such ...

    What happened on United flight 3411?What service expectations do customers have of airlines such as United and How did these expectations develop over time? Thank You! In early April 2017, United Airlines (United), one of the largest airlines in the world, found itself yet again in the middle of a service disaster this time for forcibly dragging a passenger off an overbooked flight. The incident was to become a wake-up call for United, forcing it to ask itself what to...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT