Assessment Exam Labs 7 and 8
Questions with Verified Answers 2025/2026
1. 7.1 LAB - Alter Movie table
g g g g g
The Movie table has the following columns:
g g g g g g
ID - positive integer
g g g
Title - variable-length string Genre -
g g g g g
variable-length string
g g
RatingCode - variable- g g
length string Year - integerg g g g
Write ALTER statements to make the following modifications to the Movie table:
g g g g g g g g g g g
1. Add a Producer column with VARCHAR data type (max 50 chars).
g g g g g g g g g g
2. Remove the Genre column. g g g
3. Change theYear column's name to ReleaseYear, and change the data type to SMALLI
g g g g g g g g g g g g g
NT.: ALTER TABLE Movie
g g g
ADD Producer VARCHAR(50);
g g
ALTER TABLE Movie g g
DROP Genre; g
ALTER TABLE Movie g g
1g/g24
,CHANGE Year ReleaseYear SMALLINT; g g g
2. 7.2 LAB - Insert rows into Horse table
g g g g g g g
The Horse table has the following columns:
g g g g g g
ID - integer, auto increment, primary key RegisteredName -
g g g g g g g g
variable-length string
g g
Breed - variable- g g
length string, must be one of the following: Egyptian Arab, Holsteiner, Quarter Horse, Pai
g g g g g g g g g g g g g
nt, Saddlebred
g
Height - decimal number, must be between 10.0 and 20.0 BirthDate -
g g g g g g g g g g g
g date, must be on or after Jan 1, 2015
g g g g g g g g
Insert the following data into the Horse table:
g g g g g g g
RegisteredName Breed Height: INSERT INTO Horse (RegisteredName, Breed, Height, BirthD
g g g g g g g g g
ate)
VALUES ('Babe', 'Quarter Horse', 15.3, '2015-02-10');
g g g g g
INSERT INTO Horse (RegisteredName, Breed, Height, BirthDate) VALUES ('Ind
g g g g g g g g
ependence', 'Holsteiner', 16.0, '2017-03-13'); g g g
2g/g24
, INSERT INTO Horse (RegisteredName, Breed, Height, BirthDate) VALUES ('Elli
g g g g g g g g
e', 'Saddlebred', 15.0, '2016-12-22');
g g g
INSERT INTO Horse (Breed, Height, BirthDate) VALUES ('Egypti
g g g g g g g
an Arab', 14.9, '2019-10-12');
g g g
3. 7.3 LAB - Update rows in Horse table
g g g g g g g
The Horse table has the following columns:
g g g g g g
ID - integer, auto increment, primary key RegisteredName -
g g g g g g g g
g variable-length string g
Breed - variable- g g
length string, must be one of the following: Egyptian Arab, Holsteiner, Quarter Horse, Pai
g g g g g g g g g g g g g
nt, Saddlebred g
Height - g
g decimal number, must be e 10.0 and d 20.0 BirthDate -
g g g g g g g g g g
g date, must be e Jan 1, 2015
g g g g g g
Make the following updates:
g g g
1.- Change the height to 15.6 for horse with ID 2.
g g g g g g g g g g
2.-
g Change the registered name to Lady: UPDATE Horse SET Height = 15.
g g g g g g g g g g g
6
WHERE ID = 2; g g g
UPDATE Horse g
3g/g24