Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part -B- Movie ( movieId, movieName, categoryId, duration, productionDate) Theater( theaterId,theaterName, city, ticketPrice) Category (categoryId, categoryName) ShownAt(theaterId, movieId, startDate, endDate) a) Find the name of
Part -B-
Movie ( movieId, movieName, categoryId, duration, productionDate) Theater( theaterId,theaterName, city, ticketPrice) Category (categoryId, categoryName) ShownAt(theaterId, movieId, startDate, endDate)
- a) Find the name of all theaters that have shown a movie called Harry Potter.
- b) Find the name of the shortest movie. (i.e. Find the name of the movie with the minimum duration)
- c) For each category, find the number of movies that have a duration greater than the average duration of all movies. List the categoryId and the number you calculated.
- d) Find the name of the oldest (the movie with the smallest ProductionDate) and the latest (the movie with the largest ProductionDate) movie in the database.
- e) Find the number of the movies that have been shown at the theater with the cheapest ticketPrice.
- f) List movieName and categoryName for all movies produced in 2002. (Please remember that the ProductionDate is a date.)
- g) List MovieName of all movies that were shown for longer than 30 days.
- h) Find the number of different categories in the movie table.
- i) What is the sql*plus command that is used to show the structure of the theater table.
- j) Assume that Movie, Theater and Category tables are already created. Please create the
Shown At table.
-
- TheaterId must be number with 4 digits Foreign Key referencing the Theater Table,
- MovieId must be number 6 digits Foreign Key referencing the Theater Table,
- StartDate and EndDate must be date data type.
- Dont forget to declare the Primary Key.
- k) Insert a new tuple into the Movie table with the following values:
- MovieId: 101
- MovieName: Honey, CategoryId: 12,
- Duration: 100, ProductionDate: 02-JUN-2003
- l) Change the name of the category 302 with Drama.
- m) Delete rows of the Theater table that has the minimum ticketPrice.
- n) Delete all rows that have longest duration in the Movie table.
- o) Increase the ticketprice %10 of the Theater that is showing the movie called Lord of the Rings
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started