MySQL Database Quiz Questions

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

MySQL is typically used to store structured data.

Q2
True / False

Unstructured data cannot be stored in a MySQL database.

Q3
True / False

JSON data, which is semi-structured, can be stored and queried within MySQL.

Q4
True / False

MySQL's performance is the same for structured and unstructured data.

Q5
True / False

MySQL does not support full-text search capabilities for unstructured data.

Q6
True / False

Relational databases like MySQL are generally better for OLTP (Online Transaction Processing) systems which typically involve structured data.

Q7
True / False

MySQL can natively handle both structured and unstructured data equally well without any performance tuning.

Q8
True / False

In MySQL, indexing is equally effective for both structured and unstructured data.

Q9
True / False

MySQL's InnoDB storage engine supports storing large binary objects (BLOBs) which can be used for unstructured data.

Q10
True / False

In MySQL 8.0, the JSON data type provides a more efficient way to handle unstructured data compared to using BLOB or TEXT data types.

Q11
Single Choice

What does an ERD (Entity-Relationship Diagram) primarily represent in a MySQL database?

Q12
Single Choice

In MySQL, which of the following best describes structured data?

Q13
Single Choice

Which tool is commonly used to create an ERD for a MySQL database?

Q14
Single Choice

What type of relationship in an ERD is used to denote that one entity can be related to many instances of another entity in MySQL?

Q15
Single Choice

In MySQL, what is an example of unstructured data?

Q16
Single Choice

Which MySQL storage engine is best suited for handling unstructured data?

Q17
Single Choice

How can MySQL handle full-text searches in unstructured data?

Q18
Single Choice

When modeling an ERD for a MySQL database, how can we represent unstructured data within an entity?

Q19
Single Choice

Which MySQL function is specifically useful for extracting information from JSON documents stored in a table?

Q20
Single Choice

In the context of MySQL, what is a significant challenge when dealing with unstructured data compared to structured data?

Q21
Multiple Choice

Identify the correct SQL statement to store structured data in a relational table.

SQL Code
CREATE TABLE employees (
 id INT AUTO_INCREMENT PRIMARY KEY,
 name VARCHAR(100) NOT NULL,
 department VARCHAR(50),
 salary DECIMAL(10,2)
);
Q22
Multiple Choice

Choose the correct SQL statement to store unstructured data like JSON in a relational table.

SQL Code
CREATE TABLE documents (
 id INT AUTO_INCREMENT PRIMARY KEY,
 document_name VARCHAR(100) NOT NULL,
 content JSON
);
Q23
Multiple Choice

Determine the correct SQL statement to query structured data from a relational table.

SQL Code
SELECT name, department, salary
FROM employees
WHERE department = 'Sales';
Q24
Multiple Choice

Which SQL statement correctly queries unstructured JSON data stored in a relational table?

SQL Code
SELECT document_name, JSON_UNQUOTE(JSON_EXTRACT(content, '$.author')) AS author
FROM documents
WHERE JSON_CONTAINS(content, '"MySQL"', '$.tags');
Q25
Multiple Choice

Select the correct SQL statement to modify a structured column to store unstructured data using JSON.

SQL Code
ALTER TABLE customers
MODIFY COLUMN preferences JSON;
Q26
Multiple Choice

Determine the correct SQL statement to combine structured and unstructured data in a single query.

SQL Code
SELECT e.name, e.department, JSON_UNQUOTE(JSON_EXTRACT(d.content, '$.document_type')) AS document_type
FROM employees e
JOIN documents d ON e.id = d.employee_id
WHERE e.department = 'HR';
Q27
Multiple Choice

Which SQL statement correctly creates a table designed to store both structured and unstructured data?

SQL Code
CREATE TABLE mixed_data (
 id INT AUTO_INCREMENT PRIMARY KEY,
 title VARCHAR(100) NOT NULL,
 metadata JSON,
 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Q28
Multiple Choice

Identify the correct SQL statement to extract a value from a JSON field and cast it to a specific data type.

SQL Code
SELECT JSON_EXTRACT(content, '$.price') + 0 AS price
FROM products;
Q29
Multiple Choice

Select the correct SQL statement to update a structured field based on the value of an unstructured JSON field.

SQL Code
UPDATE employees e
JOIN documents d ON e.id = d.employee_id
SET e.department = JSON_UNQUOTE(JSON_EXTRACT(d.content, '$.department'))
WHERE e.id = 1;
Q30
Multiple Choice

Determine the correct SQL statement to insert structured data with an embedded unstructured JSON field.

SQL Code
INSERT INTO user_data (user_id, name, preferences)
VALUES (1, 'John Doe', '{"theme": "dark", "notifications": true}');