IPT Year 12 how to design database

13
IPT YEAR 12 RELATIONAL DATABASE How to create a conceptual schema (CS) diagram using NIAM steps with an example ‘problem’ Mrs. Schneider May 2012

Transcript of IPT Year 12 how to design database

IPT YEAR 12

RELATIONAL DATABASE

How to create a conceptual schema (CS) diagram using

NIAM steps with an example ‘problem’

Mrs. Schneider

May 2012

NIAM STEPS

1. State the elementary facts

2. Draw the first draft conceptual schema (CS) diagram.

3. Remove surplus entities and indicate derived facts.

4. Add uniqueness constraints

5. Add mandatory roles and cardinality constraints

6. Check that conceptual schema can be populated by examples given

BUSINESS ‘PROBLEM’

Nurture Nursery

specializes in native

plants. The business

requires a computerised

system that includes

functionality for

inventory control and

production of

identification tags.

PLANT DATA

For each plant the system will need to store:

biological name

common name

maximum growth height in metres

colour of flowers

the time of year for flowering

picture of the plant.

The identification tags will need to carry all this information.

MORE INFORMATION

The plants are sold in four pot sizes (1 to 4), which have a corresponding retail price ($4, $5, $6, $8). The number of each plant in each pot size will also need to be stored.

The nursery requires a simple way of updating stock numbers when plants are sold or stock replenished. The new stock most often comes in orders of a particular plant, but the business sometimes replenishes all stock by ordering a set quantity of all No. 1 size pots.

STATE THE ELEMENTARY FACTS

Plant with Biological name

Has

Common Name of

Plant with Biological name

Has

Maximum Height with metres

Plant with Biological name

Has

Flower Colour with description

Plant with Biological name

Has

Flowering Time with description

Plant with Biological name

Has

Appearance described by the picture

Plant with Biological name

Is in

Pot Size with number

Combination (Plant – Pot Size)

Has

Quantity in Stock with number

Combination (Plant – Pot Size)

Has

Total Value with $

Pot Size with number

Has

Price with $

DRAW THE DRAFT CONCEPTUAL SCHEMA

ADD UNIQUENESS CONSTRAINTS & MANDATORY

ROLES

DRAW LOOPS AROUND THE ROLES

OPTIMAL NORMAL FORM

ESTABLISH TABLES

RELATIONAL SCHEMA

WHAT IS NEXT IN THIS PROCESS?

After creating the conceptual schema you

would

start to create table definitions (planning how you

will create the tables)

Draw draft forms (interfaces)

Possibly create an information flow diagram

Create the database within Access, Oracle etc.