Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A phone company has set up the following database in order to be able to send detailed bills to its customers: CUSTOMER(Phone#,FirstName, LastName, City), CALL(CallerPhone#,

A phone company has set up the following database in order to be able to send detailed bills to its customers:

CUSTOMER(Phone#,FirstName, LastName, City),

CALL(CallerPhone#, CalledPhone#, Date, Time, Duration, Cost),

The keys of the relations are underlined

Express queries in SQL.

  1. Print a detailed call log (CalledPhone#, Date, Time, Duration, cost) for John Stewart for the month of August 2021
  2. Print a detailed call log (CalledPhone#, Date, Time, Duration, cost) for all the customers for the month of August 2021
  3. Print the phone numbers John Stewart called between September 1st and September 15th, 2021
  4. Print the name of the customers who called at least one number John Stewart called between September 1st and September 15th, 2021
  5. Print the name of the customers living in the same city as John Stewart that John Smith has never called
  6. Print the names of the customers who made at least one phone call on September 1st, 2021
  7. Print the names of the customers who did not make any phone call since September 1st, 2021
  8. On which days, all the customers made at least one call?
  9. If we assume that customers call only people in their contact lists, print pairs of customers who have at least 1 common contact
  10. List for every customer, the number of calls per day since September 1st, 2021.
  11. If we assume that customers call only people in their contact lists, who has the largest contact list?

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_2

Step: 3

blur-text-image_step3

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

Students also viewed these Databases questions

Question

2. Explain how the role of training is changing.

Answered: 1 week ago

Question

7. General Mills

Answered: 1 week ago