Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

7. (2 points) Write a query in relational algebra that returns the times of scre

ID: 3735921 • Letter: 7

Question

7. (2 points) Write a query in relational algebra that returns the times of screenings together with the movie for which no tickets have been sold.

Domain Consider a cinema database that stores ticket sales. Each Screening of a movie is stored in a relation with an id, the name of the movie, the time of the screening, and which screen it is shown on. An employee is stored with an id, the name, the address where the employee lives and the phone number. A ticket is stored with an id, the id of the employee that sold the ticket, the id of the screening, the timestamp when it was sold, the price of the ticket and the discount type (if there was a discount). The database schema then is SCREENING = {sld, movie, time, screen] EMPLOYEE eld, nm, address,phone) . TICKET = {tld. eld, sld, timestamp, price, discount) This results in a database given by the following relations Ticket tld eld sld timestamp price discount 1 1 1 2018-03-23 3:14p 10S none 2 3 4 2018-03-23 3:16pm 8 student 3 3 2 2018-03-23 3:16pm 8 student 4 1 4 2018-03-23 5:48pm 10S none 513 2018-03-23 5:48pm 5$ lecturer Employe«e eld name address phone 1 Tyler Durden 537 Paper Street(288) 555-0153 2 Diane Selwyn 1612 Havenhurst Dr. (255) 555-7614 3 Tyler Durden 1612 Havenhurst Dr. (255) 555-7614 Screening sld movie time screen 1 Nosferatu 2 Head On 2018-03-23 7pm Screen 1 2018-03-23 7pm Screen 2 3 Bloody Pit of Horror 2018-03-23 9pm Screen 1 2018-03-23 9pm Screen 2 The Following

Explanation / Answer

First Create The screening Table use the following query To create this table

CREATE TABLE Screening
(
sID int,
movie varchar(255),
time varchar(255),
screen varchar(255)
);

2.Now create the Employee table

CREATE TABLE Employee
(
eid int,
name varchar(255),
address varchar(255),
phone varchar(255)
);

  

And The Last One Is

CREATE TABLE Ticket
(
tId int,
eId int,
sId int,

time timestamp,
price varchar(255),
discount varchar(255)
);

Hope You get your Answer Thank You.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote