My Report

MySQL Practice Test 10


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. Consider a database name “Sanfoundry” whose attributes are intern_id (primary key), subject.
Intern_id = {1, 2, 3, 4, 5, 6}
Subject = {sql, oop, sql, oop, c, c++}
If these are one to one relation then what will be the output of the following MySQL statement?

SELECT intern_id
FROM sanfoundry
Where subject IN (c, c++, oop);

2. What will be the output of the following MySQL statement?

SELECT *
FROM employee
WHERE lname LIKE ‘F%’ AND lname LIKE ‘%T’;

3. The following MySQL statement belongs to which “Condition Types”?

SELECT emp_id, fname, lname
FROM account
WHERE start_date<’2007-10-08’;

4. What is the meaning of “Range Conditions”?

5. Consider a database name “Sanfoundry” whose attributes are intern_id (primary key), subject.
Intern_id = {1, 2, 3, 4, 5, 6}
Subject = {sql, oop, sql, oop, c, c++}
If these are one to one relation then what will be the output of the following MySQL statement?

SELECT intern_id
FROM sanfoundry
Where subject NOT IN (c, c++, oop);

6. 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;

7. 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;

8. Which among the following data types can be used with “Range Condition”?

9. What will be the output of the following MySQL command?

SELECT *
FROM employee
WHERE (title=’HEAD TELLER’) OR (start_date=2013-01-24);

10. What will be the output of the following MySQL command?

SELECT *
FROM employee
WHERE (title=’HEAD TELLER’) AND (start_date=2013-01-24);

 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.