Data Security

Password protect the database you created for your individual assignment in Week Three.

Create a matrix to indicate the permissions (read, insert, delete, modify) you would grant to different users of your database.

Create at least two different users and implement their permissions using SQL statements.

Submit the following deliverables to your instructor:

The steps you took to password protect the database

The matrix

The SQL code for creating the users and implementing their permissions

Using either MySQL, SQL Server, or SQL Manager. Need screenshots and coding in word.

To password protect your database, you need to follow these general steps:

1. Open your chosen database management system (MySQL, SQL Server, or SQL Manager) and log in as an administrator or a user with administrative privileges.
2. Locate the database you created for your individual assignment in Week Three.
3. Set a password for the database by running a SQL command or using the graphical interface of your database management system.
- In SQL Server, you can use the ALTER DATABASE statement with the SET HADR command.
- In MySQL, you can use the ALTER USER statement.
- In SQL Manager, you can use the Tools menu and select the "Database Password" option.

As I am an AI text-based bot and do not have access to the graphical interface, I am unable to provide screenshots. However, I will provide the general steps for you to execute in your database management system.

4. Once the database is password protected, you need to create a matrix indicating the permissions for different users. Consider the four main permissions: read, insert, delete, and modify.

| User | Read | Insert | Delete | Modify |
|----------|--------|--------|--------|--------|
| User1 | Yes | No | No | Yes |
| User2 | Yes | Yes | Yes | No |

In the above matrix, User1 has read and modify permissions but cannot insert or delete records, while User2 has full access permissions.

5. Create at least two different users by executing the appropriate SQL statements in your database management system. Here is an example using MySQL syntax:

```sql
CREATE USER 'user1'@'localhost' IDENTIFIED BY 'password1'; -- Create User1
CREATE USER 'user2'@'localhost' IDENTIFIED BY 'password2'; -- Create User2
```

6. Grant the specified permissions to the users using the appropriate SQL statements. Here is an example of granting permissions to User1 and User2 using MySQL syntax:

```sql
GRANT SELECT, UPDATE ON database_name.table_name TO 'user1'@'localhost';
GRANT SELECT, INSERT, DELETE ON database_name.table_name TO 'user2'@'localhost';
```

Replace 'database_name' with the name of your database and 'table_name' with the name of the table in which you want to grant permissions.

7. Take screenshots of the database password protection steps and the SQL code snippets showing the creation of users and granting of permissions.

8. Save the screenshots and code snippets in a Word document, along with the matrix.

9. Submit the Word document containing the steps you took to password protect the database, the matrix, and the SQL code for creating the users and implementing their permissions to your instructor.

Note: The exact commands and syntax may vary depending on the database management system you are using. Please refer to the documentation specific to your chosen system for the exact steps and commands.