Asm 2 Database
Asm 2 Database
Asm 2 Database
Unit number and title Unit 04: Database Design & Development
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Grading grid
P2 P3 P4 P5 M2 M3 M4 M5 D2 D3
❒ Summative Feedback: ❒ Resubmission Feedback:
A stored procedure is a prepared SQL code that you can save, so the code can be reused over and over again. So if you have an SQL
query that you write over and over again, save it as a stored procedure, and then just call it to execute it.
A trigger is a stored procedure in database which automatically invokes whenever a special event in the database
occurs. For example, a trigger can be invoked when a row is inserted into a specified table or when certain table
columns are being updated.
Example: Create trigger Receving
Figure: Query to create trigger Receving and result
Functions calculate an aggregate value based on a group of rows and return multiple rows for each group.
Example: Create Funciton VIPcustomer
Figure: Query to create Funciton VIPcustomer and result
Figure: Option 1
Figure: Option 2
Figure: Option 3
Figure: Option 4.1