MySQL Multiple Choice Questions on “The from Clauses”.
1. What is the use of “VIEW” in Mysql?
a) To hide columns from the users
b) To hide the complexity of the database
c) To simplify complexity of database design
d) All of the mentioned
Answer: d
Clarification: None.
2. 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
Answer: a
Clarification: There will be no error in the query, as table name “employee” is replaced by ‘e’ and table name “department” is replaced by‘d’.
3. Is there any error in the following MySQL statement?
SELECT e.emp_id, e.fname,e.lname,d.name FROM employee AS e INNER JOIN department AS d ON e.dept_id=e.dept_id;
a) NO
b) YES
c) DEPEND
d) None of the mentioned
Answer: a
Clarification: There will be no error in the query, as table name “employee” is replaced by ‘e’ and table name “department” is replaced by ‘d’ by using “AS” keyword.
4. What will be the output of the following MySQL statement “true AND Null”?
a) True
b) Null
c) Depend
d) None of the mentioned
Answer: b
Clarification: None.
5. What will be the output of the following MySQL statement “false AND Null”?
a) False
b) Null
c) Depend
d) None of the mentioned
Answer: b
Clarification: None.
6. What will be the output of the following MySQL statement “Null AND Null”?
a) True
b) Null
c) False
d) None of the mentioned
Answer: b
Clarification: None.
7. What will be the output of the following MySQL statement “true OR Null”?
a) True
b) Null
c) False
d) None of the mentioned
Answer: a
Clarification: None.
8. What will be the output of the following MySQL statement “false OR Null”?
a) True
b) Null
c) False
d) None of the mentioned
Answer: b
Clarification: None.
9. What will be the output of the following MySQL statement “Null OR Null”?
a) True
b) Null
c) False
d) None of the mentioned
Answer: b
Clarification: None.
10. What will be the output of the following MySQL statement “NOT (Null)”?
a) True
b) Null
c) False
d) None of the mentioned
Answer: b
