Olete.in
Articles
Mock Tests
🧪 Mysql MCQ Quiz Hub
MY SQL Basic Sample Test
Choose a topic to test your knowledge and improve your Mysql skills
1. Which of the following SQL query can be used to insert new recorder to a database table?
add row
ADD
APPEND
INSERT
2. Choose not a type of SQL constraint?
PRIMARY
UNIQUE
ALTERNATE
FOREIGN
3. Choose following behavior as an SQL virtual table?
view
relation
Query
Query results
4. When using the SQL INSERT statement..
rows can be modified according to criteria only.
rows cannot be copied in mass from one table to another only.
rows can either be inserted into a table one at a time or in groups.
rows can be inserted into a table only one at a time only
5. The SQL ALTER statement can be used
to change in table data
to change in table structure
delete rows from the table
delete new recored in the table
6. Which SQL query can be used to delete columns from a table?
update TABLE Table_Name DROP Column_Name
MODIFY TABLE Table_Name DROP COLUMN Column_Name
ALTER TABLE TableName DROP Column_Name
ALTER TABLE TableName DROP COLUMN Column_Name
7. What SQL query can be used to add columns to a table?
ALTER TABLE Table_Name ADD Column_Name
Update TABLE TableName ADD COLUMN ColumnName
MODIFY TABLE TableName ADD ColumnName
MODIFY TABLE TableName ADD COLUMN ColumnName
8. The query to remove rows from a table named user ?
DROP FROM user where id =1
UPDATE FROM user where id =1
REMOVE FROM user where id =1
DELETE FROM user where id =1
9. The SQL WHERE clause to limits the
row data
column data
Both
None
10. Which of the following is the original purpose of SQL?
To define the data structures
To specify the syntax and semantics of SQL data definition language
To specify the syntax and semantics of SQL manipulation language
All of the above
11. The wildcard in a WHERE clause is useful when?
An exact match is necessary in a CREATE statement
An exact match is necessary in a SELECT statement
An exact match is not possible in a SELECT statement
An exact match is not possible in a CREATE statement
12. The command to delete a table from a database
DROP TABLE tablename ;
DELETE TABLE tablename ;
REMOVE TABLE tablename ;
UPDATE TABLE tablename ;
13. The SQL keyword(s) ________ is used with wildcards
NOT IN only
LIKE only
IN only
IN and NOT IN
14. sub-query in an SQL SELECT statement is enclosed in
brackets -- [...]
parenthesis -- (...)
CAPITAL LETTERS
braces -- {...}
15. The result of a SQL SELECT statement is a _______
file
report
table
None
16. According to the SQL-92 standard the asterisk (*) means in Select statements
all columns of the table are to be returned
all records meeting the full criteria are to be returned
all records with even partial criteria met are to be returned
None
17. The HAVING clause does which of the following?
Acts EXACTLY like a WHERE clause
Acts like a WHERE clause but is used for columns rather than groups
Acts like a WHERE clause but is used for groups rather than rows
Acts like a WHERE clause but is used for rows rather than columns
18. Which of the following do you need to consider when you make a table in SQL?
Data types
Primary keys
Default values
All of the above
19. When three or more AND and OR conditions are combined, it is easier to use the SQL keyword(s)
NOT IN only
LIKE only
IN only
Both IN and NOT IN
20. SQL can be used to
create database structures
query database data
modify database data
All of the above
21. The SQL keyword BETWEEN is used
to limit the columns displayed
for ranges
as a wildcard
None of these is correct
22. Which of the following statement is correct for using comparison operators in SQL?
SELECT * FROM user WHERE id>50 and id <80
SELECT * FROM user WHERE id>50 and <80
SELECT * FROM user WHERE id>50 and where id <80
SELECT * FROM user WHERE id>50, where id <80
23. How to select all data from student table starting the name from letter a?
%a%
a%
_a&
None
24. What is the full form of SQL?
Structured Query Language
Structured Query List
Simple Query Language
All of the above
25. Which of the following group functions ignore NULL values?
MAX
COUNT
SUM
All of the above
26. Keyword is used to sort ?
SORT BY
ORDER BY
ORDER
SORT
27. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
Data Definition Language(DDL)
Data Manipulation Language(DML)
Both
None of these is correct
28. What operator tests column for the absence of data?
IS NULL
NOT
EXISTS
All of the above
29. Command makes the updates performed by the transaction permanent in the database?
COMMIT
ROLLBACK
TRUNCATE
DELETE
30. undo all the updates performed by the SQL in the transaction?
ROLLBACK
COMMIT
TRUNCATE
DELETE
31. Find all the user whose id is 10
SELECT * FROM user WHERE id= 10;
SELECT * FROM WHERE id= 10;
SELECT * FROM user.id= 10;
None
32. Find the temperature in increasing order of all cities
SELECT city FROM weather ORDER BY temperature
SELECT city, temperature FROM weather
SELECT city, temperature FROM weather ORDER BY temperature
SELECT city, temperature FROM weather ORDER BY city
33. What is the meaning of LIKE %0%0%
Feature begins with two 0
Feature ends with two 0
Feature has more than two 0
Feature has two 0 in it, at any position
34. Which SQL statement is used to update data in a database?
SAVE
SAVE AS
UPDATE
MODIFY
35. Which SQL statement is used to delete data FROM a database?
REMOVE
ALTER
DELETE
COLLAPSE
36. Which of the following must be enclosed in double quotes?
Column Alias
Dates
Strings
All of the above
37. Which of the following SQL commands is used to retrieve data?
DELETE
SELECT
INSERT
SELECT
38. Which of the following is a SQL aggregate function?
AVG
LEFT
JOIN
LEN
39. Which SQL keyword is used to retrieve only unique values?
DISTINCTIVE
UNIQUE
DIFFERENT
DISTINCT
40. Which SQL keyword is used to retrieve a maximum value?
TOP
MAX
UPPER
MOST
41. The FROM SQL clause is used to.
specify what table we are selecting or deleting data FROM
specify range for search condition
specify search condition
None of these
42. Which of the SQL statements is correct?
SELECT Username AND Password FROM Users
SELECT Username, Password FROM Users
ELECT Username, Password WHERE Username = user1
None of these
43. A command that lets you change one or more fields in a record is
Insert
Modify
Look-up
All of the above
44. which command is used to SELECT only one copy of each set of duplicate rows
SELECT DISTINCT
SELECT UNIQUE
SELECT DIFFERENT
All of the above
45. which of the following is not a data definition language commands?
RENAME
GRANT
REVOKE
UPDATE
Submit