question no 1 Given the following db schema: Movies(mid:integer, title:string, director:string, studio:string, releaseyear:integer) Customers(cid:integer,name:string, city: string, state:string,
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Given the following db schema: Movies(mid:integer, title:string, director:string, studio:string, releaseyear:integer) Customers(cid:integer,name:string, city: string, state:string, age:real) Watch(cid:integer,mid:integer, watchedon:date) Primary keys are underlined in each relation. A movie is identified by an id (mid). It also has a title, director, studio and releaseyear.A customer is identified by cid. It also has a name, a city, state and age.Customers watch movies. When a customer watches a movie a record is inserted into Watch table, that will contain information about the ids as well as the date on which cid watched mid (attr. watchedon). Notes: • For both CS430 and CS630 students, each problem (a through g) carries 4 points possible. For this schema: a) Write the SQL statement to create the table Movies. Do not forget about the key constraints. b) Write the SQL statement to create table Customers. Add the constraint that a customer must be at least 18 years old. Do not forget about the key constraints. c) Write the SQL to create table Watch. Do not forget about the key constraints. d) Write the SQL statement to create an index on column watchedon of table Watch. Name that index indexWatchDate. Given the following db schema: Movies(mid:integer, title:string, director:string, studio:string, releaseyear:integer) Customers(cid:integer,name:string, city: string, state:string, age:real) Watch(cid:integer,mid:integer, watchedon:date) Primary keys are underlined in each relation. A movie is identified by an id (mid). It also has a title, director, studio and releaseyear.A customer is identified by cid. It also has a name, a city, state and age.Customers watch movies. When a customer watches a movie a record is inserted into Watch table, that will contain information about the ids as well as the date on which cid watched mid (attr. watchedon). Notes: • For both CS430 and CS630 students, each problem (a through g) carries 4 points possible. For this schema: a) Write the SQL statement to create the table Movies. Do not forget about the key constraints. b) Write the SQL statement to create table Customers. Add the constraint that a customer must be at least 18 years old. Do not forget about the key constraints. c) Write the SQL to create table Watch. Do not forget about the key constraints. d) Write the SQL statement to create an index on column watchedon of table Watch. Name that index indexWatchDate.
Expert Answer:
Answer rating: 100% (QA)
Movies table CREATE TABLE Movies mid INTEGER PRIMARY KEY AUTOINCREMENT title VARCHAR120 NOT NULL director VARCHAR120 NOT NULL studio VARCHAR120 NOT NU... View the full answer
Related Book For
Fundamentals Of Database Systems
ISBN: 9780133970777
7th Edition
Authors: Ramez Elmasri, Shamkant Navathe
Posted Date:
Students also viewed these programming questions
-
Read about Stage Three of critical thinking: The Beginning Thinker, at The Progressive Levels in Thinking Development. How have you demonstrated persistent thinking when tackling a programming...
-
Do some amendment and enhance the given research paper: Table of Content Abstract..3 Action Research.4 Research Methodology and Design...5 Literature Review: NoSQL Database7 Proposal.7 Iteration 1..8...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Show that the sum of the squares of the distances from a point P = (c, d) to n fixed points (a 1 , b 1 ), . . . ,(a n , b n ) is minimized when c is the average of the x-coordinates a i and d is the...
-
The three laser beams shown in FIGURE 26-73 meet at a point at the back of a solid, transparent sphere. In figure 26-73 (a) What is the index of refraction of the sphere? (b) Is there a finite index...
-
When light with a wavelength of 221 nm is incident on a certain metal surface, electrons are ejected with a maximum kinetic energy of 3.28 10-19 J. Determine the wavelength (in nm) of light that...
-
Discuss the impact of a charismatic founder on the board culture and processes.
-
Dash Company adopted a standard costing system several years ago. The standard costs for the prime costs (i.e., direct materials + direct labor) of its single product are All materials are added at...
-
) Suppose you own a clothing boutique to pass the time in your retirement. This business currently has no debt, no short - term investments, 1 0 0 , 0 0 0 shares outstanding, a beta of 1 . 2 ,...
-
8 91426 10 11 (CCM) builds furniture for a range of commercial customers. They build furniture used in hotels and department stores, on cruise liners, ferries and passenger aircraft. One of their...
-
(a) Keneilwe is employed by Josh Ltd as the General manager. Her Salary is P320,000 per annum. She is also given a company car which cost is P145,000 and the company is paying for fuel. In November...
-
An astronaut onboard the ship has a heart rate of 70.0 beats per minute. Signals generated by the astronaut's pulse are radioed to Earth when the spaceship is moving perpendicular to a line that...
-
Seth Godin's compelling video, "How to Get Your Ideas to Spread," underscores the value of embracing innovation and adapting to change to achieve success (Godin, 2003). Tesla, Inc., guided by the...
-
choose tony & munro - skincare for the allowed company 2.4.3 Report Weight: Type of Collabora- tion: Due: Submission: Format: Length: Curriculum Mode: 25% Individual 11.59pm on 15 January 2023. via...
-
Function f(t) is defined as follows: f(t)=-|t|, -i. (a) Sketch f(t) over the domain -
-
The resistance of a conductor wire of length 26 meters is known to be R = 100ohm This wire is bent into a right trapezoid and made into a closed frame as shown in the figure. The frame is kept...
-
Steve Reese is a well-known Interior designer In Fort Worth, Texas. He wants to start his own business and convinces Rob O'Donnell, a local merchant, to contribute the capital to form a partnership....
-
Distinguish between the work performed by public accountants and the work performed by accountants in commerce and industry and in not-for-profit organisations.
-
Write program code to access individual fields of records under each of the following circumstances. For each case, state the assumptions you make concerning pointers, separator characters, and so...
-
What is information extraction? What are the different types of information extraction from structured text?
-
Map the COMPANY ER schema in Figure 3.2 into ODL classes. Include appropriate methods for each class. Figure 3.2 Fname Minit Lname Bdate Name Address Salary Ssn Sex Locations N WORKS FOR Name Number...
-
Assuming that money is worth 10%, compute the present value of a. \($7,000\) received 15 years from today. Bing b. The right to inherit \($1,000,000\) 14 years from now. c. The right to receive...
-
For each of the following independent situations, compute the net after-tax cash flow amount by subtracting cash outlays for operating expenses and income taxes from cash revenue. The cash outlay for...
-
Gardner, Inc., plans to finance its expansion by raising the needed investment capital from the following sources in the indicated proportions and respective capital cost rates: Calculate the...
Study smarter with the SolutionInn App