0
0
MySQLquery~10 mins

Why access control protects data in MySQL - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to grant SELECT permission on the employees table to user 'john'.

MySQL
GRANT [1] ON employees TO 'john';
Drag options to blanks, or click blank then click option'
AUPDATE
BDELETE
CSELECT
DINSERT
Attempts:
3 left
💡 Hint
Common Mistakes
Using DELETE instead of SELECT will allow data removal, not reading.
UPDATE and INSERT are for modifying data, not just reading.
2fill in blank
medium

Complete the code to revoke UPDATE permission from user 'alice' on the sales table.

MySQL
REVOKE [1] ON sales FROM 'alice';
Drag options to blanks, or click blank then click option'
ASELECT
BUPDATE
CINSERT
DDELETE
Attempts:
3 left
💡 Hint
Common Mistakes
Revoking SELECT will prevent reading data, not updating.
INSERT and DELETE are for adding or removing data, not updating.
3fill in blank
hard

Fix the error in the code to grant all privileges on the database 'company' to user 'bob'.

MySQL
GRANT [1] ON company.* TO 'bob';
Drag options to blanks, or click blank then click option'
AALL
BEVERY
CALL PRIVILEGE
DALL PRIVILEGES
Attempts:
3 left
💡 Hint
Common Mistakes
Using just 'ALL' is incomplete syntax.
Misspelling 'PRIVILEGES' causes errors.
Using 'EVERY' is not valid SQL.
4fill in blank
hard

Fill both blanks to create a user 'carol' with password 'secure123' and grant SELECT permission on the products table.

MySQL
CREATE USER 'carol'@'localhost' IDENTIFIED BY '[1]';
GRANT [2] ON products TO 'carol'@'localhost';
Drag options to blanks, or click blank then click option'
Asecure123
BSELECT
CDELETE
Dpassword123
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong password string.
Granting DELETE instead of SELECT.
5fill in blank
hard

Fill all three blanks to revoke INSERT and UPDATE permissions from user 'dave' on the orders table and then drop the user.

MySQL
REVOKE [1], [2] ON orders FROM 'dave';
DROP USER '[3]';
Drag options to blanks, or click blank then click option'
AINSERT
BUPDATE
Cdave
DDELETE
Attempts:
3 left
💡 Hint
Common Mistakes
Using DELETE instead of UPDATE or INSERT.
Dropping a user with the wrong name.