ProTechSolution
Home
Courses
Exercises
Quiz
Roadmaps
Experts
Login
Sign Up
Bootstrap 5 UI
Programming Concepts
HTML & CSS Masterclass
HTML
CSS
JavaScript
PHP
MySQL
Bootstrap 5
C#
MySQL Certification Quiz
Test your knowledge to earn your official course certificate!
1. With SQL, how can you return all the records from a table named 'Persons' sorted descending by 'FirstName'?
SELECT * FROM Persons ORDER BY FirstName DESC
SELECT * FROM Persons ORDER FirstName DESC
SELECT * FROM Persons SORT 'FirstName' DESC
SELECT * FROM Persons SORT BY 'FirstName' DESC
2. With SQL, how do you select all the records from a table named 'Persons' where the value of the column 'FirstName' starts with an 'a'?
SELECT * FROM Persons WHERE FirstName LIKE '%a'
SELECT * FROM Persons WHERE FirstName='a'
SELECT * FROM Persons WHERE FirstName LIKE 'a%'
SELECT * FROM Persons WHERE FirstName='%a%'
3. The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true
True
False
Depends on the database
Only in MySQL
4. Which SQL statement is used to delete data from a database?
COLLAPSE
REMOVE
DELETE
DROP
5. The NOT NULL constraint enforces a column to not accept NULL values.
True
False
Depends on the table
Only for Primary Keys
6. How can you change 'Hansen' into 'Nilsen' in the 'LastName' column in the Persons table?
UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'
MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen'
7. With SQL, how do you select all the records from a table named 'Persons' where the 'FirstName' is 'Peter' and 'LastName' is 'Jackson'?
SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'
SELECT FirstName='Peter', LastName='Jackson' FROM Persons
SELECT * FROM Persons WHERE FirstName='Peter' OR LastName='Jackson'
8. With SQL, how can you insert a new record into the 'Persons' table?
INSERT ('Jimmy', 'Jackson') INTO Persons
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
ADD INTO Persons ('Jimmy', 'Jackson')
9. What is the primary key?
A key used to encrypt the database
A unique identifier for a record
The first column in a table
A password
10. Which operator is used to search for a specified pattern in a column?
LIKE
GET
PATTERN
SEARCH
11. With SQL, how can you delete the records where the 'FirstName' is 'Peter' in the Persons Table?
DELETE FROM Persons WHERE FirstName = 'Peter'
DELETE FirstName='Peter' FROM Persons
DELETE ROW FirstName='Peter' FROM Persons
DROP FROM Persons WHERE FirstName='Peter'
12. What does SQL stand for?
Strong Question Language
Structured Query Language
Structured Question Language
Simple Query Language
13. Which operator is used to select values within a range?
BETWEEN
RANGE
WITHIN
IN
14. With SQL, how do you select a column named 'FirstName' from a table named 'Persons'?
EXTRACT FirstName FROM Persons
SELECT FirstName FROM Persons
SELECT Persons.FirstName
GET FirstName FROM Persons
15. With SQL, how do you select all the records from a table named 'Persons' where the value of the column 'FirstName' is 'Peter'?
SELECT * FROM Persons WHERE FirstName='Peter'
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
SELECT * FROM Persons WHERE FirstName<>'Peter'
SELECT * FROM Persons WHERE FirstName='Peter'
16. Which SQL statement is used to insert new data in a database?
INSERT INTO
ADD NEW
ADD RECORD
INSERT NEW
17. Which SQL statement is used to extract data from a database?
EXTRACT
SELECT
GET
OPEN
18. Which SQL keyword is used to sort the result-set?
ORDER BY
SORT BY
ORDER
SORT
19. Which SQL statement is used to update data in a database?
SAVE
UPDATE
MODIFY
SAVE AS
20. With SQL, how do you select all the columns from a table named 'Persons'?
SELECT [all] FROM Persons
SELECT Persons
SELECT * FROM Persons
SELECT *.Persons
Submit Quiz (20 Questions)