WGU D427, MYSQL - SQL Programing Intermediate
Exam Questions and Verified Rationalized Answers 2025/2026
1. The Member table will have the following columns: ID—
q q q q q q q q
positive integer q
FirstName—variable-
length string with up to 100 characters, MiddleInitial—fixed-
q q q q q q q
length string with 1 character, LastName—variable-
q q q q q
length string with up to 100 characters, DateOfBirth—date,
q q q q q q q
AnnualPledge—
positive decimal value representing a cost of up to $999,999, with 2 digits for cents,
q q q q q q q q q q q q q q
Write a SQL statement to create the Member table.
q q q q q q q q
Do not add any additional constraints to any column beyond what is stated.-
q q q q q q q q q q q q
: CREATE TABLE Member (
q q q q
ID INT PRIMARY KEY unsigned, First
q q q q q
Name VARCHAR(100), MiddleInitial
q q
q CHAR(1), LastName VARCHAR(10 q q
0),
DateOfBirth DATE, q
AnnualPledge DECIMAL(8, 2) unsigned q q q
);
1q/q47
,2. The Rating table has the following columns: RatingC
q q q q q q q
ode—variable-
length string, primary key, RatingDescription—
q q q q
variable-length string, q
The Movie table should have the following columns: Title—
q q q q q q q q
variable-length string, maximum 30 characters, RatingCode— q q q q q
variable-
length string, maximum 5 characters, Write a SQL statement to crea
q q q q q q q q q q
te the Movie table.
q q q
Designate the RatingCode column in the Movie table as a foreign key to the RatingCode c
q q q q q q q q q q q q q q q
olumn in the Rating table.: CREATE TABLE Movie (
q q q q q q q q
Title VARCHAR(30),
q
RatingCode VARCHAR(5), q
FOREIGN KEY (RatingCode) REFERENCES Rating(RatingCode)
q q q q
);
3. The Movie table has the following columns: ID—
q q q q q q q
integer, primary key, q q
Title—variable-length string, Genre— q q
variable-length string, RatingCode— q q
variable-length string, Year—integer, q q
A new column must be added to the Movie table: Colum
q q q q q q q q q q
n name: Score,
q q
2q/q47
,Data type: decimal(3,1),
q q
Write a SQL statement to add the Score column to the Movie table.: ALTER TABLE Movie
q q q q q q q q q q q q q q q
ADD Score DECIMAL(3, 1);
q q q
4. The Movie table has the following columns:
q q q q q q
ID—integer, primary key, Title— q q q
variable-length string, Genre—variable- q q
length string, RatingCode—variable-
q q
length string, Year—integer,
q q
Write a SQL statement to create a view named MyMovies that contains the Title, Genre,
q q q q q q q q q q q q q q
and Year columns for all movies. Ensure your result set returns the columns in the order
q q q q q q q q q q q q q q q
ndicated.: CREATE VIEW MyMovies AS
q q q q
SELECT Title, Genre, Year FR
q q q q
OM Movie;
q
5. The Movie table has the following columns:
q q q q q q
ID—integer,
Title—variable-length string, Genre— q q
variable-length string, RatingCode— q q
variable-length string, Year—integer, q q
Write a SQL statement to modify the Movie table to make the ID column the primary key
q q q q q q q q q q q q q q q q
: ALTER TABLE Movie
q q q
ADD PRIMARY KEY (ID);
q q q
6. The Movie table has the following columns:
q q q q q q
ID—integer, primary key, Title— q q q
variable-length string, Genre—variable- q q
3q/q47
, length string, RatingCode—variable-
q q
length string, Year—integer,
q q
The YearStats table has the following columns:
q q q q q q
Year—integer, TotalGross— q
bigint unsigned, Releases—
q q
integer,
Write a SQL statement to designate the Year column in the Movie table as a foreign key to
q q q q q q q q q q q q q q q q q
q the Year column in the YearStats table.: ALTER TABLE Movie ADD CONSTRAINT Year FOR
q q q q q q q q q q q q q
EIGN KEY (Year)q q
References YearStats(Year); q
4q/q47