MySQL Database Quiz Questions

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

In MySQL, a business key is always the primary key of a table.

Q2
True / False

In MySQL, a natural key is a key that is derived from application data.

Q3
True / False

In MySQL, a candidate key can be composed of more than one column.

Q4
True / False

In MySQL, every natural key is a candidate key.

Q5
True / False

In MySQL, business keys are typically generated by the database system.

Q6
True / False

In MySQL, a candidate key must always be a numeric column.

Q7
True / False

In MySQL, a surrogate key is always a candidate key.

Q8
True / False

In MySQL, a table can have multiple candidate keys but only one business key.

Q9
True / False

In MySQL, a natural key can sometimes change, which can complicate database management.

Q10
True / False

In MySQL, it is possible for a single table to have no natural key but still have a candidate key.

Q11
Single Choice

What is a business key in MySQL?

Q12
Single Choice

Which of the following best describes a natural key in MySQL?

Q13
Single Choice

In MySQL, which of the following can be considered a candidate key?

Q14
Single Choice

How does MySQL ensure the uniqueness of a business key?

Q15
Single Choice

What is the main difference between a natural key and a surrogate key in MySQL?

Q16
Single Choice

Which of the following is true about candidate keys in MySQL?

Q17
Single Choice

In MySQL, what happens if a natural key in a table needs to be updated?

Q18
Single Choice

Why might a business choose to use a surrogate key instead of a natural key in MySQL?

Q19
Single Choice

Which of the following MySQL constraints can be used to enforce the uniqueness of a candidate key?

Q20
Single Choice

During a MySQL database design certification exam, you're asked to design a table for storing product information. Which of the following keys would you choose as the primary key if the product codes are guaranteed to be unique and never change?

Q21
Multiple Choice

Which SQL statement demonstrates the creation of a candidate key in a table design?

SQL Code
CREATE TABLE employees (
 employee_id INT PRIMARY KEY,
 email VARCHAR(100) UNIQUE,
 social_security_number VARCHAR(11) UNIQUE
);
Q22
Multiple Choice

Which SQL code snippet correctly defines a natural key in a 'products' table?

SQL Code
CREATE TABLE products (
 product_code VARCHAR(10) PRIMARY KEY,
 product_name VARCHAR(100)
);
Q23
Multiple Choice

Which SQL statement demonstrates the use of a business key in a table design?

SQL Code
CREATE TABLE orders (
 order_number VARCHAR(20) PRIMARY KEY,
 customer_id INT,
 order_date DATE
);
Q24
Multiple Choice

Which SQL code correctly defines multiple candidate keys in a 'customers' table?

SQL Code
CREATE TABLE customers (
 customer_id INT PRIMARY KEY,
 email VARCHAR(100) UNIQUE,
 phone_number VARCHAR(15) UNIQUE
);
Q25
Multiple Choice

Which SQL snippet best illustrates a table design using a natural key as the primary key?

SQL Code
CREATE TABLE countries (
 country_code CHAR(3) PRIMARY KEY,
 country_name VARCHAR(100)
);
Q26
Multiple Choice

Which SQL code demonstrates the use of a business key as a natural key in a table design?

SQL Code
CREATE TABLE employees (
 employee_number VARCHAR(10) PRIMARY KEY,
 employee_name VARCHAR(100)
);
Q27
Multiple Choice

Which SQL statement correctly illustrates the concept of a candidate key by defining multiple unique keys in a table?

SQL Code
CREATE TABLE users (
 user_id INT PRIMARY KEY,
 username VARCHAR(50) UNIQUE,
 email VARCHAR(100) UNIQUE
);
Q28
Multiple Choice

Which SQL code best demonstrates the use of a natural key and a surrogate key in a single table?

SQL Code
CREATE TABLE employees (
 employee_id INT AUTO_INCREMENT PRIMARY KEY,
 social_security_number VARCHAR(11) UNIQUE,
 employee_name VARCHAR(100)
);
Q29
Multiple Choice

Which SQL statement properly defines a business key, natural key, and candidate key in a 'suppliers' table?

SQL Code
CREATE TABLE suppliers (
 supplier_id INT PRIMARY KEY,
 supplier_code VARCHAR(10) UNIQUE,
 supplier_name VARCHAR(100)
);
Q30
Multiple Choice

Which SQL code demonstrates the creation of a table with both a business key and a candidate key, ensuring data integrity?

SQL Code
CREATE TABLE vehicles (
 vehicle_id INT PRIMARY KEY,
 vin VARCHAR(17) UNIQUE,
 license_plate VARCHAR(10) UNIQUE
);