0
0
MySQLquery~20 mins

Why access control protects data in MySQL - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Access Control Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why is access control important in databases?

Which of the following best explains why access control is essential for protecting data in a database?

AIt restricts who can view or modify data, preventing unauthorized access.
BIt automatically backs up data to prevent loss.
CIt speeds up query execution by limiting data size.
DIt encrypts data so users cannot read it.
Attempts:
2 left
💡 Hint

Think about how controlling user permissions helps keep data safe.

query_result
intermediate
2:00remaining
Result of a query with restricted access

Given a user with SELECT permission only on the employees table, what will happen if they try to run this query?

DELETE FROM employees WHERE id = 5;
AThe row with id 5 will be deleted.
BThe query will fail with a permission error.
CThe database will prompt for admin approval.
DThe query will run but no rows will be deleted.
Attempts:
2 left
💡 Hint

Consider what permissions are needed to delete data.

📝 Syntax
advanced
2:00remaining
Granting access with SQL

Which of the following SQL statements correctly grants SELECT permission on the customers table to user john?

AGRANT SELECT ON customers TO 'john'@'localhost';
BGRANT SELECT ON customers.* TO john;
CGRANT SELECT ON database.customers TO john;
DGRANT SELECT ON customers TO john;
Attempts:
2 left
💡 Hint

Remember how to specify user names in MySQL GRANT statements.

optimization
advanced
2:00remaining
Optimizing access control for many users

You have hundreds of users needing different access levels to various tables. Which approach best optimizes managing access control?

AGrant permissions individually to each user for each table.
BUse a single admin user for all access to simplify control.
CCreate roles with specific permissions and assign users to roles.
DStore permissions in a separate table and check manually in queries.
Attempts:
2 left
💡 Hint

Think about how grouping permissions can reduce repetitive work.

🔧 Debug
expert
2:00remaining
Why does this access control fail?

A database admin runs this command to revoke SELECT permission from user alice on the orders table:

REVOKE SELECT ON orders FROM alice;

But alice can still select data from orders. What is the most likely reason?

AAlice is connected with a different username.
BThe REVOKE command syntax is incorrect and did not run.
CThe orders table does not exist, so the command had no effect.
DAlice has SELECT permission through a role that was not revoked.
Attempts:
2 left
💡 Hint

Consider how permissions can be granted indirectly.