You are on page 1of 16

Teacher Evaluation Sheet

Name of Student: Gangwal Atish Swapnil


Enrolment No: 2200790205
Name of Program: Computer Technology Semester:- 3I
Course Title: Database Management Code:22319
Title of the Micro Project : “Apply Trigger On Given Database”

Course Outcomes Addresed:-

 Design Normalized database on given data.


 Create and Manage Database using SQL command.
 Able To Write Pl/SQL code for given database.
 Apply triggers to database also create procedure and function according to condition.
 Apply security and confidentiality on given database.

Evaluation as per Suggested Rubric for Assessment of Micro-Project:


Sr.
Characteristic to be Poor Average Good Excellent
No.
assessed (Marks 1-3) (Marks 4-5) (Marks 6 - 8) (Marks 9-10)
(A) Process and Product Assesssment (Convert above total marks out of 6 marks)
1 Relevance to the Course
Literature Survey /
2
Information Collection
Completion of the Target as
3
per project proposal
Analysis of data and
4
representation
5 Quality of Prototype / Model
6 Report Preparation
(B) Individual Presentation / Viva (Convert above total marks out of 4 marks)
8 Presentation
9 Viva

Process Assessment Product Assessment


Part Project Part Individual Total
A – project Methodology B – Project Presentation / Marks 10
Name of Student Proposal (2 marks) Report / Working Viva (4 marks)
(2 marks) Model(2 marks)

Gangwal Atish Swapnil


Micro – Project Evaluation Sheet:
Comments / Suggestions about team work / leadership / inter – personal communication :Good team co-
ordination and got many new things to learn
Any Other Comment :None

Name and designation of the faculty Member: Mrs.S.N.Gosavi Signature


Teacher Evaluation Sheet

Name of Student: Bande Aditya Abhijeet


Enrolment No: 2200790205
Name of Program: Computer Technology Semester:- 3I
Course Title: Database Management Code:22319
Title of the Micro Project : “Apply Trigger On Given Database”

Course Outcomes Addresed:-

 Design Normalized database on given data.


 Create and Manage Database using SQL command.
 Able To Write Pl/SQL code for given database.
 Apply triggers to database also create procedure and function according to condition.
 Apply security and confidentiality on given database.

Evaluation as per Suggested Rubric for Assessment of Micro-Project:


Sr.
Characteristic to be Poor Average Good Excellent
No.
assessed (Marks 1-3) (Marks 4-5) (Marks 6 - 8) (Marks 9-10)
(A) Process and Product Assesssment (Convert above total marks out of 6 marks)
1 Relevance to the Course
Literature Survey /
2
Information Collection
Completion of the Target as
3
per project proposal
Analysis of data and
4
representation
5 Quality of Prototype / Model
6 Report Preparation
(B) Individual Presentation / Viva (Convert above total marks out of 4 marks)
8 Presentation
9 Viva

Process Assessment Product Assessment


Part Project Part Individual Total
A – project Methodology B – Project Presentation / Marks 10
Name of Student Proposal (2 marks) Report / Working Viva (4 marks)
(2 marks) Model(2 marks)

Bande Aditya Abhijeet


Micro – Project Evaluation Sheet:
Comments / Suggestions about team work / leadership / inter – personal communication :Good team co-
ordination and got many new things to learn
Any Other Comment :None

Name and designation of the faculty Member: Mrs.S.N.Gosavi Signature


MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION

SHRI H. H. J. B POLYTECHNIC,
CHANDWAD-423101 (Nashik)

MICRO PROJECT
Academic year 2023-24

TITLE OF PROJECT
“Apply Trigger On Given Database”

Program:Computer Technology Program Code:CM

Course: Database Management Course code: 22319


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

Sr.No. Name of Student Roll No Enrollment No Seat No


1. Gangwal Atish Swapnil 13 2200790205 379278

CERTIFICATE
This is to certify Gangwal Atish Swapnil of 3th Semester of Diploma in
Computer Technology of Institute, SHHJB POLYTECHNIC,
CHANDWAD (Code: 0079) has completed the Micro-Project satisfactorily in
Subject Database Management for the academic year 2023-2024 as
prescribed in the curriculum.

Place: CHANDWAD

Date: /11/2023

Subject Teacher Head of the Department Principal


(Mrs.S.N.Gosavi) (Mr.P.R.Sali) (Dr. V.A.Wankhede)
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

Sr.No. Name of Student Roll No Enrollment No Seat No


1. Bande Aditya Abhijeet 03 2200790193 379268

CERTIFICATE
This is to certify Bande Aditya Abhijeet of 3th Semester of Diploma in
Computer Technology of Institute, SHHJB POLYTECHNIC,
CHANDWAD (Code: 0079) has completed the Micro-Project satisfactorily in
Subject Database Management for the academic year 2023-2024 as
prescribed in the curriculum.

Place: CHANDWAD

Date: /11/2023

Subject Teacher Head of the Department Principal


(Mrs.S.N.Gosavi) (Mr.P.R.Sali) (Dr. V.A.Wankhede)
INDEX

SR_NO. CONTENT PAGE NO.


Part A

1.0 Brief Introduction 1

2.0 Aim of Micro Project 1

3.0 Action Plan 1

4.0 Resources Required 1

Part B

1.0 Brief Description 2

2.0 Aim of Micro Project 2

3.0 Course Outcome Integrated 2

4.0 Actual Procedure Followed 2

5.0 Actual Resource Used 2

6.0 Outputs of the Micro-projects 10

7.0 Skill Developed 10

8.0 Applications of this Microproject 10


PART A-Plan

Title of micro-project: Apply Trigger On Given Database

1.0 Brief Discription :


A database trigger is procedural code that is automatically executed in response to certain events on a particular
table or view in a database. The trigger is mostly used for maintaining the integrity of the information on the
database.

2.0 Course Outcome Addresed:


1) Design Normalized database on given data.
2) Create and Manage Database using SQL command.
3) Able To Write Pl/SQL code for given database.
4) Apply triggers to database also create procedure and function according to condition.
5) Apply security and confidentiality on given database.

3.0 Proposed Methodology:

The group members decided the topic of micro project with the project guide and
finalized the topic Apply Trigger On Given Database.The preparation of the
abstract was done by Gangwal Atish and the needed data was collected by Bande
Aditya. The submission of the microproject was done by the date allotted by the
group guide.

4.0 Action Plan:

Planned Start Planned Finish


Sr no. Details of activity
Date Date
1. Finalization of topic
2. Preparation of Abstract
3. Collection of data
4. Preparation of concept
5. Seminar / Presentation
6. Submission of Micro Project

5.0 Resources Required :

Sr.No Name of Resource/Material Specification Quantity Remarks


1. Computer (Desktop/Laptop) i3,RAM 2GB 1
2. Microsoft office word 2016 1
3. Books
4. Websites
5. Softwares Oracle

PART B-Plan
Title of micro-project : Apply Trigger On Given Database

1.0 Brief Discription :

A trigger is a special type of stored procedure that automatically runs when an event occurs in the database
server. DML triggers run when a user tries to modify data through a data manipulation language (DML) event.
DML events are INSERT, UPDATE, or DELETE statements on a table or view.

2.0 Aim/Benefit Of Microproject.:

Every organization like shopping malls, hospitals, banking, institutes, and industry needs to share huge
amounts of data effectively. This course aims to develop skills in students to create, store, modify, manage and
extract information from a database. The database system can be used as a backend for developing database
applications.

3.0 Course Outcome Achieved:

Apply triggers to database also create procedure and function according to condition.

4.0 Actual Methodology/Procedure Followed:

1) Decide subject for micro project.


2) Preparation and submission of Abstract
3) Collection of data
4) Discussion and outline of Content
5) Formulation of content
6) Editing of Content
7) Compilation of Report and Presentation
8) Final submission of Micro Project.

5.0 Actual Resources Used:

Sr. Name of Specifications Qty Remarks


No. Resource/Material
1 Computer system Basic 1
configuration
2 Software Oracle 1
3 Internet
4 Books
Apply trigger on a given
database
Triggers are special types of Stored Procedures that are run automatically by the database
whenever a certain modification (event) occurs. The modification statements may include
INSERT, UPDATE, and DELETE. The user cannot fire the trigger explicitly, it gets fired
implicitly on the basis of certain specified events Not a stand-alone object.

Example:

• If you write a letter to your friend and then drop it in a mailbox without
putting sufficient postage on the envelope, you trigger the post office to return the letter to you
along with a warm reminder that you require to add postage. This reminder is triggered by the lack of
a stamp; otherwise, the letter would have gone via the mail without any delays.

Different post office triggers would be invoked if you provided enough postage but forgot to
write your friend's address

Types of Triggers:
• We can create TWO types of triggers:

1) DML (data manipulation language) triggers

• DML triggers run when insert, update or delete statements modify data
in the specified table or view.
→ Insert: triggers are invoked by insert statement
→ Update: triggers are invoked by the update statement
→ Delete: triggers are invoked by delete statement

2) DDL (data definition language) triggers

• DDL triggers run when events such as creating, altering, or dropping an


object occur on the server
• Used for database administration tasks such as auditing and controlling
object access.
Triggers can get fired in two different
MODES:

1. For/After the trigger

• It gets fired only after the SQL server completes all actions successfully
on a specified table. · Can roll back all the earlier transactions by issuing
ROLLBACK

· For example on inserting a row on a table, the trigger defined on the INSERT operation fires
only after the row gets successfully inserted, and if the insert fails SQL does not execute the
trigger. Instead of Trigger:

• Instead of trigger
• It causes the code present in the trigger to execute instead of the operation
that caused the trigger to fire.
• If we define INSTEAD OF Trigger on the above mentioned table, insert
would not happen but the trigger gets fired
Common Use of Trigger:
• Referential Integrity.
• Data Integrity Rules
• Creating Audit Trails:
• Functionality similar to a CHECK constraint, but which works across
tables, databases, or even servers.
• etc........

Actions that cannot be performed


using triggers:
• Database cannot be created, altered, dropped, backed up, or restored.
• Structural changes cannot be made to the table that caused the trigger to fire.
• SQL server does not support triggers against system objects.
• Triggers get fired only in response to logged operations hence minimally
logged operations such as TRUNCATE and WRITE TEXT do not cause
triggers to fire.
Disabling Triggers:
• Sometimes triggers can get in the way of what we are trying to
accomplish.
• For example, suppose that we wrote complex triggers on a table to perform a variety
of data integrity and validation checks to protect the database from incorrect
information.
• Now suppose that we are given a text file containing several million rows of cleaned
data that needs to be inserted into this table.
• These triggers will likely get in the way and cause the data load to take a very long
time. Here we can use the DISABLE TRIGGER statement to tell SQL Server 2005 to set
one or more triggers:

DISABLE TRIGGER Trigger name ON table name

• If you want to disable all triggers for a table


DISABLE TRIGGER ALL ON TABLENA ME
• Disables all DDL triggers for the whole database
DISABLE TRIGGER ALL ON DATABASE
• Disable all the DDL triggers for the entire server
DISABLE TRIGGER ALL ON ALL SERVER

• Check whether the trigger is active or not


• SELECT name,
is_disabled FROM sys.triggers WHERE name = ‘TRIGGER_NAME'
• A value of 'i' in the disabled column means that the the trigger is disabled; a value of
'o' means that it is active.

Enabling Triggers:
• If you want to disable all triggers for a table
ENABLE TRIGGER ALL ON TABLE NAME
• Disables all DDL triggers for the whole database
ENABLE TRIGGER ALL ON DATABASE
• Disable all the DDL triggers for the entire server
ENABLE TRIGGER ALL ON ALL SERVER
Deleting Triggers:
• For a DML trigger, the DROP TRIGGER statement looks like this:
• DROP TRIGGER Trigger_name
• Getting rid of a DDL trigger for just one database looks like this:
• DROP TRIGGER Trigger_name ON DATABASE
• DROP TRIGGER statement to remove a DDL trigger for all databases on
your server:
• DROP TRIGGER Trigger_name ON ALL SERVER

The trigger for Student Database


Trigger: A trigger is a stored process in a database that automatically summons 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.

Syntax:
create trigger [trigger_name]
[before | after]
{insert | update | delete}
on [table_name]
[for each row]
[trigger_body]

Explanation of syntax:

1. create trigger [trigger_name]: Creates or replaces an extant


trigger with the trigger_name.
2. [before | after]: This defines when the trigger will be executed.
3. {insert | update | delete}: This specifies the DML operation.
4. on [table_name]: This specifies the name of the table associated
with the trigger.
5. [for each row]: This specifies a row-level trigger, i.e., the trigger
will be executed for each row being affected.
6. [trigger_body]: This provides the operation to be performed
as the trigger is fired

BEFORE and AFTER of Trigger:


BEFORE triggers run the trigger action before the triggering statement is run. AFTER triggers run the
trigger action after the triggering statement is run.

Example:

Given Student Report Database, in which student marks assessment is recorded. In such a
schema, create a trigger so that the total and average of specified marks is automatically inserted
whenever a record is inserted.
Here, as the trigger will invoke before the record is inserted so, BEFORE Tag can be used.

Suppose the Database Schema –


mysql> desc Student;
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| tid | int(4) | NO | PRI | NULL | auto_increment |
| name | varchar(30) | YES | | NULL | |
| subj1 | int(2) | YES | | NULL | |
| subj2 | int(2) | YES | | NULL | |
| subj3 | int(2) | YES | | NULL | |
| total | int(3) | YES | | NULL | |
| per | int(3) | YES | | NULL | |
+-------+-------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)

SQL Trigger to the problem statement.

create trigger stud_marks

before INSERT

on
Student

for each row

set Student.total = Student.subj1 + Student.subj2 + Student.subj3, Student.per = Student.total


* 60 / 100;

Above SQL statement will create a trigger in the student database in which
whenever subjects marks are entered, before inserting this data into the database, the trigger will
compute those two values and insert them with the entered
values. i.e.,

mysql> insert into Student values(0, "ABCDE", 20, 20, 20, 0, 0);

Query OK, 1 row affected (0.09 sec)

mysql> select * from Student;

+- --+ - --+ - --+ - --+ - --+ - --+ - -+

| tid | name | subj1 | subj2 | subj3 | total | per |

+- --+ - --+ - --+ - --+ - --+ - --+ - -+

| 100 | ABCDE | 20 | 20 | 20 | 60 | 36 |

+- --+ - --+ - --+ - --+ - --+ - --+ - -+

1 row in set (0.00 sec)

In this way, triggers can be created and executed in the databases.


6.0 Output Of The Microproject:

In this project, we successfully create the trigger for Student Database.

7.0 Skill Developed:

1. Increase knowledge about using SQL.


2. Experience teamwork.
3. Increase communication skill.
4. Know about how to create the trigger for Student Database.

8.0 Application Of The Microproject:

1. Enforce business rules.


2. Validate input data.
3. Generate a unique value for a newly inserted row on a different file (surrogate function)
4. Write to other files for audit trail purposes.
5. Query from other files for cross-referencing purposes.

You might also like