MySQL Database Quiz Questions

Course Name:MySQL
Chapter Name:Chapter 3 - Database Tables, Columns and Rows
Lesson Content Link:SQL
Current Quiz Count:30
Progress
0%
Q1
True / False

SQL stands for Structured Query Language.

Q2
True / False

In MySQL, SQL can be used to create databases.

Q3
True / False

SQL is case-sensitive in MySQL.

Q4
True / False

In MySQL, the SELECT statement is used to delete data from a table.

Q5
True / False

MySQL allows the use of SQL to perform transactions.

Q6
True / False

The JOIN operation in MySQL SQL is used to combine data from multiple tables.

Q7
True / False

MySQL supports SQL subqueries, which are queries nested inside another query.

Q8
True / False

In MySQL, SQL views can be used to simplify complex queries and improve performance.

Q9
True / False

MySQL supports all ANSI SQL standard features.

Q10
True / False

The GRANT statement in MySQL SQL is used to manage user permissions.

Q11
Single Choice

What does SQL stand for?

Q12
Single Choice

Which SQL statement is used to retrieve data from a MySQL database?

Q13
Single Choice

In MySQL, which SQL statement is used to add new records to a table?

Q14
Single Choice

Which clause in MySQL SQL is used to filter records?

Q15
Single Choice

In MySQL, which SQL function is used to count the number of rows in a result set?

Q16
Single Choice

Which MySQL SQL statement is used to modify existing records in a table?

Q17
Single Choice

In MySQL, which SQL keyword is used to combine rows from two or more tables, based on a related column?

Q18
Single Choice

Which MySQL SQL clause is used to group rows that have the same values in specified columns into summary rows?

Q19
Single Choice

In MySQL, which SQL clause is used to specify the search condition for groups?

Q20
Single Choice

Which MySQL SQL command is used to create a new table in a database?

Q21
Multiple Choice

Which of the following SQL statements correctly creates a new table named 'employees' with appropriate columns?

SQL Code
CREATE TABLE employees (
 employee_id INT AUTO_INCREMENT,
 first_name VARCHAR(50),
 last_name VARCHAR(50),
 hire_date DATE,
 PRIMARY KEY (employee_id)
);
Q22
Multiple Choice

Identify the correct SQL statement(s) that add a new column 'email' of type VARCHAR(100) to the 'customers' table.

SQL Code
ALTER TABLE customers
ADD COLUMN email VARCHAR(100);
Q23
Multiple Choice

Which SQL code correctly deletes rows where the 'status' column is NULL in the 'orders' table?

SQL Code
DELETE FROM orders
WHERE status IS NULL;
Q24
Multiple Choice

Determine the correct SQL query that retrieves all unique values from the 'category' column in the 'products' table.

SQL Code
SELECT DISTINCT category
FROM products;
Q25
Multiple Choice

Identify the SQL statement that correctly modifies the 'price' column in the 'items' table to increase its precision.

SQL Code
ALTER TABLE items
MODIFY COLUMN price DECIMAL(10, 2);
Q26
Multiple Choice

Which of the following queries will correctly join the 'customers' table with the 'orders' table on their respective 'customer_id' columns?

SQL Code
SELECT customers.customer_id,
 customers.name,
 orders.order_id,
 orders.order_date
FROM customers
JOIN orders ON customers.customer_id = orders.customer_id;
Q27
Multiple Choice

Choose the correct SQL statements that create an index on the 'email' column in the 'users' table.

SQL Code
CREATE INDEX idx_email
ON users (email);
Q28
Multiple Choice

Determine the correct SQL statements that update multiple columns in the 'sales' table.

SQL Code
UPDATE sales
SET total_price = 100,
 discount = 10
WHERE sale_id = 1;
Q29
Multiple Choice

Which SQL statements correctly create a composite key on the 'order_id' and 'product_id' columns in the 'order_items' table?

SQL Code
CREATE TABLE order_items (
 order_id INT,
 product_id INT,
 quantity INT,
 PRIMARY KEY (order_id, product_id)
);
Q30
Multiple Choice

Identify the SQL statement that adds a NOT NULL constraint to the 'phone' column in the 'contacts' table.

SQL Code
ALTER TABLE contacts
MODIFY COLUMN phone VARCHAR(15) NOT NULL;