OIT 111: FUNDAMENTALS OF
INFORMATION SYSTEMS
DATABASE SYSTEMS
What is a database?
• A database is an organized collection of data.
Like other components of an information
system, a database should help an
organization achieve its goals.
• A database can contribute to organizational
success by providing managers and decision
makers with timely, accurate, and relevant
information based on data.
Database Management System (DBMS)
• Is a software program that enables the creation and
management of databases.
• Generally, these databases will be more complex than
the text file/spreadsheet example in the previous
lesson.
• In fact, most of today's database systems are referred
to as a Relational Database Management System
(RDBMS), because of their ability to store related data
across multiple tables.
• Eg. MS Access, MySQL, PostgreSQL, Oracle etc.
The Hierarchy of Data
• Data is generally organized in a hierarchy that begins with the
smallest piece of data used by computers (a bit) and progresses
through the hierarchy to a database
• Bits can be organized into units called bytes.
• A byte is typically eight bits
• Each byte represents a character which is the basic building block
of information. A character can be an uppercase letter (A, B, C…
Z), lowercase letter (a, b, c… z), numeric digit (0, 1, 2… 9), or
special symbol (., !, [+], [-], /, …)
• A field is typically a name, number, or combination of characters
that describes an aspect of a business object (such as an
employee, a location, or a truck) or activity (such as a sale).
• A record a collection of related data fields
• A file is a collection of related records
• So the hierarchy of data - Bits, characters,
fields, records, files, and databases.
Database Terms
Table/Relation
• A table is responsible for storing data in the database.
• Database tables consist of rows and columns.
• A row contains each record in the table, and the
column is responsible for defining the type of data
that goes into each cell.
• Therefore, if we need to add a new person to a table,
we would create a new row with the person's details.
Queries
• Show the data in a Table format. A Query can pull from
one or multiple Tables and allow you to limit the
display by using criteria to limit the records (rows) and
showing only the fields (columns) you want.
• A "query" refers to the action of instructing the
database to return some (or all) of the data in your
database.
• In other words, you are "querying" the database for
some data that matches a given criteria.
Forms
• Can be created to provide a "user-friendly"
side to your database.
• They are used to view and enter data in an
interactive formatted structure
Reports
• Are created to print out your data in a
formatted structure.
Data types
• Defines the kind of data that an attribute can
hold;
• For example,
String Character Text
Decimal Integer binary
Date DateTime TimeStamp
Data Entities, Attributes, and Keys
• An entity is a generalized class of people, places, or things
(objects) for which data is collected, stored, and maintained
• An attribute is a characteristic of an entity. For example, employee
number, last name, first name, hire date, and department number
are attributes for an employee
• The specific value of an attribute, called a data item, can be found
in the fields of the record describing an entity
• Key a field or set of fields in a record that is used to identify the
record
• Primary key is a field or set of fields that uniquely identifies the
record.
• Candidate Key any key that can be selected to be a primary key
Alternate Keys candidate keys that are not
selected to be primary key.
Foreign Key
• Attribute, or set of attributes, within one
table/relation that matches candidate key of
some other (possibly same) relation/table.
• These keys are used to create relationships
between tables
DATA MODELING
• One of the tools database designers use to
show the logical relationships among data is a
data model
• A data model is a diagram of entities and their
relationships.
• Data modeling usually involves understanding a
specific business problem and analyzing the
data and information needed to deliver a
solution
Entity Relationship Diagram-ERD
• Entity-relationship (ER) diagrams use basic
graphical symbols to show the organization of
and relationships between data.
• In most cases, boxes in ER diagrams indicate
data items or entities contained in data tables,
and diamonds show relationships between
data items and entities. In other words, ER
diagrams show data items in tables (entities)
and the ways they are related.
Some Terms used
1. Relationship
 An association between one or more entities.
Types of relationship:
 One to One (Represented in an ERD as 1:1)
 One to Many, or Many to One (Represented in an ERD as
1:N or N:1 respectively).
 Many to Many (Represented in an ERD as M:N)
Diamonds are normally used to represent
relationships.
Cardinality
• Cardinality defines the number of occurrences of one
entity for a single occurrence of the related entity
• Cardinality ERD notation
Metadata
• Data that describes other data
Notations/Symbols
Steps in Drawing an ERD
1. Define Entities: These are usually nouns that
represent tables during the design stage
2. Determine the Attributes for each entity
3. Determine the Primary Keys from the group of
attributes.
4. Find the relationship and cardinality among each
entity (these are usually verbs)
5. Represent that information on a paper with symbols.
6. Draw the logical tables using the ERD above.
7. Design the database using the logical table.
Example
Case Study
Mwananyamala hospital has a number of wards each
assigned with a unique number, a name and number of
beds. It also has doctors and nurses who are given
special numbers each, their names, addresses, phone
numbers, sex, marital status and date of birth. One or
more doctors, like nurses, are assigned to attend a ward.
Patients are also identified by identity number given at
registration office, their full names, address, sex, date of
birth and next-of-kin information are collected and one
nurse and one doctor is responsible for each patient.
Question
a) Using the case study above, identify all
entities and their related attributes.
b) Using results from (a) above draw a neat ER-
Diagram.

Module 3 Database systems for DIPLOMA.pptx

  • 1.
    OIT 111: FUNDAMENTALSOF INFORMATION SYSTEMS DATABASE SYSTEMS
  • 2.
    What is adatabase? • A database is an organized collection of data. Like other components of an information system, a database should help an organization achieve its goals. • A database can contribute to organizational success by providing managers and decision makers with timely, accurate, and relevant information based on data.
  • 3.
    Database Management System(DBMS) • Is a software program that enables the creation and management of databases. • Generally, these databases will be more complex than the text file/spreadsheet example in the previous lesson. • In fact, most of today's database systems are referred to as a Relational Database Management System (RDBMS), because of their ability to store related data across multiple tables. • Eg. MS Access, MySQL, PostgreSQL, Oracle etc.
  • 4.
    The Hierarchy ofData • Data is generally organized in a hierarchy that begins with the smallest piece of data used by computers (a bit) and progresses through the hierarchy to a database • Bits can be organized into units called bytes. • A byte is typically eight bits • Each byte represents a character which is the basic building block of information. A character can be an uppercase letter (A, B, C… Z), lowercase letter (a, b, c… z), numeric digit (0, 1, 2… 9), or special symbol (., !, [+], [-], /, …) • A field is typically a name, number, or combination of characters that describes an aspect of a business object (such as an employee, a location, or a truck) or activity (such as a sale).
  • 5.
    • A recorda collection of related data fields • A file is a collection of related records • So the hierarchy of data - Bits, characters, fields, records, files, and databases.
  • 6.
    Database Terms Table/Relation • Atable is responsible for storing data in the database. • Database tables consist of rows and columns. • A row contains each record in the table, and the column is responsible for defining the type of data that goes into each cell. • Therefore, if we need to add a new person to a table, we would create a new row with the person's details.
  • 7.
    Queries • Show thedata in a Table format. A Query can pull from one or multiple Tables and allow you to limit the display by using criteria to limit the records (rows) and showing only the fields (columns) you want. • A "query" refers to the action of instructing the database to return some (or all) of the data in your database. • In other words, you are "querying" the database for some data that matches a given criteria.
  • 8.
    Forms • Can becreated to provide a "user-friendly" side to your database. • They are used to view and enter data in an interactive formatted structure Reports • Are created to print out your data in a formatted structure.
  • 9.
    Data types • Definesthe kind of data that an attribute can hold; • For example, String Character Text Decimal Integer binary Date DateTime TimeStamp
  • 10.
    Data Entities, Attributes,and Keys • An entity is a generalized class of people, places, or things (objects) for which data is collected, stored, and maintained • An attribute is a characteristic of an entity. For example, employee number, last name, first name, hire date, and department number are attributes for an employee • The specific value of an attribute, called a data item, can be found in the fields of the record describing an entity • Key a field or set of fields in a record that is used to identify the record • Primary key is a field or set of fields that uniquely identifies the record. • Candidate Key any key that can be selected to be a primary key
  • 11.
    Alternate Keys candidatekeys that are not selected to be primary key. Foreign Key • Attribute, or set of attributes, within one table/relation that matches candidate key of some other (possibly same) relation/table. • These keys are used to create relationships between tables
  • 12.
    DATA MODELING • Oneof the tools database designers use to show the logical relationships among data is a data model • A data model is a diagram of entities and their relationships. • Data modeling usually involves understanding a specific business problem and analyzing the data and information needed to deliver a solution
  • 13.
    Entity Relationship Diagram-ERD •Entity-relationship (ER) diagrams use basic graphical symbols to show the organization of and relationships between data. • In most cases, boxes in ER diagrams indicate data items or entities contained in data tables, and diamonds show relationships between data items and entities. In other words, ER diagrams show data items in tables (entities) and the ways they are related.
  • 14.
    Some Terms used 1.Relationship  An association between one or more entities. Types of relationship:  One to One (Represented in an ERD as 1:1)  One to Many, or Many to One (Represented in an ERD as 1:N or N:1 respectively).  Many to Many (Represented in an ERD as M:N) Diamonds are normally used to represent relationships.
  • 15.
    Cardinality • Cardinality definesthe number of occurrences of one entity for a single occurrence of the related entity • Cardinality ERD notation
  • 16.
    Metadata • Data thatdescribes other data
  • 17.
  • 18.
    Steps in Drawingan ERD 1. Define Entities: These are usually nouns that represent tables during the design stage 2. Determine the Attributes for each entity 3. Determine the Primary Keys from the group of attributes. 4. Find the relationship and cardinality among each entity (these are usually verbs) 5. Represent that information on a paper with symbols. 6. Draw the logical tables using the ERD above. 7. Design the database using the logical table.
  • 19.
    Example Case Study Mwananyamala hospitalhas a number of wards each assigned with a unique number, a name and number of beds. It also has doctors and nurses who are given special numbers each, their names, addresses, phone numbers, sex, marital status and date of birth. One or more doctors, like nurses, are assigned to attend a ward. Patients are also identified by identity number given at registration office, their full names, address, sex, date of birth and next-of-kin information are collected and one nurse and one doctor is responsible for each patient.
  • 20.
    Question a) Using thecase study above, identify all entities and their related attributes. b) Using results from (a) above draw a neat ER- Diagram.