My Report

MySQL Mock 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
 10%

Question 1 of 10

1. 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 statement?

SELECT emp_id
FROM person
ORDER BY emp_id;

Question 1 of 10

Question 2 of 10

2. The following MySQL statement belongs to which condition types?

SELECT fname
FROM person
WHERE dept_id= (SELECT dept_id FROM department WHERE names=’s’);

Question 2 of 10

Question 3 of 10

3. Is there any error in the following MySQL command?

SELECT emp_id, title, start_date, fname, fed_id
FROM person
ORDER BY RIGHT (fed_id, 3);

Question 3 of 10

Question 4 of 10

4. Find the missing clause from the following SQL statement?

CREATE VIEW person_1 AS
SELECT fname, lname, person_id
_________person;

Question 4 of 10

Question 5 of 10

5. What is the meaning of “ORDER BY” clause in Mysql?

Question 5 of 10

Question 6 of 10

6. Which of the following statements is/are correct?

Question 6 of 10

Question 7 of 10

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

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

Question 7 of 10

Question 8 of 10

8. Consider a database name “Sanfoundry” whose attributes are intern_id (primary key), subject, subject_value.
Intern_id = {1, 2, 3, 4, 5, 6}
Subject = {sql, oop, sql, oop, c, c++}
Subject_value = {0, 0, 1, 1, 2, 2, 3, 3}
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 (SELECT subject FROM sanfoundry WHERE subject_value IN (3, 2));

Question 8 of 10

Question 9 of 10

9. Consider a database name “Sanfoundry” whose attributes are intern_id (primary key), subject, subject_value.
Intern_id = {1, 2, 3, 4, 5, 6}
Subject = {sql, oop, sql, oop, c, c++}
Subject_value = {0, 0, 1, 1, 2, 2, 3, 3}
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 (SELECT subject FROM sanfoundry WHERE subject_value = 3);

Question 9 of 10

Question 10 of 10

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

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

Question 10 of 10


 

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.