0% found this document useful (0 votes)
31 views50 pages

Relational Design

The document discusses relational database design and normalization. It covers topics like functional dependencies, normal forms including 1NF, 2NF, 3NF, and BCNF, and database anomalies. The goal of normalization is to minimize redundancy and avoid anomalies through decomposing relations and designing tables in higher normal forms.

Uploaded by

Nila Tamilselvan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views50 pages

Relational Design

The document discusses relational database design and normalization. It covers topics like functional dependencies, normal forms including 1NF, 2NF, 3NF, and BCNF, and database anomalies. The goal of normalization is to minimize redundancy and avoid anomalies through decomposing relations and designing tables in higher normal forms.

Uploaded by

Nila Tamilselvan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

R E L AT I O N A L D E S I G N

2nd Sem, MSc.

SSS Shameem June-2022 MSc_BA, DoC


CONTENT
❑ Relational Model Design
• Functional Dependency
• Normalization
• Normal Forms – 1NF, 2NF, 3NF, BCNF

SSS Shameem June-2022 MSc_BA, DoC


F E AT U R E S O F G O O D R E L AT I O N A L
DATA B A S E D E S I G N
• Minimum Redundancy
• Storage of same data in more than one location - redundancy
• Disadvantage: Wastage of storage space
• Results in updation anomalies

• Fewer null values in tuples


• Values of all the attributes of a tuple are not known, so null value is to be stored
• Cannot be provided to primary key
• Wastage of storage space
• Interpreting them in aggregate functions become difficult

SSS Shameem June-2022


ANOMALIES
Insertion anomaly:
• leads to a situation in which certain information cannot be inserted into a relation unless some other
information is stored.

Deletion anomaly:
• leads to a situation in which deletion of data representing certain information results in losing data
representing some other information that is associated with it

Modification Anomaly:
• leads to a situation in which repeated data changed at one place results in inconsistency unless the
same data are also changed at other places

SSS Shameem June-2022


EXAMPLE:
I N S E RT, D E L E T E & U P D AT E A N O M A L I E S
StudentNum Student Name Address Course
S21 Jones Edinburgh Accounts
S21 Jones Edinburgh physics
S24 Smith Glasgow physics
S30 Richards Manchester Computing
S30 Richards Manchester Maths

INSERT: Can not insert A course if No student Opted that Course

DELETE: Assume S24 is the only one student who opted Physics. When S24 leaves the course then
Student record is deleted which also result in loss of Course information.

UPDATE: If S21 changes his Address then in both records Address is to be modified otherwise it results
into inconsistency.

SSS Shameem June-2022


D E C O M P O S I T I O N O F A R E L AT I O N

• A large database defined as a single relation may result in data duplication.


• This repetition of data may result in:
• Making relations very large.
• Not easy to maintain and update data as it would involve searching many records in relation.
• Wastage and poor utilization of disk space and resources.
• The likelihood of errors and inconsistencies increases.
• To handle these problems, one should analyze and decompose relations with redundant data into smaller,
simpler, and well-structured relations that are satisfy desirable properties.

• Normalization is a process of decomposing the relations into multiple relations with fewer attributes each.

SSS Shameem June-2022


FUNCTIONAL DEPENDENCY (FD)
• Functional dependency is a relationship between two attributes.
• It typically exists between the key and non-key attribute within a table.
X → Y
• The left side of FD is known as a determinant & right side is known as a dependent.
• Functional dependencies are the special forms of integrity constraints that generalize the concepts of keys
• They play a key role in developing a good database schema.

Example: Employee table (Emp_Id, Emp_Name, Emp_Address)


• Emp_Id attribute can uniquely identify Emp_Name attribute of employee table (if we know Emp_Id, we can tell
employee name associated with it)
• Emp_Name is functionally dependent on Emp_Id. Functional dependency can be written as:
Emp_Id → Emp_Name

SSS Shameem June-2022


FUNCTIONAL DEPENDENCY (FD)
Trivial functional dependency
• A → B has trivial functional dependency if B is a subset of A.
• The following dependencies are also trivial like: A → A, B → B

Example:
• Table with two columns Employee_Id and Employee_Name.
• {Employee_id, Employee_Name} → Employee_Id is a trivial functional dependency as

Employee_Id is a subset of {Employee_Id, Employee_Name}.


• Employee_Id → Employee_Id and Employee_Name → Employee_Name are also trivial dependencies.

SSS Shameem June-2022


FUNCTIONAL DEPENDENCY (FD)
Non-Trivial functional dependency
• A → B has a non-trivial functional dependency if B is not a subset of A.
• When A intersection B is NULL, then A → B is called as complete non-trivial.

Example:
• ID → Name,
• Name → DOB

SSS Shameem June-2022


N O R M A L I Z AT I O N
• Normalization is the process of organizing the data in the database.
• Normalization is used to minimize the redundancy from a relation or set of relations. It is also used to eliminate
undesirable characteristics like Insertion, Update, and Deletion Anomalies.

• Normalization divides the larger table into smaller and links them using relationships.
• The normal form is used to reduce redundancy from the database table.

• Main reason for normalizing relations is removing anomalies.


• Failure to eliminate anomalies leads to data redundancy and can cause data integrity and other problems as the
database grows.
• Normalization consists of a series of guidelines that helps to guide you in creating a good database structure.

SSS Shameem June-2022


N O R M A L I Z AT I O N
• Normalization is the process of modifying a relation schema based on its Functional Dependencies and primary
keys so that it meets certain rules called normal forms.
• It is conducted by evaluating a relation schema to check whether it satisfies particular rules and if not, then
decomposing the schema into set of smaller relation schemas that do not violate those rules

• Normalization can be considered as fundamental to the modelling and design of a relational database
• Main purpose is to eliminate data redundancy and avoid data update anomalies

• A relation is said to be in a particular normal form if it satisfies certain specified constraints


• Each of the normal form is stricter than its predecessors
• The normal forms are used to ensure that various types of anomalies and inconsistencies are removed from the
database

SSS Shameem June-2022


N O R M A L I Z AT I O N
A properly normalized database should have the following characteristics
• Atomic values in each fields
• Absence of redundancy.
• Minimal use of null values.
• Minimal loss of information.

Advantages of Normalization
• Normalization helps to minimize data redundancy.
• Greater overall database organization.
• Data consistency within the database.
• Much more flexible database design.
• Enforces the concept of relational integrity.

SSS Shameem June-2022


L E V E L S O F N O R M A L I Z AT I O N
• Levels of normalization based on the amount of redundancy in the database.
• Various levels of normalization are:
• First Normal Form (1NF)

Number of Tables
• Second Normal Form (2NF)

Complexity
Redundancy
• Third Normal Form (3NF)
• Boyce-Codd Normal Form (BCNF)
• Fourth Normal Form (4NF)
• Fifth Normal Form (5NF)
• Domain Key Normal Form (DKNF)

Most databases should be 3NF or BCNF in order to avoid the database anomalies.

SSS Shameem June-2022


L E V E L S O F N O R M A L I Z AT I O N

Normal Form Description


1NF A relation is in 1NF if it contains an atomic value.
2NF A relation will be in 2NF if it is in 1NF and all non-key attributes are fully functional
dependent on the primary key.
3NF A relation will be in 3NF if it is in 2NF and no transition dependency exists.

BCNF A stronger definition of 3NF is known as Boyce Codd's normal form.


4NF A relation will be in 4NF if it is in Boyce Codd's normal form and has no multi-valued
dependency.
5NF A relation is in 5NF. If it is in 4NF and does not contain any join dependency, joining
should be lossless.

SSS Shameem June-2022


1 ST N O R M A L F O R M – 1 N F
• A relation will be 1NF if it contains an atomic value.
• An attribute of a table cannot hold multiple values. It must hold only single-valued attribute.
• 1st normal form disallows multi-valued attribute, composite attribute, and their combinations.
Example: Relation EMPLOYEE is NOT in 1NF because of multi-valued attribute EMP_PHONE.

Decomposition of EMPLOYEE table into 1NF: EMP_ID EMP_NAME EMP_PHONE EMP_STATE

EMP_ID EMP_NAME EMP_PHONE EMP_STATE 14 John 7272826385, UP


9064738238
14 John 7272826385 UP
20 Harry 8574783832 Bihar
14 John 9064738238 UP
12 Sam 7390372389, Punjab
20 Harry 8574783832 Bihar 8589830302
12 Sam 7390372389 Punjab

12 Sam 8589830302 Punjab

SSS Shameem June-2022


2 ND N O R M A L F O R M – 2 N F
• Firstly, Relational must be in 1NF.
• In 2NF, all non-key attributes are fully functional dependent on the primary key.
Example: School DB can store data of teachers and subjects they teach. A teacher can teach more than one
subject.

TEACHER_ID SUBJECT TEACHER_AGE


In given table, non-prime attribute TEACHER_AGE is 25 Chemistry 30
dependent on TEACHER_ID which is a proper subset of 25 Biology 30
a candidate key → violates the rule for 2NF.
47 English 35
To convert the given table into 2NF, decompose it into 83 Math 38
two tables. 83 Computer 38

SSS Shameem June-2022


2 ND N O R M A L F O R M – 2 N F
TEACHER_ID SUBJECT TEACHER_AGE

25 Chemistry 30
25 Biology 30
47 English 35
83 Math 38
83 Computer 38

TEACHER_ID SUBJECT
TEACHER_ID TEACHER_AGE 25 Chemistry
25 30 25 Biology
47 35 47 English
83 38 83 Math
83 Computer

SSS Shameem June-2022


TRANSITIVE FUNCTIONAL DEPENDENCIES

• A transitive functional dependency is when changing a non-key column, might cause any of
other non-key columns to change
Example: Changing the non-key column Full Name may change Salutation.

SSS Shameem June-2022


3 RD N O R M A L F O R M – 3 N F
• A relation will be in 3NF if it is in 2NF and not contain any transitive partial dependency.
• 3NF is used to reduce data duplication, and achieve the data integrity.

• If there is no transitive dependency for non-prime attributes, then the relation must be in 3NF.
• A relation is in 3NF if it holds atleast one of the following conditions for every non-trivial function dependency X → Y.
• X is a super key.
• Y is a prime attribute, i.e., each element of Y is part of some candidate key.
EMPLOYEE_DETAIL table:
EMP_ID EMP_NAME EMP_ZIP EMP_STATE EMP_CITY
222 Harry 201010 UP Noida
333 Stephan 02228 US Boston
444 Lan 60007 US Chicago
555 Katharine 06389 UK Norwich

666 John 462007 MP Bhopal

SSS Shameem June-2022


3 RD N O R M A L F O R M – 3 N F
• Super key in the table above:
{EMP_ID}, {EMP_ID, EMP_NAME}, {EMP_ID, EMP_NAME, EMP_ZIP}....so on

• Candidate key: {EMP_ID}


• Non-prime attributes: all attributes except EMP_ID are non-prime.

• Here, EMP_STATE & EMP_CITY dependent on EMP_ZIP and EMP_ZIP dependent on EMP_ID.
• Non-prime attributes (EMP_STATE, EMP_CITY) transitively dependent on super key(EMP_ID) → violates 3NF rule.
EMP_ID EMP_NAME EMP_ZIP EMP_STATE EMP_CITY
• Need to move EMP_CITY and EMP_STATE to 222 Harry 201010 UP Noida
new <EMPLOYEE_ZIP> table, with EMP_ZIP 333 Stephan 02228 US Boston
as a Primary key. 444 Lan 60007 US Chicago
555 Katharine 06389 UK Norwich

666 John 462007 MP Bhopal


SSS Shameem June-2022
3 RD N O R M A L F O R M – 3 N F
EMP_ID EMP_NAME EMP_ZIP EMP_STATE EMP_CITY
222 Harry 201010 UP Noida
333 Stephan 02228 US Boston
444 Lan 60007 US Chicago
555 Katharine 06389 UK Norwich

666 John 462007 MP Bhopal

EMPLOYEE table: EMPLOYEE_ZIP table:

EMP_ID EMP_NAME EMP_ZIP EMP_ZIP EMP_STATE EMP_CITY


222 Harry 201010 201010 UP Noida
333 Stephan 02228 02228 US Boston
444 Lan 60007 60007 US Chicago
555 Katharine 06389 06389 UK Norwich
666 John 462007 462007 MP Bhopal

SSS Shameem June-2022


NORMAL FORM
ORIGINAL TABLE

2NF

1NF

3NF

SSS Shameem June-2022


B OYC E C O D D N O R M A L F O R M ( B C N F )
• BCNF is the advance version of 3NF (stricter than 3NF).
• A table is in BCNF if every functional dependency X → Y, X is the super key of the table.
• For BCNF, the table should be in 3NF, and for every FD, LHS is super key.
Example: In a company employees work in more than one department.

Functional dependencies are :


• EMP_ID → EMP_COUNTRY
• EMP_DEPT → {DEPT_TYPE, EMP_DEPT_NO}
Candidate key: {EMP-ID, EMP-DEPT}
EMP_ID EMP_COUNTRY EMP_DEPT DEPT_TYPE EMP_DEPT_NO
Not in BCNF because neither EMP_DEPT 264 India Designing D394 283
nor EMP_ID alone are keys.
264 India Testing D394 300
To convert the given table into BCNF, 364 UK Stores D283 232
decompose it into three tables.
364 UK Developing D283 549

SSS Shameem June-2022


B OYC E C O D D N O R M A L F O R M ( B C N F )
EMP_ID EMP_COUNTRY EMP_DEPT DEPT_TYPE EMP_DEPT_NO

Candidate keys: 264 India Designing D394 283


First table: EMP_ID 264 India Testing D394 300
Second table: EMP_DEPT
364 UK Stores D283 232
Third table: {EMP_ID, EMP_DEPT}
364 UK Developing D283 549
Functional dependencies:
• EMP_ID → EMP_COUNTRY EMP_ID EMP_COUNTRY EMP_ID EMP_DEPT
• EMP_DEPT → {DEPT_TYPE, EMP_DEPT_NO}
264 India D394 283
Now, this is in BCNF because left side part of both 264 India D394 300
functional dependencies is a key. D283 232
EMP_DEPT DEPT_TYPE EMP_DEPT_NO
D283 549
Designing D394 283
Testing D394 300
Stores D283 232
Developing D283 549

SSS Shameem June-2022


SUBQUERIES

• SQL provides a mechanism for the nesting of subqueries.

• A subquery is a select-from-where expression that is nested within another query.

• Subquery or Inner query or a Nested query is a query within another SQL query and embedded within the
WHERE clause.
• Used to return data that will be used in the main query as a condition to further restrict the data to be
retrieved.
• Subqueries can be used with the SELECT, INSERT, UPDATE, and DELETE statements along with the
operators like =, <, >, >=, <=, IN, BETWEEN, etc.

SSS Shameem June-2022


SUBQUERIES - EXAMPLE

SELECT *
FROM CUSTOMERS
WHERE ID IN ( SELECT ID
FROM CUSTOMERS
WHERE SALARY > 4500) ;

SSS Shameem June-2022


SUBQUERIES - EXAMPLE
• SQL allows a subquery expression to be used in the from clause.

Find the average instructors’ salaries of those departments where the average salary is
greater than $42,000.

select dept_name, avg_salary

from (select dept_name, avg (salary) as avg_salary


from instructor

group by dept_name)

where avg_salary > 42000;

SSS Shameem June-2022


S U B Q U E R I E S W I T H I N S E RT / U P DAT E / D E L E T E

• Subqueries also can be used with INSERT statements.

• INSERT statement uses data returned from subquery to insert into another table.

• Selected data in the subquery can be modified with any of the character, date or number functions.

INSERT INTO CUSTOMERS_BKP


SELECT * FROM CUSTOMERS
WHERE ID IN (SELECT ID FROM CUSTOMERS) ;

• Subquery can be used in conjunction with the UPDATE and DELETE statements

SSS Shameem June-2022


VIEW
• In SQL, a view is a virtual table based on the result-set of an SQL statement.

• A view contains rows and columns, just like a real table.

• Fields in a view are fields from one or more real tables in the database.

• Some times, it is not desirable for all users to see entire logical
model . Thus Provides some kind of Security.
• A view provides a mechanism to hide certain data from the view of
certain users.

SSS Shameem June-2022


VIEW

• A view is defined using the create view statement which has the form

CREATE VIEW v AS < query expression >

where <query expression> is any legal SQL expression.


• The view name is represented by v.
• Once a view is defined, view name can be used to refer to the virtual relation that the view generates.
• View can be updated and dropped.
CREATE VIEW [Brazil_Customers] AS
SELECT CustomerName, ContactName
FROM Customers
WHERE Country = 'Brazil';

SSS Shameem June-2022


32

VIEW
RENAMING COLUMN NAMES IN THE VIEW

CREATE VIEW V2 (employee_number, Name, Date_of_Join) AS


SELECT empno, ename, hiredate FROM Emp;

VIEW WITH AG G R E G AT E FUNCTION

CREATE VIEW V3 AS SELECT job, avg(sal) Avg_sal

FROM Emp GROUP BY job;

SSS Shameem June-2022 SQL


33

VIEW

CREATING A VIEW FROM ANOTHER VIEW

CREATE VIEW v5 AS SELECT employee_number,name

FROM v2 WHERE date_of_join>'17-DEC-1980';

QUERYING A VIEW
Views can be queried in the same way like Base Tables

SELECT * FROM V5;

SSS Shameem June-2022 SQL


PL/SQL
• Procedural Language – SQL
• An extension to SQL with design features of programming languages
• PL/SQL and Java are both supported as internal host languages within Oracle products.

• Acts as host language for stored procedures and triggers.


• Provides the ability to add middle tier business logic to client/server applications.
• Improves performance of multi-query transactions.
• Provides error handling

SSS Shameem June-2022


P L / S Q L B LO C K S T RU C T U R E
DECLARE (optional)
- variable declarations
BEGIN (required)
- SQL statements
- PL/SQL statements or sub-blocks
EXCEPTION (optional)
- actions to perform when errors occur
END; (required)

SSS Shameem June-2022


P L / S Q L B LO C K T Y P E S

Anonymous Procedure Function

DECLARE PROCEDURE <name> FUNCTION <name>


IS RETURN <datatype>
BEGIN
BEGIN IS
-statements -statements BEGIN
EXCEPTION EXCEPTION -statements
END; EXCEPTION
END; END;

SSS Shameem June-2022


PL/SQL ASSIGNMENT
• All variables must be declared before their use.
• The assignment statement
:=
is not the same as the equality(comparison) operator
=
• All statements end with a ;

SSS Shameem June-2022


P L / S Q L D B M S _ O U T P U T. P U T _ L I N E ( )
• Printing on the screen
• DBMS_OUTPUT is the package , defined with function PUT_LINE( string variable ).
• String variable value passed can be displayed on the screen.
• Before using DBMS_OUTPUT.PUT_LINE( ..) , use SET SERVEROUTPUT ON at SQL prompt

Example:

DBMS_OUTPUT.PUT_LINE(‘ HELLO ….’);


DBMS_OUTPUT.PUT_LINE(‘MY Register Number ’ || to_char(12345));
|| symbol concatenates two strings.

SSS Shameem June-2022


P L / S Q L F I R S T P RO G R A M
SET SERVEROUTPUT ON
DECLARE
message varchar2(20):= 'Hello, World! ';
BEGIN
dbms_output.put_line(message);
END;
/

SSS Shameem June-2022


P L / S Q L S A M P L E P RO G R A M
/* Find the area of the circle*/
SET SERVEROUTPUT ON
DECLARE
pi constant number:=3.14;
radius number:=2;
area number;
BEGIN
area:=pi*radius*radius;
dbms_output.put_line('Area of circle is:'||area);
END;
/

SSS Shameem June-2022


P L / S Q L S A M P L E P RO G R A M
--Find the area of the circle
SET SERVEROUTPUT ON
DECLARE
pi constant number:=3.14;
radius number:=&radius;
area number;
BEGIN
area:=pi*power(radius,2);
dbms_output.put_line('Area of circle is:'||area);
END;
/

SSS Shameem June-2022


CURSORS

• A cursor is a private memory area.


• Set of records returned by Query are stored in Cursor.
• Data in Cursor is Active Data Set
• Implicit cursors are created for every query
• Explicit cursors can be declared by a programmer within PL/SQL.

SSS Shameem June-2022


IMPLICIT CURSORS

SELECT emp_no, emp_name, job, salary


FROM employee
WHERE dept = 'physics'

IMPLICIT CURSORS EXPLICIT CURSORS

✓ Cursor is Automatically –Opened ✓ Declare the cursor


✓ All Records Retrieved. ✓ Open the cursor
✓ Cursor is Closed ✓ Fetch data from the cursor record by record
✓ Close the cursor

SSS Shameem June-2022


IMPLICIT CURSORS
• SQL%ROWCOUNT Rows returned so far
• SQL%FOUND One or more rows retrieved
SET SERVEROUTPUT ON • SQL%NOT FOUND No rows found
BEGIN • SQL%ISOPEN Is the cursor open

update dept set location='&location' where dno=&dno;


if SQL%found then
DBMS_OUTPUT.PUT_LINE('Department Successfully transferred');
end if;
if SQL%notfound then
DBMS_OUTPUT.PUT_LINE('Department not existing');
end if;
END;

SSS Shameem June-2022


EXPLICIT CURSORS
ORACLE keep track of the "current status" of the cursor through- Cursor Attributes(system variables)

❖ %NOTFOUND: Evaluates to TRUE if the last fetch is failed i.e. no more rows are left. (single word)
Syntax: cursor_name %NOTFOUND

❖ %FOUND: Evaluates to TRUE, when last fetch succeeded


Syntax: cursor_name %FOUND

❖ %ISOPEN: Evaluates to TRUE, if the cursor is opened, otherwise evaluates to FALSE.


Syntax: cursor_name %ISOPEN

❖ %ROWCOUNT: Returns the number of rows fetched.


Syntax: cursor_name %ROWCOUNT

SSS Shameem June-2022


CURSORS EXAMPLE
Example-1: Write a PL/SQL Block to retrieve
DECLARE Employee name and salary if salary is more than 3000.
cursor c_emp is -- Cursor Declaration Assume the tables – EMP(Empno, Ename, Sal, Deptno)
DEPT(Deptno, Dname, Bugdet)
select ename,sal from emp where sal>=3000;
v_ename emp.ename%TYPE; BEGIN

v_salary emp.sal%TYPE; open c_emp; -- Open Cursor

loop

fetch c_emp into v_ename,v_salary; -- Fetch Record

exit when c_emp%notfound; -- Test End of Cursor

DBMS_OUTPUT.PUT_LINE(v_ename||' draws '||v_salary||' as salary');

end loop;

close c_emp; -- Close cursor

END;

/
SSS Shameem June-2022
D ATA B A S E T R I G G E R S
• Triggers get executed (fire) automatically when specified SQL DML operations – INSERT, UPDATE, or
DELETE affecting one or more rows of a table.
• A stored PL/SQL program unit that is associated with a specific database table, or with certain view
types – can also be associated with system event.
• Two sections:
• A named database event
• A PL/SQL block that will execute when event occurs

SSS Shameem June-2022


TRIGGER VS. CONSTRAINTS
• Trigger affects only those rows, which are added after it is enabled.

• Constraints affects all the rows i.e. Validates the even already existing data before defining the constraint.
• Triggers:
• are named PL/SQL blocks with declarative, executable, and exception handling sections.
• are stand-alone database objects
• do not accept arguments.
• To create/test a trigger, user must have appropriate access to all objects referenced by a trigger
action.
• Example: To create a BEFORE INSERT trigger for the employee table requires you to have INSERT
ROW privileges for the table.

SSS Shameem June-2022


C R E AT E T R I G G E R S Y N TA X
CREATE [OR REPLACE] TRIGGER trigger_name
{BEFORE|AFTER|INSTEAD OF} triggering_event [referencing_clause] ON
{table_name | view_name}
[WHEN condition] [FOR EACH ROW]

[DECLARE
Declaration statements]
BEGIN
Executable statements
[EXCEPTION
Exception-handling statements]
END;
The trigger body must have at least the executable section.
The declarative and exception handling sections are optional.
When there is a declarative section, the trigger body must start with the DECLARE keyword.
The WHEN clause specifies the condition under which a trigger should fire.
SSS Shameem June-2022
TRIGGER TYPES

• BEFORE and AFTER Triggers – trigger fires before or after the triggering event. Applies only to
tables.
• INSTEAD OF Trigger – trigger fires instead of the triggering event. Applies only to views.
• Triggering event – a DML statement issued against the table or view named in the ON clause –
example: INSERT, UPDATE, or DELETE.
DML triggers are fired by DML statements and are referred to sometimes as row triggers.
• FOR EACH ROW clause – a ROW trigger that fires once for each modified row.
• STATEMENT trigger – fires once for the DML statement.
• Referencing_clause – enables writing code to refer to the data in the row currently being modified
by a different name.

SSS Shameem June-2022


END

SSS Shameem June-2022 MSc_BA, DoC

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy