WGU D427 Data Management - Applications Labs 7 and 8 final
assessment
1.7.1 LAB - Alter Movie table
The Movie table has the following columns:
ID - positive integer
Title - variable-length string
Genre - variable-length string
RatingCode - variable-length string
Year - integer
Write ALTER statements to make the following modifications to the Movie
table:
1. Add a Producer column with VARCHAR data type (max 50 chars).
2. Remove the Genre column.
3. Change the Year column's name to ReleaseYear, and change the data
type to SMALLINT.: ALTER TABLE Movie
ADD Producer VARCHAR(50);
ALTER TABLE Movie
DROP Genre;
ALTER TABLE Movie
CHANGE Year ReleaseYear SMALLINT;
2.7.2 LAB - Insert rows into Horse table
The Horse table has the following columns:
ID - integer, auto increment, primary key
RegisteredName - variable-length string
Breed - variable-length string, must be one of the following: Egyptian Arab,
Holsteiner, Quarter Horse, Paint, Saddlebred
Height - decimal number, must be between 10.0 and 20.0
BirthDate - date, must be on or after Jan 1, 2015
Insert the following data into the Horse table:
RegisteredName Breed Height: INSERT INTO Horse (RegisteredName,
Breed, Height, BirthDate)
VALUES ('Babe', 'Quarter Horse', 15.3, '2015-02-10');
INSERT INTO Horse (RegisteredName, Breed, Height,
1/
13
, WGU D427 Data Management - Applications Labs 7 and 8 final
assessment
BirthDate) VALUES ('Independence', 'Holsteiner', 16.0,
'2017-03-13');
2/
13
assessment
1.7.1 LAB - Alter Movie table
The Movie table has the following columns:
ID - positive integer
Title - variable-length string
Genre - variable-length string
RatingCode - variable-length string
Year - integer
Write ALTER statements to make the following modifications to the Movie
table:
1. Add a Producer column with VARCHAR data type (max 50 chars).
2. Remove the Genre column.
3. Change the Year column's name to ReleaseYear, and change the data
type to SMALLINT.: ALTER TABLE Movie
ADD Producer VARCHAR(50);
ALTER TABLE Movie
DROP Genre;
ALTER TABLE Movie
CHANGE Year ReleaseYear SMALLINT;
2.7.2 LAB - Insert rows into Horse table
The Horse table has the following columns:
ID - integer, auto increment, primary key
RegisteredName - variable-length string
Breed - variable-length string, must be one of the following: Egyptian Arab,
Holsteiner, Quarter Horse, Paint, Saddlebred
Height - decimal number, must be between 10.0 and 20.0
BirthDate - date, must be on or after Jan 1, 2015
Insert the following data into the Horse table:
RegisteredName Breed Height: INSERT INTO Horse (RegisteredName,
Breed, Height, BirthDate)
VALUES ('Babe', 'Quarter Horse', 15.3, '2015-02-10');
INSERT INTO Horse (RegisteredName, Breed, Height,
1/
13
, WGU D427 Data Management - Applications Labs 7 and 8 final
assessment
BirthDate) VALUES ('Independence', 'Holsteiner', 16.0,
'2017-03-13');
2/
13