AND PRE ASSESSMENT TEST 2025/2026 COMPLETE
ACTUAL TEST QUESTIONS AND CORRECT DETAILED
ANSWERS (VERIFIED ANSWERS) NEWEST UPDATED
VERSION |GUARANTEED PASS A+
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;
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, BirthDate)
VALUES ('Independence', 'Holsteiner', 16.0, '2017-03-13');
INSERT INTO Horse (RegisteredName, Breed, Height, BirthDate)
VALUES ('Ellie', 'Saddlebred', 15.0, '2016-12-22');
INSERT INTO Horse (Breed, Height, BirthDate)
VALUES ('Egyptian Arab', 14.9, '2019-10-12');
7.3 LAB - Update rows in 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 ≥ 10.0 and ≤ 20.0
BirthDate - date, must be ≥ Jan 1, 2015
Make the following updates:
1.- Change the height to 15.6 for horse with ID 2.
2.- Change the registered name to Lady
,UPDATE Horse
SET Height = 15.6
WHERE ID = 2;
UPDATE Horse
SET RegisteredName = 'Lady Luck',
BirthDate = '2015-05-01'
WHERE ID = 4;
UPDATE Horse
SET Breed = NULL
WHERE BirthDate >= '2016-12-22';
7.4 LAB - Delete rows from Horse table
The Horse table has the following columns:
ID - integer, auto increment, primary key
RegisteredName - variable-length string
Breed - variable-length string
Height - decimal number
BirthDate - date
Delete the following rows:
1.- Horse with ID 5.
2.- All horses with breed Holsteiner or Paint.
3.- All horses born before March 13, 2013.
DELETE FROM Horse
WHERE ID = 5;
DELETE FROM Horse
WHERE Breed IN ('Holsteiner' , 'Paint');
DELETE FROM Horse
WHERE BirthDate < '2013-03-13';
7.5 LAB - Select horses with logical operators
The Horse table has the following columns:
, ID - integer, primary key
RegisteredName - variable-length string
Breed - variable-length string
Height - decimal number
BirthDate - date
Write a SELECT statement to select the registered name, height, and
birth date for only horses that have a height between 15.0 and 16.0
(inclusive) or have a birth date on or after January 1, 2020.
SELECT RegisteredName, Height, BirthDate
FROM Horse
WHERE (Height BETWEEN 15.0 AND 16.0)
OR (BirthDate >= '2020-01-01');
7.6 LAB - Create Movie table
Create a Movie table with the following columns:
ID - positive integer with maximum value of 50,000
Title - variable-length string with up to 50 characters
Rating - fixed-length string with 4 characters
ReleaseDate - date
Budget - decimal value representing a cost of up to 999,999 dollars,
with 2 digits for cents
CREATE TABLE Movie(
ID SMALLINT UNSIGNED,
Title VARCHAR(50),
Rating CHAR(4),
ReleaseDate DATE,
Budget DECIMAL(8,2)
);
7.7 LAB - Create Student table with constraints
Create a Student table with the following column names, data types,
and constraints:
ID - integer with range 0 to 65 thousand, auto increment, primary key
FirstName - variable-length string with max 20 chars, not NULL