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

Question 1 of 10

Question 2 of 10

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

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

Question 2 of 10

Question 3 of 10

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

Question 3 of 10

Question 4 of 10

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

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

Question 4 of 10

Question 5 of 10

5. What will be the result of the following MySQL command?

WHERE TITLE=’teller’ OR start_date=’2007-01-01’

Question 5 of 10

Question 6 of 10

6. Which operator is used to check the expression is not “NULL”?

Question 6 of 10

Question 7 of 10

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

SELECT *
FROM employee
WHERE lname LIKE ‘_a%e%’;

Question 7 of 10

Question 8 of 10

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

Question 8 of 10

Question 9 of 10

9. 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++);

Question 9 of 10

Question 10 of 10

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

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.