0
0
MySQLquery~10 mins

Granting privileges in MySQL - Interactive Code Practice

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

Complete the code to grant SELECT privilege on the database 'shop' to user 'alice'.

MySQL
GRANT [1] ON shop.* TO 'alice'@'localhost';
Drag options to blanks, or click blank then click option'
AUPDATE
BINSERT
CSELECT
DDELETE
Attempts:
3 left
💡 Hint
Common Mistakes
Using INSERT or UPDATE instead of SELECT.
Forgetting to specify the database and tables.
2fill in blank
medium

Complete the code to grant all privileges on the 'employees' table to user 'bob'.

MySQL
GRANT [1] ON company.employees TO 'bob'@'%';
Drag options to blanks, or click blank then click option'
AALL PRIVILEGES
BSELECT
CUPDATE
DDELETE
Attempts:
3 left
💡 Hint
Common Mistakes
Using only SELECT or UPDATE instead of ALL PRIVILEGES.
Not specifying the correct table.
3fill in blank
hard

Complete the code to grant INSERT privilege on all tables in 'sales' database to user 'carol'.

MySQL
GRANT [1] ON sales.* TO 'carol'@'localhost';
Drag options to blanks, or click blank then click option'
AINSERT ON *
BINSERT ON sales
CINSERT ON sales.*
DINSERT
Attempts:
3 left
💡 Hint
Common Mistakes
Including ON in the privilege part.
Not specifying tables with .* after database.
4fill in blank
hard

Fill both blanks to grant DELETE and UPDATE privileges on 'inventory' database to user 'dave'.

MySQL
GRANT [1], [2] ON inventory.* TO 'dave'@'localhost';
Drag options to blanks, or click blank then click option'
ADELETE
BUPDATE
CSELECT
DINSERT
Attempts:
3 left
💡 Hint
Common Mistakes
Using SELECT or INSERT instead of DELETE or UPDATE.
Not separating privileges with a comma.
5fill in blank
hard

Fill the blanks to grant SELECT privilege on 'reports' database and flush privileges.

MySQL
GRANT [1] ON reports.* TO 'eve'@'%';
[2];
Drag options to blanks, or click blank then click option'
ASELECT
BFLUSH PRIVILEGES
CCOMMIT
DREVOKE
Attempts:
3 left
💡 Hint
Common Mistakes
Using REVOKE instead of FLUSH PRIVILEGES.
Not flushing privileges after grant.