Question 7 sk Return the id and name of all customers who have previewed at least all the movies previewed by customers who were born on the "2000-10-10". Customers born on "2000-10-10" should not be included in the final list. This query should return a table with two columns, the first being user ids and the second being users names. Hint: Correlated Subquery c7.txt or c7.sql planation Maximum Number of Queries e Name L Solution 1

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please solve Question 7 using the SQL command 'NOT EXISTS'. Original answer only please.

Other relative info includes the data tables below:

TABLE `Streams` (
  `customer` int NOT NULL,
  `moviePrefix` char(4) NOT NULL,
  `movieSuffix` char(4) NOT NULL,
  `timestamp` timestamp NOT NULL,
  `duration` int NOT NULL

TABLE `Previews` (
  `customer` int NOT NULL,
  `moviePrefix` char(4) NOT NULL,
  `movieSuffix` char(4) NOT NULL,
  `timestamp` timestamp NOT NULL

TABLE `Movie` (
  `prefix` char(4) NOT NULL,
  `suffix` char(4) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `rating` enum('G','PG','M','MA15+','R18+') NOT NULL,
  `releaseDate` date DEFAULT NULL

TABLE `Customer` (
  `id` int NOT NULL,
  `name` varchar(255) NOT NULL,
  `dob` date NOT NULL,
  `bestFriend` int DEFAULT NULL,
  `subscriptionLevel` varchar(25) NOT NULL

A relational database has been setup to track customer browsing activity for an online movie streaming service called
SurfTheStream. Movies are identified by a unique code that consists of a four-character prefix and four-digit suffix.
Additionally, each movie is assigned a content rating which must be one of the following options: "G", "PG", "M", "MA15+"
or "R18+". The first time a customer previews a movie is captured by the database. Customers may preview a movie
before they stream it, however, they cannot preview a movie after they have started to stream it. You may assume
"Duration" refers to the time in seconds a customer has spent streaming a particular movie after the "Timestamp".
A simplified version of their database schema has been provided below including foreign key constraints. You should
consult the provided blank database import file for further constraints which may be acting within the system.
Relational Schema
Customer (id, name, dob, bestFriend, subscriptionLevel]
Customer.bestFriend references Customer.id
Customer.subscriptionLevel references Subscription.level
Movie (prefix, suffix, name, description, rating, releaseDate]
Previews (customer, moviePrefix, movieSuffix, timestamp]
Previews.customer references Customer.id
Previews.(moviePrefix, movieSuffix} reference Movie.(prefix, suffix}
Streams (customer, moviePrefix, movieSuffix, timestamp, duration]
Streams.customer reference Customer.id
Streams.{moviePrefix, movieSuffix} reference Movie.{prefix, suffix}
Subscription [level]
Transcribed Image Text:A relational database has been setup to track customer browsing activity for an online movie streaming service called SurfTheStream. Movies are identified by a unique code that consists of a four-character prefix and four-digit suffix. Additionally, each movie is assigned a content rating which must be one of the following options: "G", "PG", "M", "MA15+" or "R18+". The first time a customer previews a movie is captured by the database. Customers may preview a movie before they stream it, however, they cannot preview a movie after they have started to stream it. You may assume "Duration" refers to the time in seconds a customer has spent streaming a particular movie after the "Timestamp". A simplified version of their database schema has been provided below including foreign key constraints. You should consult the provided blank database import file for further constraints which may be acting within the system. Relational Schema Customer (id, name, dob, bestFriend, subscriptionLevel] Customer.bestFriend references Customer.id Customer.subscriptionLevel references Subscription.level Movie (prefix, suffix, name, description, rating, releaseDate] Previews (customer, moviePrefix, movieSuffix, timestamp] Previews.customer references Customer.id Previews.(moviePrefix, movieSuffix} reference Movie.(prefix, suffix} Streams (customer, moviePrefix, movieSuffix, timestamp, duration] Streams.customer reference Customer.id Streams.{moviePrefix, movieSuffix} reference Movie.{prefix, suffix} Subscription [level]
Question 7
Task
Return the id and name of all customers who have previewed at least all the
movies previewed by customers who were born on the "“2000-10-10". Customers
born on "2000-10-10" should not be included in the final list.
Explanation
This query should return a table with two columns, the first being user ids and the
second being users names. Hint: Correlated Subquery
c7.txt or c7.sql
File Name
SQL Solution
Maximum Number of Queries
1
Transcribed Image Text:Question 7 Task Return the id and name of all customers who have previewed at least all the movies previewed by customers who were born on the "“2000-10-10". Customers born on "2000-10-10" should not be included in the final list. Explanation This query should return a table with two columns, the first being user ids and the second being users names. Hint: Correlated Subquery c7.txt or c7.sql File Name SQL Solution Maximum Number of Queries 1
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY