- Create an index on the column
Hiredatethat allows clustering the data in theDepartmenttable. - Question: What will happen when you try this?
- Create an index that enforces uniqueness on the
Agecolumn in theStudenttable. - Question: What will happen when you try this?
- Create a SQL Server login named
RouteStudent. - Grant this login access to only:
StudenttableCoursetable
- Permissions:
- Allow:
SELECT,INSERT - Deny:
UPDATE,DELETE
- Allow:
Create a table named ReturnedBooks with the following structure:
| Column Name | Data Type |
|---|---|
| UserSSN | |
| BookId | |
| DueDate | |
| ReturnDate | |
| Fees |
- Create an INSTEAD OF INSERT trigger on the
ReturnedBookstable. - Logic:
- If
ReturnDateis afterDueDate, calculate a fee. - Fee = 20% of the amount previously paid.
- If
- Create a trigger to prevent any
INSERT,UPDATE, orDELETEoperations on theEmployeetable. - The trigger must display a message to notify the user that actions on this table are not permitted.
- Create a clustered index on the
Salarycolumn in theEmployeetable. - Question: What happens when this index is applied?
- Create a login using your name (e.g.,
MennaLogin). - Grant access only to:
EmployeetableFloortable
- Permissions:
- Allow:
SELECT,INSERT - Deny:
UPDATE,DELETE
- Allow:
- β Donβt forget to take screenshots of each step.
π‘ Note: Make sure to test each step and validate behavior through SQL Server Management Studio.