You are on page 1of 27

Database Models

• Hierarchical database
• Networked database
• Relational database

1
Hierarchical Databases
• As its name implies, the Hierarchical Database Model
defines hierarchically-arranged data.

• You can understand this type of relationship by


visualizing an upside down tree of data.

• In this tree, a single table acts as the "root" of the


database from which other tables "branch" out.

2
Hierarchical Databases
• Relationships in such a system are thought of in terms of
children and parents such that a child may only have one
parent but a parent can have multiple children.

• Parents and children are tied together by links called


"pointers”. A parent will have a list of pointers to each of
their children.

3
Hierarchical Databases
• This child/parent rule assures that data is systematically
accessible.

• To get to a low-level table, you start at the root and work


your way down through the tree until you reach your
target.

4
Hierarchical Databases
• The hierarchical database model has some serious
problems.

• You cannot add a record to a child table until it has


already been incorporated into the parent table.

• This might be troublesome if, for example, you wanted


to add a student who had not yet signed up for any
courses.

5
Hierarchical Databases
• If there is a higher level that includes multiple courses,
there could be redundancy because students would be
enrolled in several courses and thus each "course tree"
would have redundant student information.

6
Network Databases
• The Network model solves the problem of data
redundancy.

• It is very similar to the hierarchical model actually. But


instead of using a single-parent tree hierarchy, child
tables are allowed to have more than one parent.

• This allows the network model to support many-to-many


relationships.

7
Network Databases
• In the case of a Network Database, the look is more like
several trees which share branches.

• Thus, children can have multiple parents and parents can


have multiple children
Department

Course 1 Course 2

Student

Grade 8
Relational Databases
• At the core of the relational model is the concept of a
table in which all data is stored.

• Each table is made up of records and fields.

• Each table can be identified by a unique name and that


name can be used by the database to find the table and
use it.

9
Relational Databases
• This is quite a bit different from the hierarchical and
network models in which the user needs an
understanding of how the data was structured within the
database in order to retrieve, insert, update, or delete
records from the database.

• In the relational model, operations that manipulate data


do so on the basis of the data values themselves.

• To retrieve a row from a table, you just compare the


value stored within a particular column to some search
criteria.
10
Relational Databases
• For example, you might say "Give me all the rows from
the 'STUDENTS' table which have ‘Sally' in the
'FIRST_NAME' column.“

• The database might return a list which looks essentially


like this:

Sally Sol SID-001 213-456-7890


Sally Roberts SID-268 818-934-5069
Sally Smith SID-991 310-234-6475

11
Relational Databases
• You could then use the data from a retrieved row to
query another table.

• For example, you might say "Okay, I want to know what


grade ‘Sally Sol' received in ‘Calculus 101'.

• For this use the 'Student ID‘ from the previous query as
the keyword in the next query.
• I want the row in the ‘Calculus Course' table where student
ID equals 'SID-001'.

12
MS ACCESS 2OO7

13
Objectives
• Define the terms field, record, table, relational
database, primary key, and foreign key
• Create a blank database
• Identify the components of the Microsoft
Access window
• Create and save a table in Datasheet view
• Create a simple form
• Create a simple report

14
Organizing Data
• Your first step in organizing data is to identify
the individual fields
– A set of field values is called a record
• Next, you group related fields together into
tables

15
Databases and Relationships
• A collection of related tables is called a database

• You connect the records in the separate tables through a


common field

• A primary key is a field, or a collection of fields, whose


values uniquely identify each record in a table

• When you include the primary key from one table as a


field in a second table to form a relationship between the
two tables, it is called a foreign key in the second table
16
Exploring the Microsoft Access
Window

17
Creating a Table in Datasheet View
• Create tab → Tables group → Table button

• Access places the default ID field in all tables


which acts as the primary key. You can retain
that field or define your own primary key

• Double-click the Add New Field column


heading, and then type the name for the field
you are adding to the table. Press the Tab key
or the Enter key 18
Creating a Table in Datasheet View

19
Entering Records

20
Saving a Table
• Click the Save button on the Quick Access
Toolbar. The Save As dialog box opens

• In the Table Name text box, type the name for


the table

• Click the OK button

21
Creating a Form
• A form is an object you use to enter, edit, and
view records in a database

• There are different ways of creating a form:


– You can design your own forms
– Use the Form Wizard
– Use the Form tool to create a simple form with
one mouse click

22
Creating a Simple Form

23
Creating a Report
• A report is a formatted printout (or screen
display) of the contents of one or more tables
in a database

• The Report tool places all the fields from a


selected table (or query) on a report, making
it the quickest way to create a report

24
Creating a Simple Report

25
Viewing Objects in the Navigation
Pane

26
Quiz

27

You might also like