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

  A text file students.txt contains student records

A text file students.txt contains student records (name, date of birth, and GPA). Write a program that reads student records from students.txt and creates an array of student structures

  Base process which communicate with child processes

Write a program which has a "base process" which communicates with child processes acting as "bombers" that it creates.

  Write a program that will read in 5 numbers

Write a program that will read in 5 numbers and add 10 to the first number, 20 to the second number, and 30 to the third number, 40 to the fourth and 50 to the 50th.

  Write a function that takes an integer array

1. Write a function that takes an integer array and the array's size as parameters. The function will check if the array is sorted. If it is, it will return a 1. If it is not sorted it will return 0. The function should not  sort the array.

  Function called timesten that returns back

Write a function called timesTen that returns back to the caller the value passed into the function multiplied by 10. If the value passed into the function is negative, the function also returns the string

  Develop a class airborne location

develop a class AirborneLocation that represents the location of airplanes with respect to a reference radar location. Each AirborneLocation object should include data member for aircraftID (integer),

  Computer programming using c language lab

Computer programming using c language lab

  Design your application according to the considerations

Design your application according to the considerations described above.  For example, you must use functions that have the specified signatures, and arrays that have the specified declarations. They are

  Object oriented programming paradigm is better choice

Explain why object oriented programming paradigm is considered better choice than structured programming paradigm. Does it reflect our "natural" way of thinking or do you find it artificial?

  Consider implementing subnetting to support three department

Consider implementing subnetting to support three departments within an organization. The three departments P, Q and R need support for 30, 40 and 60 hosts.

  Use the top-down modular approach to design program

Use the top-down modular approach and pseudocode to design a suitable program to solve it. Where appropriate, use defensive programming techniques.

  Declare a vector

Declare a vector of these structures where the size of the vector is to be 7.

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