Write Relational Algebra queries

Assignment Help C/C++ Programming
Reference no: EM13189345

Consider the following schema of an online flight reservation agency.

Customer(cid, lastName, firstName, dob)

Flight(fid, airline, fromCity, toCity, stops, onTime)

Reservation(cid, fid, date)

Attribute dob is the customer's date of birth, stops is the number of stops (0-??) a flight requires, and onTime is a percentage (0-100) indicating how often a flight is on time. Keys are underlined.

The set {lastName, firstName, dob} is also a key for Customer. However, the set {airline, fromCity, toCity, stops, onTime} is not a key for Flight since an airline may provide, say, di_erent flights with two stops from Bu_alo to Orlando, one stopping in Atlanta and one in New York, both of which are always on time. Attributes cid and fid in Reservation are foreign keys referencing homonymous attributes in Customer and Flight, respectively. Write Relational Algebra queries only that find (each 6 marks, except last two which weight 8 marks - total 52 marks):

1. cid's of customers who reserved some flight to Boston and some flight to New York.

2. cid's of customers who reserved some flight to Miami or some flight to Houston, but not both.

3. cid's of customers who never reserved AirTran flights or flights to Houston.

4. cid's of customers who reserved every flight that is on time at least 85% of the time.

5. cid's of customers who reserved every flight that the customer with cid=5 reserved.

6. cid's of customers who reserved at least three distinct JetBlue flights to Miami.

7. Pairs of cid's of distinct customers who reserved the same flight and the first in the pair reserved before the second.

8. Pairs of cid's of distinct customers who reserved all the same flights. If (c1, c2) is returned, do not return (c2, c1).

152_Write Relational Algebra queries.png

Reference no: EM13189345

Questions Cloud

Design the guide to the history of visual communication : Your next step as an intern helping to design the guide to the history of visual communication is to gather at least six pieces of art or design for the chapter on art forms throughout the ages. The pieces you pick should be pieces of art or design t..
Will fields with both oil and gas have greater difficulties : Some fields have large enough quantities of both oil and natural gas that coordination must be achieved for the production of both, rather than oil a in our examples. Will fields with both oil and gas have greater difficulties in unitization than ..
Describe effects of one chemical-biological and radiological : Describe the effects of one chemical, biological, and radiological agent; include the proper decontamination and treatment methods for each. Explain one dispersal device/delivery method for each selected chemical, biological, and radiological agent.
Inventory items stored in Sudbury : Give the details of all suppliers in the Sault Ste Marie, list all inventory items with a quantity less than 100 units and list all the inventory items stored in Sudbury
Write Relational Algebra queries : Attributes cid and fid in Reservation are foreign keys referencing homonymous attributes in Customer and Flight, respectively. Write Relational Algebra queries
Design an algorithm to find the selling price : To make a profit, the prices of the items sold in a furniture store are marked up by 60%. Design an algorithm to find the selling price of an item sold at the furniture store. What information do you need to find the selling price?
What is the direct labor rate variance? : The following data relate to direct labor costs for the current period:
What range of payments will the beekeeper accept : Assuming that the beekeeper gets that amount, what range of payments will the farmer accept (Remember that negative payments are also possible.) Answer the same questions for the fifth day.
Write the symbolic logic for the 3des decryption : How would you protect the passwords on your system using some of the mechanisms we have studied? Discuss implementation strategies and explain your decisions.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd