Purpose of MySQL
Which statement best describes MySQL?
- A relational database management system
- A data visualization tool
- A web browser extension
- An operating system
- A blockchain technology
Data Types
Which of the following is NOT a valid data type in MySQL?
- NUMBER
- VARCHAR
- DATE
- TEXT
- FLOAT
Primary Key
What is the main purpose of a primary key in a database table?
- To uniquely identify each record in the table
- To increase query speed
- To encrypt the data in the table
- To allow duplicate records
- To create foreign keys in other tables
Foreign Key
What does a foreign key in a table establish?
- A link between two tables based on a shared column
- A way to avoid duplicate rows
- A hidden column in the table
- A method for sorting data
- A shortcut to accessing the database
CHAR vs VARCHAR
What is the main difference between CHAR and VARCHAR data types?
- CHAR has fixed length, VARCHAR has variable length
- CHAR is used for numbers only
- VARCHAR can store only dates
- CHAR types can store only lowercase letters
- VARCHAR automatically encrypts data
AUTO_INCREMENT Feature
What does the AUTO_INCREMENT attribute do in MySQL tables?
- Automatically increases the value of a numeric column with each new row
- Decreases the value of a column with every update
- Encrypts the column as data is added
- Prevents NULL values in the column
- Automatically creates an index on the column
JOIN Clause
What is the main purpose of the JOIN clause in SQL?
- To combine data from two or more tables based on a related column
- To permanently delete a table
- To reorder table rows alphabetically
- To encrypt selected columns
- To backup the entire database
INNER JOIN
What does the INNER JOIN clause return?
- Rows with matching values in both tables
- All rows from the left table
- All rows from the right table
- Rows with only NULL values
- Random rows from both tables
GROUP BY Use
Why would you use the GROUP BY clause in a SQL query?
- To arrange identical data into summary rows
- To delete duplicate rows
- To filter out NULL values
- To automatically increase column values
- To restrict users from accessing the table
UNION vs UNION ALL
What is the primary difference between UNION and UNION ALL in SQL?
- UNION removes duplicate records; UNION ALL includes duplicates
- UNION ALL sorts data automatically
- UNION encrypts the results
- UNION can only be used with one table
- There is no difference; both work identically