Edu
Hub
Courses
AI Tools
Leaderboard
Login/Register
AR
Abdullah Rashid
abdullah@example.com
Navigation
📚
Courses
🏆
Leaderboard
✨
AI Tools
←
MySQL Mastery: Medium Level
⏱
15:00
Quit
0 / 20 answered
0%
MySQL Mastery: Medium Level
10 questions · Medium difficulty · 00:20:00 min
🔥 In Progress
Question 1
Which SQL clause is used to filter rows after aggregation in a GROUP BY query?
FILTER
HAVING
ORDER BY
WHERE
Question 2
What is the purpose of the EXPLAIN statement in MySQL?
To display the execution plan of a query
To explain the syntax of a query
To create an index
To execute a query and show results
Question 3
Which join returns all rows when there is a match in one of the tables?
INNER JOIN
RIGHT JOIN
FULL OUTER JOIN
LEFT JOIN
Question 4
Which of the following is used to avoid duplicate rows in a SELECT result?
UNIQUE
EXCLUSIVE
DISTINCT
DIFFERENT
Question 5
What does the following SQL do? CREATE INDEX idx_name ON table (column);
Creates a primary key
Creates a unique constraint
Creates a foreign key
Creates an index for faster searches
Question 6
Which of the following is the correct order of clauses in a SELECT statement?
SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY
SELECT, FROM, WHERE, HAVING, GROUP BY, ORDER BY
FROM, SELECT, WHERE, GROUP BY, HAVING, ORDER BY
SELECT, FROM, GROUP BY, WHERE, HAVING, ORDER BY
Question 7
What is the default storage engine in MySQL (as of version 8.0)?
Archive
InnoDB
Memory
MyISAM
Question 8
Which SQL function returns the number of characters in a string?
CHAR_LENGTH()
COUNT()
SIZE()
LENGTH()
Question 9
What is the difference between CHAR and VARCHAR data types?
Both are variable-length
Both are fixed-length
CHAR is variable-length, VARCHAR is fixed-length
CHAR is fixed-length, VARCHAR is variable-length
Question 10
Which of the following is used to add a new column to an existing table?
ALTER TABLE ... ADD COLUMN
INSERT TABLE ... ADD COLUMN
UPDATE TABLE ... ADD COLUMN
MODIFY TABLE ... ADD COLUMN
Question 11
What does the following query return? SELECT COUNT(*) FROM table;
Sum of all values in the table
Number of non-null values in all columns
Average of all values
Total number of rows in the table
Question 12
Which of the following is a valid way to delete all rows from a table without removing the table structure?
DELETE FROM table;
DROP TABLE table;
Both A and B are correct
TRUNCATE TABLE table;
Question 13
What is the purpose of the ON DELETE CASCADE constraint?
It updates child rows when parent is deleted
It deletes the parent row when a child row is deleted
It deletes child rows when the parent row is deleted
It prevents deletion of parent rows
Question 14
Which SQL statement is used to create a new database?
MAKE DATABASE
CREATE DATABASE
ADD DATABASE
NEW DATABASE
Question 15
What does the IN operator do?
Checks if a value matches any value in a list
Checks if a value is within a range
Checks if a value exists in a subquery
Checks if a value is NULL
Question 16
Which clause is used to sort the result set?
GROUP BY
SORT BY
ORDER BY
ARRANGE BY
Question 17
What is a subquery?
A query nested inside another query
A query that returns multiple rows
A query that uses the UNION operator
A query that is executed before the main query
Question 18
Which of the following is true about indexes in MySQL?
They speed up INSERT operations
They are automatically created on all columns
They can speed up search queries but slow down writes
They slow down SELECT queries
Question 19
What is the result of SELECT NULL = NULL?
NULL
FALSE
Error
TRUE
Question 20
Which of the following SQL commands is used to change data in an existing row?
UPDATE
ALTER
CHANGE
MODIFY
✅ Answered:
0
⬜ Unanswered:
8
📊
20%
done
Submit Answers →