Assessment with Complete Solutions
Correct
Incorrect
1 of 66
Term
23. Assume there are two tables, A and B.
Which rows will always be included in the result set if Table A is inner
joined with Table B?
a. Only rows in Tables A and B that share the join condition
b. All rows in Table B
c. All rows in Table A
d. Only rows in Tables A and B that do not share the join condition.
Give this one a try later!
Only rows in Tables A and B
All rows in Table B
that share the join condition
SELECT Title, Genre
ALTER TABLE Vehicle
FROM Book
ADD EngineSize DECIMAL(2,1);
WHERE Year = 2020;
, Don't know?
2 of 66
Term
12. The Classification table has the following columns:
ClassificationCode—integer, primary key
ClassificationDescription—variable-length string
The Vehicle table should have the following columns:
Name—variable-length string, maximum 30 characters
ClassificationCode—integer
Write a SQL statement to create the Vehicle table. Designate the
ClassificationCode column in
the Vehicle table as a foreign key to the ClassificationCode column
in the Classification table.
Give this one a try later!
CREATE TABLE Student(
StudentID INT UNSIGNED,
FirstName VARCHAR(50),
MiddleInitial CHAR(1),
LastName VARCHAR(50),
DateOfBirth DATE,
AccountBalance DECIMAL(7,2) UNSIGNED
);
CREATE TABLE Vehicle (
Name VARCHAR(30),
ClassificationCode INT,
, FOREIGN KEY (ClassificationCode) REFERENCES
Classification(ClassificationCode)
);
ALTER TABLE Dog
ADD FOREIGN KEY (breedID) REFERENCES Breed (breedID);
SELECT Title, TotalSales
FROM Book
LEFT JOIN YearStats ON Book.Year = YearStats.Year;
Don't know?
3 of 66
Term
4. Which data type represents numbers with fractional values:
- varchar
- integer
- binary
- decimal
Give this one a try later!
CREATE INDEX
DATETIME
CREATE, ALTER, DROP
TIMESTAMP/DATE decimal
, Don't know?
4 of 66
Definition
SELECT grade, COUNT(*)
FROM student_grades
GROUP BY grade;
Give this one a try later!
41. Customer Table
Customer_ID
First_Name
Last_Name
Address
City
State
Zip
Mobile_Phone
Write a query to delete Amy Lin from the Customer table show below.
47. Write a query that will return all of the cities from the Customer table above.
Do not include duplicates -list each city only once.
53. Using the student_grades table listed above, write a query to count how
many students have each grade (A, B, and C).
MODELS TABLE
model_id