Untitled
SQL MCQ test Q1. Which of the following function returns the current date and time in mysql ? A. CURDATE() B. NOW() C. CURTIME() D. DATE() Q2.”Create Table … “ command is used to create which types of table in mysql? A. Permanent tables B. Virtual tables C. Temporary tables D. Both 2 and 3 Q3. What will be the output of the following MySQL command? SELECT * FROM employee WHERE title=’HEAD TELLER’; a) All columns and rows belong to table employee b) All columns but only those rows which contain ‘HEAD TELLER’ as a “title” c) All columns don’t belong to table employee d) None of the mentioned Q4. What is the meaning of “SELECT” clause in Mysql? a) Show me all Columns and rows b) Show me all columns c) Show me all rows d) None of the mentioned Q5. Can “SELECT” clause be used without the clause “FROM”? a) YES b) NO c) DEPENDS d) None of the mentioned Q6. Which clause is mandatory with clause “SELECT” in Mysql? a) FROM b) WHERE c) Both FROM and WHERE d) None of the mentioned Q7. Is there any error in executing the following MySQL command? SELECT emp_id, ‘ACTIVE’, emp_id * 3.145, UPPER (lname) FROM Employee; a) Yes b) NO c) Depends on condition d) None of the mentioned Q8. What is the need of “column Aliases” in “SELECT” clause? a) To assign a new label to the column in result set b) To overwrite the existing column name in result set c) To modify the column name while using literals, Expression, built_in functions with “SELECT clause d) All of the mentioned Q9. Which of the following table exist in Mysql? a) Permanent Tables b) Virtual tables c) Temporary tables d) All of the mentioned Q10. “CREATE VIEW …” command is used to create which type of table in Mysql? a) Permanent Tables b) Virtual tables c) Temporary tables d) All of the mentioned Q11. In the following MySQL query, “person_1” belongs to which category of table in MySQL? CREATE VIEW person_1 AS SELECT fname, lname, person_id FROM person; a) Permanent Tables b) Virtual tables c) Temporary tables d) None of the mentioned Q12. 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; a) NO b) YES c) DEPEND d) None of the mentioned Q13. What is the meaning of “GROUP BY” clause in Mysql? a) Group data by column values b) Group data by row values c) Group data by column and row values d) None of the mentioned Q14. Which clause is similar to “HAVING” clause in Mysql? a) SELECT b) WHERE c) FROM d) None of the mentioned Q15. “COUNT” keyword belongs to which categories in Mysql? a) Aggregate functions b) Operators c) Clauses d) All of the mentioned Q16. Which clause is used with an “aggregate functions”? a) GROUP BY b) SELECT c) WHERE d) Both GROUP BY and WHERE Q17 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; a) Sorting {emp_id, emp_name} b) Sorting {emp_name, emp_id} c) Sorting (emp_id} but not emp_name d) None of the mentioned Q18. Which among the following operators is/are belongs to “Inequality conditions”? a) <> b) != c) = d) Both <> and != Q19. The AUTO_INCREMENT column attribute is best used with which type? a) FLOAT b) INT c) CHARACTER d) DOUBLE Q20. AUTO_INCREMENT columns must be NOT NULL. a) True b) False
Leave a Comment