MySQL Database Quiz Questions

Course Name:MySQL
Chapter Name:Chapter 8 - RDBMS Concepts
Lesson Content Link:What is RDBMS
Current Quiz Count:30
Progress
0%
Q1
True / False

MySQL is an example of a Relational Database Management System (RDBMS).

Q2
True / False

In MySQL, data is stored in tables that can relate to each other using foreign keys.

Q3
True / False

MySQL does not support the SQL language for database management.

Q4
True / False

In MySQL, normalization is a process used to reduce data redundancy

Q5
True / False

MySQL does not provide ACID (Atomicity, Consistency, Isolation, Durability) properties.

Q6
True / False

In MySQL, a schema is a collection of database objects, including tables, views, and procedures.

Q7
True / False

In MySQL, indexing a column improves the speed of data retrieval operations

Q8
True / False

MySQL uses the concept of foreign key constraints to enforce referential integrity.

Q9
True / False

MySQL can handle only a limited number of transactions at a time.

Q10
True / False

MySQL supports the use of triggers to automatically perform actions in response to certain events in the database.

Q11
Single Choice

What does RDBMS stand for?

Q12
Single Choice

Which of the following is a key feature of an RDBMS like MySQL?

Q13
Single Choice

In MySQL, which SQL keyword is used to create a new table in an RDBMS?

Q14
Single Choice

Which SQL command is used to retrieve data from a MySQL RDBMS?

Q15
Single Choice

In MySQL RDBMS, which constraint ensures that a column must contain a unique value?

Q16
Single Choice

What is the purpose of a primary key in a MySQL RDBMS?

Q17
Single Choice

In a MySQL RDBMS, what is a foreign key used for?

Q18
Single Choice

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

Q19
Single Choice

What is a transaction in the context of a MySQL RDBMS?

Q20
Single Choice

In a MySQL RDBMS, which property of a transaction ensures that once a transaction is committed, it will remain so, even in the event of a system failure?

Q21
Multiple Choice

Which of the following SQL statements correctly creates a table named 'students' with 'id' as the primary key in an RDBMS?

SQL Code
CREATE TABLE students (
 id INT AUTO_INCREMENT,
 name VARCHAR(100),
 age INT,
 PRIMARY KEY (id)
);
Q22
Multiple Choice

Identify the correct SQL code that inserts a record into a table named 'employees' ensuring referential integrity.

SQL Code
INSERT INTO employees (id, name, department_id)
VALUES (1, 'John Doe', 3);
INSERT INTO departments (id, name)
VALUES (3, 'Sales');
Q23
Multiple Choice

Choose the SQL code snippet that correctly creates a foreign key constraint between two tables in an RDBMS.

SQL Code
CREATE TABLE orders (
 order_id INT AUTO_INCREMENT,
 customer_id INT,
 PRIMARY KEY (order_id),
 FOREIGN KEY (customer_id) REFERENCES customers(id)
);
Q24
Multiple Choice

Which of the following SQL statements would correctly normalize data by separating it into related tables?

SQL Code
CREATE TABLE students (
 id INT AUTO_INCREMENT,
 name VARCHAR(100),
 address VARCHAR(255),
 PRIMARY KEY (id)
);
CREATE TABLE addresses (
 address_id INT AUTO_INCREMENT,
 address VARCHAR(255),
 PRIMARY KEY (address_id)
);
Q25
Multiple Choice

Select the SQL code that effectively ensures data integrity using constraints in an RDBMS.

SQL Code
CREATE TABLE employees (
 id INT AUTO_INCREMENT,
 name VARCHAR(100),
 department_id INT,
 PRIMARY KEY (id),
 FOREIGN KEY (department_id) REFERENCES departments(id)
);
CREATE TABLE departments (
 id INT AUTO_INCREMENT,
 name VARCHAR(100),
 PRIMARY KEY (id)
);
Q26
Multiple Choice

Which SQL code ensures the atomicity of transactions in an RDBMS by rolling back on failure?

SQL Code
START TRANSACTION;
INSERT INTO employees (id, name, department_id)
VALUES (5, 'Tom Holland', 2);
INSERT INTO salaries (employee_id, salary)
VALUES (5, 70000);
COMMIT;
Q27
Multiple Choice

Identify the SQL code that demonstrates the use of indexes to improve query performance in an RDBMS.

SQL Code
CREATE INDEX idx_employee_name
ON employees (name);
SELECT * FROM employees
WHERE name = 'John Doe';
Q28
Multiple Choice

Choose the SQL code snippet that correctly implements data redundancy reduction using normalization.

SQL Code
CREATE TABLE students (
 id INT AUTO_INCREMENT,
 name VARCHAR(100),
 class_id INT,
 PRIMARY KEY (id)
);
CREATE TABLE classes (
 id INT AUTO_INCREMENT,
 class_name VARCHAR(100),
 PRIMARY KEY (id)
);
Q29
Multiple Choice

What SQL code would you use to enforce unique constraints on a table to prevent duplicate data entries?

SQL Code
CREATE TABLE students (
 id INT AUTO_INCREMENT,
 name VARCHAR(100),
 email VARCHAR(100),
 UNIQUE (email),
 PRIMARY KEY (id)
);
Q30
Multiple Choice

Which SQL code correctly sets up a relational database structure for an e-commerce application?

SQL Code
CREATE TABLE products (
 id INT AUTO_INCREMENT,
 name VARCHAR(100),
 price DECIMAL(10, 2),
 PRIMARY KEY (id)
);
CREATE TABLE orders (
 id INT AUTO_INCREMENT,
 product_id INT,
 quantity INT,
 PRIMARY KEY (id),
 FOREIGN KEY (product_id) REFERENCES products(id)
);