Q91
Q91 Spot the error in this SQL statement:
CREATE VIEW SalesSummary AS SELECT ProductID, SUM(Quantity) FROM Sales GROUP BY ProductID HAVING SUM(Quantity) > 100;
Missing alias for SUM(Quantity)
Syntax is correct
HAVING clause is unnecessary
Grouping by ProductID is not allowed
Q92
Q92 What is a transaction in database management?
A group of SQL queries executed individually
A group of SQL queries executed as a single unit of work
A single SQL query
A schema in the database
Q93
Q93 Which statement is used to start a transaction in MySQL?
BEGIN TRANSACTION
START TRANSACTION
INITIATE TRANSACTION
BEGIN
Q94
Q94 What does the COMMIT statement do?
Reverts the current transaction
Starts a new transaction
Saves the changes made by the current transaction
Checks the integrity of the transaction
Q95
Q95 What is the role of the ROLLBACK statement in a transaction?
To duplicate the transaction
To save the transaction
To undo the transaction if an error occurs
To start over the database connection
Q96
Q96 In which case would you use the SAVEPOINT statement in a transaction?
To save the transaction to disk
To mark a specific point within a transaction to which you later might rollback
To split the transaction
To end the transaction
Q97
Q97 How does a transaction ensure data integrity?
By locking the database
By allowing multiple users to modify data simultaneously
By ensuring all parts of the transaction succeed or fail together
By prioritizing transactions
Q98
Q98 What is the effect of this SQL command?
SET AUTOCOMMIT = 0;
Turns off automatic execution of statements
Turns on automatic saving of the transaction
Disables the transaction log
Turns off automatic committing of transactions
Q99
Q99 Consider this sequence of commands:
START TRANSACTION; INSERT INTO Orders (Product, Quantity) VALUES ('Shoes', 10); ROLLBACK;
What is the outcome?
The order is permanently added to the database
The order is not added to the database
The order data is corrupted
A new transaction is started
Q100
Q100 How do transactions affect performance in a database system?
They slow down database operations due to locking mechanisms
They generally speed up database operations
They have no impact on performance
They improve data integrity without affecting performance
Q101
Q101 Identify the error in this SQL transaction sequence:
BEGIN; UPDATE Account SET Balance = Balance - 100 WHERE ID = 1; COMMIT;
Incorrect use of BEGIN for starting a transaction
Syntax error in UPDATE statement
COMMIT does not save the changes
No error
Q102
Q102 What's wrong with this transaction sequence?
START TRANSACTION; DELETE FROM Orders; COMMIT;
Missing WHERE clause in DELETE statement, potentially dangerous
No error
COMMIT should be ROLLBACK
DELETE statement syntax error
Q103
Q103 What is the purpose of using SSL in MySQL connections?
To speed up the connection
To compress data before transmission
To encrypt data during transmission
To log connection activities
Q104
Q104 What does the MySQL SECURITY command do when applied to a view?
Changes the view's charset
Sets who can access the view
Deletes the view after a certain period
Modifies the view's collation setting
Q105
Q105 How can you restrict user access to specific columns in a MySQL table?
By setting column-level privileges
By deleting unwanted columns
By using table-level firewalls
By encrypting specific columns
Q106
Q106 What is the primary benefit of implementing database auditing in MySQL?
To increase data retrieval speed
To monitor and log database activity
To reduce database size
To automatically fix database errors
Q107
Q107 What does this SQL command achieve?
REVOKE ALL PRIVILEGES ON database.* FROM 'user'@'localhost';
Grants all privileges to a user
Removes all privileges from a user for a database
Changes the user's password
None of the above
Q108
Q108 How does enabling the require_secure_transport option in MySQL enhance security?
Forces connections to use SSH
Forces connections to use SSL/TLS
Disables all database connections
Increases connection timeout
Q109
Q109 Identify the error in this user creation SQL command:
CREATE USER 'admin'@'localhost' IDENTIFIED BY password;
Syntax is correct
Missing quotes around 'password'
Wrong host specified
Password is too simple
Q110
Q110 What's wrong with using the following SQL statement for password management?
SET PASSWORD FOR 'user'@'localhost' = PASSWORD('open_sesame');
Depreciated method for setting passwords
Syntax error
No error
Incorrect hostname usage
Q111
Q111 What is the purpose of the mysqldump utility?
To compress MySQL databases
To replicate databases
To back up MySQL databases
To optimize MySQL databases
Q112
Q112 What type of backup involves copying only the data changed since the last full backup?
Incremental backup
Full backup
Mirror backup
Snapshot backup
Q113
Q113 Which statement is true about point-in-time recovery in MySQL?
It requires binary logging to be enabled
It can only restore data deleted by mistake
It’s only possible with mysqldump
It is automatically enabled in MySQL
Q114
Q114 What is the main advantage of using physical backups over logical backups in MySQL?
Faster restoration times
More secure
Smaller backup files
Easier to configure
Q115
Q115 What does the following command do?
mysqladmin -u root -p flush-logs
Deletes all logs
Creates a new log file by closing and reopening the log files
Restarts the MySQL server
Changes log file permissions
Q116
Q116 How do you restore a MySQL database from a dump file created by mysqldump?
mysql -u user -p database < dump.sql
mysqldump -u user -p database < dump.sql
mysqladmin -u user -p database < dump.sql
mysqlrestore -u user -p database < dump.sql
Q117
Q117 What is the impact of enabling the --single-transaction option during a mysqldump of an InnoDB database?
Creates a new transaction for each table
Locks the entire database during the dump
Creates a consistent snapshot without locking tables
Disables logging during the dump
Q118
Q118 Identify the error in this backup command:
mysqldump -u root -p --all-databases > backup.sql
Incorrect redirection for output
Syntax error in options
No error
Incorrect user credentials
Q119
Q119 What's wrong with using the following command for a backup?
mysqldump -u root --all-databases --quick > backup.sql
The --quick option is not appropriate for all databases
No error
The command should not use redirection
The command lacks password authentication
Q120
Q120 What is load balancing in the context of MySQL?
Distributing user requests across multiple servers
Splitting databases across servers
Replicating databases across multiple locations
Synchronizing data across servers