Q1
Q1 What does MySQL primarily function as?
A web server
A database management system
A programming language
A browser
Q2
Q2 Which SQL statement is used to remove data from a MySQL database?
DELETE
REMOVE
CLEAR
ERASE
Q3
Q3 Which command is used to access a MySQL database via command line?
mysql -u user -p
ssh database
connect to mysql
open mysql
Q4
Q4 MySQL belongs to which category of database management systems?
Hierarchical DBMS
Network DBMS
Relational DBMS
Object-oriented DBMS
Q5
Q5 In MySQL, what does the AUTO_INCREMENT attribute automatically add to a column?
Random numbers
A timestamp
Unique identifiers incrementally
Fixed numbers
Q6
Q6 What does the following MySQL command do?
CREATE DATABASE SampleDB;
Creates a new table named SampleDB
Creates a new schema named SampleDB
Creates a new database named SampleDB
Deletes the database SampleDB
Q7
Q7 Identify the issue in the following SQL statement:
SELECT FROM users WHERE username='admin';
SELECT clause is incomplete
WHERE clause is incorrect
Syntax is correct
Missing semicolon
Q8
Q8 Which SQL clause is used to filter the records returned from a SQL query?
FROM
WHERE
SELECT
ORDER BY
Q9
Q9 SQL keywords are case sensitive.
All keywords are sensitive
Some are sensitive
None are sensitive
Depends on version
Q10
Q10 What does the DISTINCT keyword do in a SQL query?
Removes duplicates from results
Creates a distinct file
Orders results
Counts rows
Q11
Q11 What type of SQL statement is used to add new data into a database?
CREATE
SELECT
INSERT
UPDATE
Q12
Q12 What does the GROUP BY statement do in a SQL query?
Groups data based on one or more columns
Sorts the output
Deletes groups of data
Modifies data in a group
Q13
Q13 Which SQL statement is used to change data in an existing row?
INSERT
UPDATE
ALTER
CREATE
Q14
Q14 What is the default sort order of the ORDER BY statement in SQL?
Ascending
Descending
Random
Fixed
Q15
Q15 What is the result of the following SQL query?
SELECT 15 + 25;
40
'15 + 25'
15
25
Q16
Q16 Consider the following SQL command:
DELETE FROM Customers WHERE CustomerID = 3;
What does it do?
Deletes the customer record with CustomerID 3
Deletes all records from Customers
Updates CustomerID to 3
None of the above
Q17
Q17 What does the following SQL command achieve?
UPDATE Products SET Price = Price * 1.1 WHERE Category = 'Electronics';
Increases the price of all products by 10%
Decreases the price of all products by 10%
Increases the price of electronics products by 10%
None of the above
Q18
Q18 Identify the error in this SQL statement:
INSERT INTO Order (ID, Product) VALUES (101, 'Laptop');
Table name should be Orders
Syntax is correct
Missing semicolon at the end
The Product column does not exist
Q19
Q19 Which data type in MySQL is used to store boolean values?
TINYINT
SMALLINT
VARCHAR
BOOLEAN
Q20
Q20 What is the purpose of the VARCHAR data type in MySQL?
To store fixed-length strings
To store variable-length strings
To store large text objects
To store integers
Q21
Q21 Which data type would be best for storing an email address?
CHAR(50)
VARCHAR(100)
TEXT
BLOB
Q22
Q22 What is the main difference between CHAR and VARCHAR data types in MySQL?
CHAR stores binary data, VARCHAR does not
CHAR has unlimited length, VARCHAR is limited
CHAR is variable-length, VARCHAR is fixed-length
CHAR is fixed-length, VARCHAR is variable-length
Q23
Q23 In MySQL, which data type is most appropriate for storing monetary values?
DECIMAL
FLOAT
DOUBLE
INTEGER
Q24
Q24 What is the primary use of the ENUM data type in MySQL?
To store arrays
To limit input to a list of possible values
To create a queue structure
To log changes
Q25
Q25 Which SQL statement correctly creates a table with a column for storing binary data?
CREATE TABLE Files (Data CHAR(64));
CREATE TABLE Files (Data BINARY(64));
CREATE TABLE Files (Data TEXT);
CREATE TABLE Files (Data BLOB);
Q26
Q26 Consider the following SQL statement:
ALTER TABLE Employees ADD COLUMN Birthdate DATE;
What does this statement do?
Adds a new row called Birthdate
Changes the data type of Birthdate
Adds a new column Birthdate to store dates
Deletes the Birthdate column
Q27
Q27 What does the following SQL command achieve?
CREATE TABLE Orders (OrderID INT, OrderDate DATETIME DEFAULT CURRENT_TIMESTAMP);
Creates a table with two columns without defaults
Creates a table and sets a default timestamp for OrderDate
Creates a table and makes OrderDate a primary key
None of the above
Q28
Q28 What is incorrect in the following SQL statement?
CREATE TABLE Users (ID INT, Name CHAR(20), Email VARHCAR(100));
Spelling mistake in data type for Email
ID should be VARCHAR
Name should be TEXT
Syntax is correct
Q29
Q29 Identify the error in this SQL command:
CREATE TABLE Products (ProductID INT, Price DECIMAL(5));
DECIMAL definition is incomplete
Price should be an INTEGER
ProductID should be a TEXT
No error
Q30
Q30 Which SQL statement is used to read data from a database?
SELECT
INSERT
UPDATE
DELETE