Professional Documents
Culture Documents
• Data dictionary
management
• Data storage management
• Data access and retrieval
• Security management
DATA STORAGE
• Database data is organized in tables
• Tables consist of records and fields
• Database tables are always related to each
other
• TABLES are used to enter, store, organize and
view database data
RECORDS AND FIELDS
• A record is a row in the table that contains
information such as name, address, phone
number, etc.
• A field is a column that contains categories of
information
• NOTE: Each field in a table contains the same
type of information
AN EXAMPLE OF A DATABASE TABLE
KEY FIELDS
• A key field is a unique field in a database table
• There are three types of KEY fields namely:
– Primary key
– Composite key
– Foreign key
KEY FIELDS EXPLAINED
• PRIMARY KEY: This is a field in a database table that
uniquely identifies a record. E.g. trainee’s registration
number
• COMPOSITE KEY: This is when two or more fields are used
as a primary key. E.g. in a school database table fields such
as examination number and registration number may act
together as composite key
• FOREIGN KEY: Is a field (or fields) that point to the primary
key of another table. The purpose of the foreign key is to
ensure referential integrity of the data in the two relating
tables.
FOREIGN KEY ILLUSTRATION
Amount
RELATIONAL DATABASE
• A relational database is the one having its tables
connected (related) with each other using the key
fields
• Connection between database tables is termed as a
RELATIONSHIP
• There are three main types of relationships in
databases:-
– ONE-TO-ONE
– ONE-TO-MANY
– MANY-TO-MANY
TABLE RELATIONSHIPS
• ONE-TO-ONE RELATIONSHIP: This is when one
record in one table points (relates) to only one
record in another table
• ONE-TO-MANY RELATIONSHIP: This is when one
record in one table relates to several records in
another table
• MANY-TO-MANY RELATIONSHIP: This is when
many records in one table relate to many
records in another table
REFERENTIAL INTEGRITY
• Is the ability to maintain links between
database tables.
• In other words Referential integrity is a
database concept that ensures that
relationships between tables remain
consistent
REFERENTIAL INTEGRITY ENFORCES THE
FOLLOWING THREE RULES
1. You may not add a record to a child table
unless the mother table is filled first
2. If the primary key for a record in the mother
table is changed, all corresponding fields in the
other table must be modified using a cascading
update
3. If a record in the Mother table is deleted, all
corresponding records in the other table must
be deleted using a cascading delete
SPREADSHEET VS DATABASE
• Spreadsheet = calculator
Database = information storage/retrieval system
• The amount of data that is usually stored in a database
is way more than what is contained in a spread sheet
• A spread sheet is edited directly by people while a
database is accessed by applications that enter and
modify data
• A spread sheet is usually used for presentations and
paper works while databases are commonly used in
cases where a lot of data needs to be stored
DATA TYPES
DATA TYPE USE FOR
Text Text or combinations of text and numbers, such as addresses. Also numbers
that do not require calculations, such as phone numbers, part numbers, or
postal codes.
Yes/No Fields that will contain only one of two values, such as Yes/No, True/False,
On/Off.
EXERCISE
• What does DBMS stands for?
• Mention three examples of DBMS
• Mention three data types in
database
INDIVIDUAL TASK
1. Define database
2. Write short notes on three types of
database relationships
3. What is a key field? Mention three types
of key fields.
END OF THE SESSION