WorksheetsMySQL Mastery
Total questions: 28
Worksheet time: 11mins
What is the purpose of the CHAR data type in MySQL?
To store variable-length strings
To store date and time values
To store fixed-length strings
To store numeric values
What are the ACID properties in database transactions?
Reliability
Atomicity
Consistency
Atomicity, Consistency, Isolation, Durability
Isolation
Explain the concept of Atomicity in ACID properties.
Atomicity ensures that only some operations within a transaction are completed successfully
Atomicity guarantees that transactions can be interrupted and resumed without consequences
Atomicity allows for partial completion of operations within a transaction
Atomicity ensures that all operations within a transaction are completed successfully or none of them are, maintaining database consistency.
What is the role of Isolation in database transactions?
Isolation guarantees that transactions can see each other's changes immediately
Isolation ensures that transactions are executed sequentially
Isolation in database transactions ensures that transactions are executed independently and changes made by one transaction are not visible to others until the transaction is completed.
Isolation allows transactions to share data without restrictions
What does the Consistency property ensure in ACID transactions?
Allows for partial updates to the database
Ensures that the database remains in a valid state before and after the transaction.
Ensures that the database is always read-only
Guarantees that the transaction will always commit successfully
What is the significance of the Durable property in ACID transactions?
The Durable property impacts the consistency of transaction data.
The Durable property ensures the permanence of committed transaction effects.
The Durable property ensures the speed of transaction processing.
The Durable property guarantees the isolation of transactions.
How can you ensure data integrity in MySQL transactions?
Ignore error handling
Use MongoDB instead of MySQL
Utilize the ACID properties by structuring transactions, using locking mechanisms, handling errors, and committing or rolling back changes.
Randomly commit changes
How does MySQL handle NULL values in comparisons?
MySQL treats NULL values as equal to any other value
MySQL ignores NULL values in comparisons
MySQL considers NULL values as greater than any other value
MySQL throws an error when NULL values are encountered
What is the purpose of SQL Joins in MySQL?
SQL Joins are used to delete rows from tables in MySQL.
SQL Joins are used to create new tables in MySQL.
The purpose of SQL Joins in MySQL is to combine rows from two or more tables based on a related column between them.
SQL Joins are used to update rows in tables in MySQL.
What is the purpose of the GROUP BY clause in MySQL?
GROUP BY clause is used to delete duplicate rows in MySQL
GROUP BY clause is used to update multiple rows in MySQL
The purpose of GROUP BY clause in MySQL is to group rows that have the same values into summary rows
GROUP BY clause is used to create new tables in MySQL
A relational database can have how many types of keys in a table ?
Candidate key
Primary key
Foreign key
All of these
Which one of the following uniquely identifies the tuples/tows in a relation ?
Secondary key
Primary key
Composite key
Foreign key
What is the full form of DDL ?
Dynamic data language
Detailed data language
Data definition language
Data derivation language
SELECT is a DDL/DML command ....
DDL
DML
None of these
Both
Which of the following keywords will you use to display unique values of the column dept_name ?
SELECT ______ dept_name from COMPANY;
All
distinct
from
name
Which of the following SQL commands retrieves data from table(s)?
update
select
insert
delete
INSERT INTO EMP VALUES(101,'SUMAN','MANAGER');
Which kind of statement is this ?
DDL
DML
Value
Python statement
Total number of rows/records/horizontal arrangement in a table is called:
Degree
Records
Integer
Cardinality
Which clause is used to filter out unwanted data?
SELECT
FROM
WHERE
ORDER BY
Which SQL statement is used to delete an existing row ?
DROP
REMOVE
DELETE
UPDATE
Which statement will return different values?
SELECT UNIQUE
SELECT DISTINCT
SELECT DIFFERENT
SELECT ALL
What is the default sort order in ORDER BY clause?
Ascending
Descending
_________ statement is used to delete a table
DELETE TABLE
REMOVE TABLE
DROP TABLE
MODIFY TABLE
Which of the following is not an aggregate function?
DATE
AVG
COUNT
MAX
Which clause is used to filter out unwanted data?
SELECT
FROM
WHERE
ORDER BY
Which SQL statement is used to modify data in a database table?
MODIFY
CHANGE
ALTER
UPDATE
INSERT INTO EMP VALUES(1221, 'ABC', 'MANAGER',12323); What kind of statement is this ?
DDL
DML
DCL
TCL
(a) is used to select a database
(Type in upper case)
