100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Data Management - Applications D427 - MYSQL - SQL Programing - Intermediate Level Exam Questions And Answers

Rating
-
Sold
-
Pages
31
Grade
A+
Uploaded on
30-05-2024
Written in
2023/2024

Data Management - Applications D427 - MYSQL - SQL Programing - Intermediate Level Exam Questions And Answers The Member table will have the following columns: ID—positive integer FirstName—variable-length string with up to 100 characters, MiddleInitial—fixed-length string with 1 character, LastName—variable-length string with up to 100 characters, DateOfBirth—date, AnnualPledge—positive decimal value representing a cost of up to $999,999, with 2 digits for cents, Write a SQL statement to create the Member table. Do not add any additional constraints to any column beyond what is stated. CREATE TABLE Member ( ID INT PRIMARY KEY unsigned, FirstName VARCHAR(100), MiddleInitial CHAR(1), LastName VARCHAR(100), DateOfBirth DATE, AnnualPledge DECIMAL(8, 2) unsigned ); The Rating table has the following columns: RatingCode—variable-length string, primary key, RatingDescription—variable-length string, The Movie table should have the following columns: Title—variable-length string, maximum 30 characters, RatingCode—variable-length string, maximum 5 characters, Write a SQL statement to create the Movie table. Designate the RatingCode column in the Movie table as a foreign key to the RatingCode column in the Rating table. CREATE TABLE Movie ( Title VARCHAR(30), RatingCode VARCHAR(5), FOREIGN KEY (RatingCode) REFERENCES Rating(RatingCode) ); The Movie table has the following columns: ID—integer, primary key, Title—variable-length string, Genre—variable-length string, RatingCode—variable-length string, Year—integer, A new column must be added to the Movie table: Column name: Score, Data type: decimal(3,1), Write a SQL statement to add the Score column to the Movie table. ALTER TABLE Movie ADD Score DECIMAL(3, 1); The Movie table has the following columns: ID—integer, primary key, Title—variable-length string, Genre—variable-length string, RatingCode—variable-length string, Year—integer, Write a SQL statement to create a view named MyMovies that contains the Title, Genre, and Year columns for all movies. Ensure your result set returns the columns in the order indicated. CREATE VIEW MyMovies AS SELECT Title, Genre, Year FROM Movie; The Movie table has the following columns: ID—integer, Title—variable-length string, Genre—variable-length string, RatingCode—variable-length string, Year—integer, Write a SQL statement to modify the Movie table to make the ID column the primary key. ALTER TABLE Movie ADD PRIMARY KEY (ID); The Member table will have the following columns: ID—positive integer FirstName—variable-length string with up to 100 characters, MiddleInitial—fixed-length string with 1 character, LastName—variable-length string with up to 100 characters, DateOfBirth—date, AnnualPledge—positive decimal value representing a cost of up to $999,999, with 2 digits for cents, Write a SQL statement to create the Member table. Do not add any additional constraints to any column beyond what is stated. CREATE TABLE Member ( ID INT PRIMARY KEY unsigned, FirstName VARCHAR(100), MiddleInitial CHAR(1), LastName VARCHAR(100), DateOfBirth DATE, AnnualPledge DECIMAL(8, 2) unsigned ); The Rating table has the following columns: RatingCode—variable-length string, primary key, RatingDescription—variable-length string, The Movie table should have the following columns: Title—variable-length string, maximum 30 characters, RatingCode—variable-length string, maximum 5 characters, Write a SQL statement to create the Movie table. Designate the RatingCode column in the Movie table as a foreign key to the RatingCode column in the Rating table. CREATE TABLE Movie ( Title VARCHAR(30), RatingCode VARCHAR(5), FOREIGN KEY (RatingCode) REFERENCES Rating(RatingCode) ); The Movie table has the following columns: ID—integer, primary key, Title—variable-length string, Genre—variable-length string, RatingCode—variable-length string, Year—integer, A new column must be added to the Movie table: Column name: Score, Data type: decimal(3,1), Write a SQL statement to add the Score column to the Movie table. ALTER TABLE Movie ADD Score DECIMAL(3, 1); The Movie table has the following columns: ID—integer, primary key, Title—variable-length string, Genre—variable-length string, RatingCode—variable-length string, Year—integer, Write a SQL statement to create a view named MyMovies that contains the Title, Genre, and Year columns for all movies. Ensure your result set returns the columns in the order indicated. CREATE VIEW MyMovies AS SELECT Title, Genre, Year FROM Movie; The Movie table has the following columns: ID—integer, Title—variable-length string, Genre—variable-length string, RatingCode—variable-length string, Year—integer, Write a SQL statement to modify the Movie table to make the ID column the primary key. ALTER TABLE Movie ADD PRIMARY KEY (ID);

Show more Read less
Institution
Course











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Course

Document information

Uploaded on
May 30, 2024
Number of pages
31
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

R246,33
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Document also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Studyclock Ashford University
Follow You need to be logged in order to follow users or courses
Sold
849
Member since
3 year
Number of followers
492
Documents
8831
Last sold
1 week ago

4,2

222 reviews

5
131
4
35
3
34
2
10
1
12

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions