You are on page 1of 25

Database

Prof. Dr. Sc. Marina iin-ain

Database
A database is an organized collection
of data that are placed in one or
more tables, together with metadata which help the use of data
Sometimes we use term database to
software that is used to create and
use databases

A database management
system (DBMS)
This are computer programs that:
create,
maintain and
use
a database.

What is the purpose of


databases?
Avoid redundancy
Provide the integrity of
data

The data base


management software

Access
DB3+ (for MS DOS)
Oracle (for Unix i Linux)
Clipper (for MS DOS)
FoxBase+ (for Pc i Macintosh)
Paradoks for Windows
4-th dimension (for Macintosh)
DB 2 for OS/400 and AIX

The database developement


steps
Which base? - Which data - How many tables?

Primary key --- Creation of tables --- Queries

Forms --- Reports --- automatization

Databse development
Entity-relationship chart (helps
to decie which data belong in
which table)
Data normalization (Normalized
data are more suitable for being
procesed, for keeping data
integrity and to avoid data
redundancy)

Entity-relationship
chart

Entity-relationship chart
(Case study)
Imagine that we are creating a database for a company
that is providing newspapers for the news-stands.
The data in data base will be:
The name of newspapers, the name of news-stand
owner, the price, the quantity of ordered newspapers
(Which differs from day to day, form stand to stand and
from newspaper to newspaper.)
The assignment is to create the database. What data will
be primary key, and how many tables will be created?

Identify the entities:

Newspapers
Stand owners

What is the relationship


between them?

How many newspapers orders an


stand owner?
How many stand owners order a
newspaper?
n

Some basic terms:

What are data?


What are informtions?
What are atributs?

Data, atribut, entity, record, information


Owner
number

Owner name

01

Mujo

02

Haso

03

Suljo

04

Fata

05

Toni

06

Foka

Entity = table, in this case Owner

Podatak, atribut, slog, informacija


ifra kupca Naziv kupca
01

Mujo

02

Haso

03

Suljo

04

Fata

05

Toni

06

Foka

Koliko imamo slogova u ovoj tablici?

Data, atribut, record, information


Owner number

Owner name

01

Mujo

02

Haso

03

Suljo

04

Fata

05

Toni

06

Foka

What is an information?

What is the mistake in using


terms in this case study?
Imagine that we are creating a database for a
company that is providing newspapers for the
news-stands.
The data in data base will be:
The name of newspapers, the name of news-stand
owner, the price, the quantity of ordered
newspapers (Which differs from day to day, form
stand to stand and from newspaper to newspaper.)
The assignment is to create the database. What
data will be primary key, and how many tables will
be created?

Correct is:
Imagine that we are creating a database for a
company that is providing newspapers for the
news-stands.
The atributes in data base will be:
The name of newspapers, the name of news-stand
owner, the price, the quantity of ordered
newspapers (Which differs from day to day, form
stand to stand and from newspaper to newspaper.)
The assignment is to create the database. What
atributes will be primary key, and how many tables
will be created?

Dijagram objekt veza


Zamislite da radimo bazu za jedno trgovako poduzee, koje
opskrbljuje novinama maloprodajne kioske.
Podaci koji e biti u bazi su:

to bi bilo ispravno rei?

Naziv proizvoda, naziv kupca, cijena


proizvoda, koliina koju dnevno naruuje
kupac, a koja se moe razlikovati od dana do
dana.
Potrebno je napraviti bazu. Prvi korak je odluiti koliko e biti tablica
i koji podaci idu u koju tablicu.

Where belong the atributes?


What will be the primary key?
?
?

Where to put the dayly order quantity?


We added the keys

In n:n case we have to add a new entity to conect the tables.

The new table has two foreign keys

What is next

data normalisation
database creation
input of data
the use of database
enhance of database

You might also like