0% found this document useful (0 votes)
92 views2 pages

Database Fundamental (TIS 1101 Tutorial 9

The document discusses the database life cycle (DBLC) which includes 6 phases: initial study, design, implementation, testing/evaluation, operation, and maintenance/evolution. It also lists the 8 steps required to develop an entity relationship (ER) diagram which includes identifying business rules, entities, relationships, attributes, normalization, and user verification. The extra exercises discuss triggers in SQL - updating product minimums, rewriting a trigger to also update reorders, and creating a new trigger to set discounts automatically on item insertion.

Uploaded by

Blackk Worldz
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)
92 views2 pages

Database Fundamental (TIS 1101 Tutorial 9

The document discusses the database life cycle (DBLC) which includes 6 phases: initial study, design, implementation, testing/evaluation, operation, and maintenance/evolution. It also lists the 8 steps required to develop an entity relationship (ER) diagram which includes identifying business rules, entities, relationships, attributes, normalization, and user verification. The extra exercises discuss triggers in SQL - updating product minimums, rewriting a trigger to also update reorders, and creating a new trigger to set discounts automatically on item insertion.

Uploaded by

Blackk Worldz
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/ 2

(Database Fundamental (TIS 1101

Tutorial 9

1. List down the phases in the DBLC and briefly discuss the activities for each
phase.

a) Database initial study d) Testing and evaluation


 Analyze the company situation  Test the database
 Define problems and constraints  Fine-tune the database
 Define objectives  Evaluate the database and its
 Define scope and boundaries application programs

b) Database design e) Operation


 Create the conceptual design  Produce the required information flow
 DBMS software selection
 Create the logical design f) Maintenance and evolution
 Create the physical design  Introduce changes
 Make enhancements
c) Implementation and loading
 Install the DBMS
 Create the database
 Load or convert the data

2. List down the steps required in the development of an ER diagram.

:The steps required in the development of an ER diagram are listed below


a) Identify, analyze, and refine the business rules.
b) Identify the main entities using the results of step (a).
c) Define the relationships among the entities, using the results of step (a) and step
(b).
d) Define the attributes, primary keys, and foreign keys for each of the entities.
e) Normalize the entities.
f) Complete the initial ER diagram.
g) Have the main end users verify the model in the step (f) against the data,
information, and processing requirements.
h) Modify the ER diagram, using the results of step (g).
Extra Exercises – Triggers :

1. Execute a SQL statement that changes p_min of a product


to be above the p_onhand value. Will any of the triggers be activated?

UPDATE Product
SET P_MIN = 20
WHERE P_CODE = ‘A0003’;

2. Remove the trigger reorder1 using the command ‘DROP


TRIGGER REORDER1’. Rewrite the trigger so that p_reorder is also updated when
p_onhand is less than p_min_order. Create and test the trigger.

create trigger reorder1


after insert on product
for each row mode db2sql
update product
set p_reorder = 1
where (p_onhand <= p_min) or (p_onhand <= p_min_order);

3. Create a new trigger that will set the discount of an item


automatically when a new item record is inserted. The discount is 0.05 for item below
15.00 and 0.10 for 15.00 and above.

create trigger discount


no cascade before insert on product
referencing new as n
for each row mode db2sql
set n.p_discount=
case
when p_price>=15.00
then 0.1
when p_price<15.00
then 0.05
end

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