Test your foundational knowledge of MySQL with this 15-question quiz, covering key terms, common SQL statements, data types, schema design, and basic data manipulation. Ideal for interview preparation or beginners wanting to learn core MySQL concepts.
Which statement best describes MySQL?
Explanation: The correct answer is that MySQL is an open-source relational database management system, commonly used to manage and query structured data with SQL. It is not a spreadsheet tool like option B, nor is it a programming language as suggested in option C. Option D is incorrect because MySQL is not an operating system.
What is the main purpose of SQL in MySQL?
Explanation: SQL is used for querying and managing data within databases, which is the correct function in MySQL. Options A and D refer to unrelated activities like creating images or diagrams. Option B is incorrect because SQL does not handle website templates.
How does SQL differ from MySQL?
Explanation: SQL is the language used to interact with databases, while MySQL is the system that stores and manages the data using SQL. The other options describe incorrect relationships or unrelated tools, such as hardware devices or web tools.
Which of the following is a feature commonly supported by MySQL?
Explanation: MySQL supports ACID transactions, helping to ensure data reliability and integrity. The other options refer to media creation or editing, which are not within the scope of database management systems like MySQL.
What does a database schema define in MySQL?
Explanation: A database schema organizes how data is structured, including tables and relationships. Options A, C, and D address appearance, performance, or hardware requirements, none of which are defined by the schema.
Which is NOT a data type supported by MySQL?
Explanation: MySQL supports various data types like VARCHAR, DECIMAL, and TIMESTAMP, but 'PICTURE' is not a valid data type. The other choices are standard types for strings, numbers, and dates.
What is a key difference between the CHAR and VARCHAR data types in MySQL?
Explanation: CHAR pads data to a fixed length, while VARCHAR only uses the needed space. Option A reverses their behavior and option C falsely claims CHAR supports only numbers. Option D is inaccurate; either can be used for many text fields.
What is the general maximum length allowed for a VARCHAR column in MySQL?
Explanation: In most cases, MySQL allows VARCHAR columns up to 65,535 characters. The other options provide limits that are either too small, like 16 or 255, or not standard, like 2,048.
How do the INT and BIGINT data types differ in MySQL?
Explanation: INT supports smaller integer ranges compared to BIGINT, which can store much larger values. BIGINT is not for text or dates specifically, and it generally uses more, not less, storage than INT. Option A incorrectly states their data type functionality.
What does the ENUM data type allow you to do in MySQL?
Explanation: ENUM restricts entries to predefined options, improving data integrity. Options B and C relate to formats or encryption, which ENUM does not handle. Option D refers to foreign keys, not ENUM.
Which command is used to create a new table in MySQL?
Explanation: The 'CREATE TABLE' command defines a new table. 'MAKE NEW' and 'ADD DATABASE' do not work in MySQL. 'START SCHEMA' incorrectly suggests beginning a schema, which is not a command.
What is the main function of a PRIMARY KEY in a MySQL table?
Explanation: A PRIMARY KEY uniquely marks each row and prevents duplicates or nulls. It does not affect how data is displayed, automate backups, or manage graphics.
Which statement adds a new column to an existing MySQL table?
Explanation: ALTER TABLE with ADD COLUMN correctly adds new columns. The other statements either confuse table creation, insertion, or use incorrect syntax that MySQL does not recognize.
What is the difference between the DROP and TRUNCATE commands in MySQL?
Explanation: DROP removes everything—data and structure. TRUNCATE deletes just the rows while keeping the table for future use. The other options describe false information or oversimplify the differences.
Which SQL statement retrieves all columns from a table named 'employees'?
Explanation: The correct command is 'SELECT * FROM employees;'. The other options use incorrect syntax or unsupported keywords that are not valid in SQL.