Home > Databases > Quizzes > MySQL Basics Practice Test: Select Statement
MySQL Basics Practice Test: Select Statement
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 63% Most missed: “Which of the following belongs to an “aggregate function”?”
Quiz on MySQL select clauses, from clauses, order by clauses, where clauses, group by and having clause. The SELECT statement in MySQL is used to retrieve rows from one or more tables. The general syntax for a SELECT statement is SELECT what_to_select FROM which_table WHERE conditions_to_satisfy. What_to_select indicates what you want to see, which can be a list of columns, or * to indicate “all columns”.  Here are some things you can do with the SELECT command: Specify columns to display: Use the column specification portion of the SELECT command to name the columns you want to display.... Show more
MySQL Basics Practice Test: Select Statement
Time left 00:00
25 Questions

1. Which of the following table exist in Mysql?
2. What is the significance of “ORDER BY emp_id DESC” in the following MySQL command?
SELECT emp_id, fname, lname
FROM person
ORDER BY emp_id DESC;
3. Is “GROUP BY” clause is similar to “ORDER BY” clause?
4. Which clause is used with an “aggregate functions”?
5. What will be the output of the following MySQL statement “false OR Null”?
6. Find the missing clause from the following SQL statement?
CREATE VIEW person_1 AS
SELECT fname, lname, person_id
_________person;
7. Which command is used to create “Temporary tables” in MySQL?
8. Which among the following is an optional Keyword?
9. Which of the following belongs to an “aggregate function”?
10. What is the need of “column Aliases” in “SELECT” clause?
11. What will be the output of the following MySQL statement “Null AND Null”?
12. If emp_id contain the following set {1, 2, 2, 3, 3, 1}, what will be the output on execution of the following MySQL statement?
SELECT emp_id
FROM person
ORDER BY emp_id;
13. What will be the output of the following MySQL statement “NOT (Null)”?
14. What will be the order of sorting in the following MySQL statement?
SELECT emp_id, emp_name
FROM person
ORDER BY emp_id, emp_name;
15. If emp_id contain the following set {-1, -2, 2, 3, -3, 1}, what will be the output on execution of the following MySQL statement?
SELECT emp_id
FROM person
ORDER BY emp_id;
16. What will be the output of the following MySQL command?
SELECT emp_id, fname, lname
FROM employee
WHERE title=’HEAD TELLER’ AND start_date>2008-11-23;
17. Which clause is similar to “HAVING” clause in Mysql?
18. If in Table “account”, a column “cust_id” consists of {1,2,2,3,3,5,6,7,8,8} then what will be the output on executing the following MySQL statement?
SELECT DISTINICT cust_id
FROM account;
19. If emp_id contain the following set {9, 7, 6, 4, 3, 1, 2}, what will be the output on execution of the following MySQL command?
SELECT emp_id
FROM person
ORDER BY emp_id DESC;
20. What is the significance of the statement “GROUP BY d.name” in the following MySQL statement?
SELECT d.name, COUNT (emp_id) emp_no
FROM department d INNER JOIN Employee e
ON d.dept_id=e.emp_id
GROUP BY d.name
21. What will be the output of the following MySQL statement “true OR Null”?
22. Is there any error in the following MySQL statement?
SELECT e.emp_id, e.fname,e.lname,d.name
FROM employee e INNER JOIN department d
ON e.dept_id=e.dept_id;
23. Is there any error in executing the following MySQL command?
SELECT emp_id, ‘ACTIVE’,
emp_id * 3.145,
UPPER (lname)
FROM Employee;
24. What is the significance of “ORDER BY” in the following MySQL statement?
SELECT emp_id, fname, lname
FROM person
ORDER BY emp_id;
25. What will be the output of the following SQL statement?
SELECT person_id, fname, lname
FROM person
WHERE person_id=1;