Here’s the answer key with explanations for the Part 11 quiz on database security and permissions.
✅ Answer Key & Explanations
-
What SQL command is used to grant specific privileges to a user?
Answer: b) GRANT
Explanation:
GRANT
is the command used to assign specific permissions like SELECT, INSERT, UPDATE, etc., to a database user.CREATE USER
only creates the user but doesn’t assign privileges.
-
In MongoDB, which role allows both reading and writing to a database?
Answer: b) readWrite
Explanation:
ThereadWrite
role grants permission to read and write data in the specified database. Theread
role allows only reading, whiledbAdmin
andclusterAdmin
are for administrative privileges.
-
What is the main purpose of encryption in databases?
Answer: b) Protect data confidentiality
Explanation:
Encryption protects sensitive data from unauthorized access by encoding it. It converts data into an unreadable format for unauthorized users. It does not speed up queries or organize data; rather, it secures data both at rest and in transit.
-
Which security principle suggests giving users only the permissions they need?
Answer: a) Principle of least privilege
Explanation:
This principle ensures users have the minimum necessary permissions to perform their jobs, reducing risk of accidental or malicious data exposure or damage.
✅ Practice Task Solution: If you haven’t seen the original task yet, you can check it here.
💡 Challenge: Can you think of a real-world scenario where applying the principle of least privilege would make a difference? Share your thoughts in the comments!
💬 Leave a comment if you have any questions or feedback!