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...
-
1. Suppose that the first ball is not replaced before the second ball is drawn. Find the probability that both balls are red. 2. Was your intuitive guess in part 1 correct? 3. Do you think that the...
-
Operating profits and losses for the seven operating segments of Foley Corporation are (in 000,000): Based only on the operating profit (loss) test, which industry segments arereportable? Penley...
-
A sample of 80 accounts payable vouchers is to be selected from a population of 3,200. The vouchers are numbered consecutively from 1 to 3,200 and are listed in a computer spreadsheet file. Required:...
-
The following are nine situations, each containing two means of accumulating evidence: 1. Confirm receivables with consumers versus confirming accounts receivable with business organizations. 2....
-
Hudson Company reports the following contribution margin income statement. HUDSON COMPANY Contribution Margin Income Statement For Year Ended December 31 Sales (9,600 units at $225 each) Variable...
-
You have been employed as a consultant to Golf R Us, Inc. The company has been having problems with account receivables and they want to use various dunning methods to better their receivables. But...
-
NUBD is a manufacturer of Japanese pancakes. It's break-even sales is P250,000. It has a variable cost ratio of 75% and return on sales ratio of 6%. What is NUBD's margin of safety ratio? *
-
As a recent graduate of college or university, what advantages do you have as you enter the job market?
-
Many individuals conduct surveys of interest on social media platforms, like Facebook. What are the potential issues with using these survey results in a report?
-
Write a follow-up email message or letter after an office visit or plant trip. Thank your hosts for their hospitality; relate your strong points to things you learned about the company during the...
-
How can networking, even with people who arent in your field, aid you in your job search?
-
In small groups, discuss the worst or most difficult interview questions you have ever received. Add to your list by searching the internet for weird or unusual questions. Review your list and...
-
Explain if metals conduct electricity better than other materials? Most students learn early on that some materials work electricity better than others. Give detailed answer giving examples.
-
Feller Company purchased a site for a limestone quarry for $100,000 on January 2, 2019. It estimate that the quarry will yield 400,000 tons of limestone. It estimates that its retirement obligation...
-
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...
-
Consider the binary variable version of the fixed effects model in Equation (10.11) except with an additional regressor, \(D 1_{i}\); that is, let \[ Y_{i t}=\beta_{0}+\beta_{1} X_{i t}+\gamma_{1} D...
-
Using the regression in Equation (10.11), what are the slope and intercept for a. Entity 1 in time period 1? b. Entity 1 in time period 3? c. Entity 3 in time period 1? d. Entity 3 in time period 3?...
-
Do the fixed effects regression assumptions in Key Concept 10.3 imply that \(\operatorname{cov}\left(\widetilde{v}_{i t}, \widetilde{v}_{i s} ight)=0\) for \(t eq s\) in Equation (10.28)? Explain....
Study smarter with the SolutionInn App