SQL Exam | SQL Tutorials

Home >> SQL Exam

SQL Exam

PDF

SQL Exam

1. What does SQL stand for?

a. Strong Question Language
b. Structured Query Language
c. Structured Question Line

2. Which SQL command extracts data from a database?

a. SELECT
b. OPEN
c. UPDATE
d. EXTRACT

3. Which SQL command updates data in a database?

a. SAVE AS
b. SAVE
c. INSERT
d. UPDATE

4. Which SQL command deletes data from a database?

a. BLANK
b. REMOVE
c. UPDATE
d. DELETE

5. Which SQL command inserts new data in a database?

a. NEW
b. PUT
c. INSERT
d. ADD

6. With SQL, how do you select the column named "FirstName" from a table named "Persons"?

a. EXTRACT FirstName FROM Persons
b. SELECT FirstName FROM Persons
c. SELECT Persons, FirstName
d. SELECT Persons FROM FirstName

7. With SQL, how do you select all the columns from a table named "Persons"?

a. SELECT [all] FROM PERSONS
b. SELECT * FROM Persons
c. SELECT Persons
d. SELECT *.Persons

8. With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter"?

a. SELECT [all] FROM Persons LIKE FirstName<>'Peter'
b. SELECT * FROM Persons WHERE FirstName LIKE='Peter'
c. SELECT * FROM Persons WHERE FirstName='Peter'
d. SELECT * FROM Persons LIKE 'Peter'

9. With SQL, how do you select all the records from a table named "Persons" where the "FirstName" starts with an "a"?

a. SELECT * FROM Persons LIKE FirstName='%a'
b. SELECT * FROM Persons WHERE FirstName LIKE 'a%'
c. SELECT * FROM Persons WHERE FirstName='a'
d. SELECT * FROM Persons WHERE FirstName LIKE '%a'

10. The AND operator displays a record if ANY conditions listed are true. The OR operator displays a record if ALL of the conditions listed are true.

a. True
b. False

11. With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?

a. SELECT * FROM Persons WHERE FirstName='Peter' OR LastName='Jackson'
b. You can not do that with SQL
c. SELECT * WHERE FirstName='Peter', LastName='Jackson' FROM Persons
d. SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'

12. With SQL, how do you select all the records where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?

a. SELECT * FROM Persons WHERE LastName>'Hansen',LastName<'Pettersen'
b. SELECT * FROM Persons WHERE LastName>='Hansen' AND LastName<=’Pettersen’
c. SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND ‘Pettersen’
d. SELECT LastName>'Hansen' AND LastName<'Pettersen' FROM Persons

13. Which SQL keyword is used to sort the result?

a. GROUP BY
b. SORT BY
c. ORDER BY
d. DESC

14. With SQL, how can you return all the records from a table named "Persons" sorted REVERSE alphabetically by "FirstName"?

a. SELECT * FROM Persons WHERE FirstName ORDER BY FirstName DESC
b. SELECT * FROM Persons ORDER BY -'FirstName'
c. SELECT * FROM Persons SORT REVERSE 'FirstName'
d. SELECT * FROM Persons ORDER BY FirstName DESC

15. With SQL, how can you insert a new record into the "Persons" table?

a. INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
b. INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
c. INSERT ('Jimmy', 'Jackson') INTO Persons
d. INSERT INTO Persons (FirstName, LastName) VALUES ('Jimmy', 'Jackson')

16. With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?

a. INSERT INTO Persons ('Olsen') INTO LastName
b. INSERT INTO Persons (LastName) VALUES ('Olsen')
c. INSERT ('Olsen') INTO (LastName) FROM Persons
d. INSERT (‘Olsen’) INTO Persons

17. How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons Table?

a. SAVE Persons SET LastName = 'Nilsen' WHERE LastName = 'Hansen'
b. SAVE Persons SET LastName = 'Hansen' INTO LastName = 'Nilsen'
c. UPDATE Persons SET LastName = 'Hansen' INTO LastName = 'Nilsen'
d. UPDATE Persons SET LastName = 'Nilsen' WHERE LastName = 'Hansen'

18. With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?

a. DELETE FROM Persons WHERE FirstName = 'Peter'
b. DELETE ROW FirstName='Peter' FROM Persons
c. DELETE FirstName='Peter' FROM Persons
d. DELETE * FROM Persons

Partners: Hearing Aid Talk Forum for Hearing Aids | One Direction Forum | Adult Toys

© Pixel Kicks, 5 Marlborough Road, Royton, Oldham, OL2 6AU.