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?
WHERE
ORDER BY
HAVING
FILTER
Question 2
What is the purpose of the EXPLAIN statement in MySQL?
To explain the syntax of a query
To display the execution plan 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?
RIGHT JOIN
FULL OUTER JOIN
LEFT JOIN
INNER JOIN
Question 4
Which of the following is used to avoid duplicate rows in a SELECT result?
DIFFERENT
EXCLUSIVE
UNIQUE
DISTINCT
Question 5
What does the following SQL do? CREATE INDEX idx_name ON table (column);
Creates a unique constraint
Creates an index for faster searches
Creates a foreign key
Creates a primary key
Question 6
Which of the following is the correct order of clauses in a SELECT statement?
SELECT, FROM, GROUP BY, WHERE, HAVING, ORDER BY
SELECT, FROM, WHERE, HAVING, GROUP BY, ORDER BY
FROM, SELECT, WHERE, GROUP BY, HAVING, ORDER BY
SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY
Question 7
What is the default storage engine in MySQL (as of version 8.0)?
InnoDB
Archive
MyISAM
Memory
Question 8
Which SQL function returns the number of characters in a string?
SIZE()
CHAR_LENGTH()
COUNT()
LENGTH()
Question 9
What is the difference between CHAR and VARCHAR data types?
Both are fixed-length
Both are variable-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?
UPDATE TABLE ... ADD COLUMN
INSERT TABLE ... ADD COLUMN
MODIFY TABLE ... ADD COLUMN
ALTER TABLE ... ADD COLUMN
Question 11
What does the following query return? SELECT COUNT(*) FROM table;
Average of all values
Sum of all values in the table
Total number of rows in the table
Number of non-null values in all columns
Question 12
Which of the following is a valid way to delete all rows from a table without removing the table structure?
TRUNCATE TABLE table;
DELETE FROM table;
DROP TABLE table;
Both A and B are correct
Question 13
What is the purpose of the ON DELETE CASCADE constraint?
It deletes child rows when the parent row is deleted
It deletes the parent row when a child row is deleted
It prevents deletion of parent rows
It updates child rows when parent is deleted
Question 14
Which SQL statement is used to create a new database?
ADD DATABASE
MAKE DATABASE
NEW DATABASE
CREATE DATABASE
Question 15
What does the IN operator do?
Checks if a value is NULL
Checks if a value matches any value in a list
Checks if a value exists in a subquery
Checks if a value is within a range
Question 16
Which clause is used to sort the result set?
ARRANGE BY
GROUP BY
SORT BY
ORDER BY
Question 17
What is a subquery?
A query that returns multiple rows
A query nested inside another query
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 are automatically created on all columns
They slow down SELECT queries
They speed up INSERT operations
They can speed up search queries but slow down writes
Question 19
What is the result of SELECT NULL = NULL?
FALSE
TRUE
NULL
Error
Question 20
Which of the following SQL commands is used to change data in an existing row?
UPDATE
MODIFY
CHANGE
ALTER
✅ Answered:
0
⬜ Unanswered:
8
📊
20%
done
Submit Answers →