Basic SQL Quiz - 2 Online Test
Basic SQL Quiz - 2 Online Test
SQL (/topics/2) / Test your SQL fundamentals (/topics/2) / Basic SQL Quiz - 2 / 0 (/quiz/128/favourites) Share Back
(https://www.facebook.co
app_id=182909316066094
sql-quiz-
2&redirect_uri=https://alie
sql-quiz-2)
Number of Questions: 20
1.
With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is
"Jackson"?
(/question/1166/with-sql-how-do-you-select-all-the-records-from-a-table-name) Attempted 20/20 Correct 0
sql (/tag/40/sql/question)
‹ 1 2 3 4 5 6 7 8 9 10
A SELECT * FROM Persons WHERE FirstName LIKE 'Peter' AND LastName LIKE 'Jackson'
Hide answer
Correct Option: B
Ad choices
2. With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and
including) "Hansen" and "Pettersen"?
sql (/tag/40/sql/question)
Hide answer
Correct Option: B
https://www.aliensbrain.com/quiz/128/basic-sql-quiz-2 1/6
1/18/23, 10:50 AM Basic SQL Quiz - 2 Online Test
A SELECT UNIQUE
B SELECT INDENTITY
C SELECT DIFFERENT
✓ D SELECT DISTINCT
Hide answer
Correct Option: D
A SORT BY
B ORDER
✓ C ORDER BY
D SORT
Hide answer
Correct Option: C
5. With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?
sql (/tag/40/sql/question)
Hide answer
‹ 1 2 3 4 5 6 7 8 9 10
Correct Option: B
6.
With SQL, how can you insert a new record into the "Persons" table?
(/question/1171/with-sql-how-can-you-insert-a-new-record-into-the-persons-ta)
sql (/tag/40/sql/question)
Hide answer
Correct Option: A
7. With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?
sql (/tag/40/sql/question)
Hide answer
Correct Option: A
8. How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?
sql (/tag/40/sql/question)
https://www.aliensbrain.com/quiz/128/basic-sql-quiz-2 2/6
1/18/23, 10:50 AM Basic SQL Quiz - 2 Online Test
Hide answer
Correct Option: B
9. With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?
sql (/tag/40/sql/question)
Hide answer
Correct Option: A
10. With SQL, how can you return the number of records in the "Persons" table?
sql (/tag/40/sql/question)
Hide answer
Correct Option: B
11. What will be the output of the following statement? SELECT LEN(CAST(LEFT('026-100', 3) AS INT))
Attempted 20/20 Correct 0
sql (/tag/40/sql/question)
✓ A 2
‹ 1 2 3 4 5 6 7 8 9 10
B 3
C 7
Hide answer
Correct Option: A
12. What will be the output of the following statement? SELECT CAST(-1 AS SMALLDATETIME)
sql (/tag/40/sql/question)
A 1900-01-01 00:00:00.000
B 1899-01-01 00:00:00.000
C 1752-01-01 00:00:00.000
✓ D The system will generate an error. Only positive integer values can be converted to a SMALLDATETIME data type.
Hide answer
Correct Option: D
13.
What will be the output of the following statement? SELECT ROUND(123.89, -1)
(/question/1186/what-will-be-the-output-of-the-following-statement-select-ro)
sql (/tag/40/sql/question)
✓ A 120.00
B 123.00
C 123.90
D 124.00
Hide answer
Correct Option: A
https://www.aliensbrain.com/quiz/128/basic-sql-quiz-2 3/6
1/18/23, 10:50 AM Basic SQL Quiz - 2 Online Test
14. What will be the output of the following statement? SELECT STR(6365, 3)
sql (/tag/40/sql/question)
✓ A
B 6365
C 6,365
D 6400
E 6365.000
Hide answer
Correct Option: A
15. What will be the output of the following statement? SET ARITHABORT OFF SET ANSI_WARNINGS OFF SELECT 100/0
sql (/tag/40/sql/question)
✓ A Null
B 0
C Infinity
D An error is generated.
Hide answer
Correct Option: A
A sysobjects
Attempted 20/20 Correct 0
B syscolumns
✓ C syscomments ‹ 1 2 3 4 5 6 7 8 9 10
D sysviews
Hide answer
Correct Option: C
17. What's the maximum value can an INT data type hold?
sql (/tag/40/sql/question)
✓ A 2,147,483,647
B 2,147,483,648
C 4,294,967,295
D 4,294,967,296
Hide answer
Correct Option: A
18.
What is the best data type to store the birthdays of the US Presidents, starting with George Washington's birthday of February 22,
1732?
(/question/1191/what-is-the-best-data-type-to-store-the-birthdays-of-the-us-)
sql (/tag/40/sql/question)
A DATETIME
✓ B INT
C SMALLDATETIME
D VARCHAR
Hide answer
Correct Option: B
https://www.aliensbrain.com/quiz/128/basic-sql-quiz-2 4/6
1/18/23, 10:50 AM Basic SQL Quiz - 2 Online Test
19. Which of the following is NOT a valid description of the public role?
sql (/tag/40/sql/question)
A The public role captures all default permissions for users in a database.
✓ C The public role is contained in every database, including msdb, tempdb, model, and all user databases except in the master database for security
purposes.
D The public role cannot have users, groups, or roles assigned to it.
Hide answer
Correct Option: C
20. What is the maximum date value that can be stored in a SMALLDATETIME data type?
sql (/tag/40/sql/question)
✓ A June 6, 2079
B July 6, 2079
Hide answer
Correct Option: A
- Hide questions
‹ 1 2 3 4 5 6 7 8 9 10
Add a comment...
ADVERTISEMENT
Ad by
Report this ad
Ad choices
technology (/tag/268/technology/quiz)
sports (/tag/437/sports/quiz)
history (/tag/438/history/quiz)
biology (/tag/2585/biology/quiz)
https://www.aliensbrain.com/quiz/128/basic-sql-quiz-2 5/6