Basics and Fundamentals of Database For Level 4
Basics and Fundamentals of Database For Level 4
This module describes the skills, knowledge and attitudes to be acquired by the learner to
Analyze database requirements design and build simple database. At the end of this module the
learner will be able to describe basics and fundamentals of database and building a simple
database.
LU 1: ANALYSE DATABASE
REQUIREMENT
Database definition
Data
Data, in the context of databases, refers to all the single items that are stored in a database, either
individually or as a set. Data in a database is primarily stored in database tables, which are
organized into columns that dictate the data types stored therein. So, if the “Customers” table has
a column titled “Telephone Number,” whose data type is defined as “Number,” then only
numerals can be stored in that column.
Data is a collection of facts, such as numbers, words, measurements, observations or just
descriptions of things.
Qualitative vs Quantitative
Database
A Database is a collection of related data organized in a way that data can be easily accessed,
managed and updated. Database can be software based or hardware based, with one sole
purpose, storing data.
Entities
An entity can be a real-world object, either animate or inanimate, that can be easily identifiable.
For example, in a school database, students, teachers, classes, and courses offered can be
considered as entities. All these entities have some attributes or properties that give them their
identity.
TEACHER 1
An entity set is a collection of similar types of entities. An entity set may contain entities with
attribute sharing similar values. For example, a Students set may contain all the students of a
school; likewise a Teachers set may contain all the teachers of a school from all faculties. Entity
sets need not be disjoint.
Attributes
An attribute is a property or characteristic of an entity. An entity may contain any number of
attributes. One of the attributes is considered as the primary key. In an Entity-Relation model,
attributes are represented in an elliptical shape.
Example: Student has attributes like name, age, roll number and many more. To uniquely identify
the student, we use the primary key as roll number as it is not repeated. Attributes can also be
subdivided into another set of attributes.
There are five such types of attributes: Simple, Composite, Single-valued, Multi-valued, and
Derived attribute.
These are explained as following below.
1. Simple attribute:
An attribute which cannot be further subdivided into components is a simple attribute.
Records
TEACHER 2
A record is a database entry that may contain one or more values. Groups of records
are stored in a table, which defines what types of data each record may contain.
Databases may contain multiple tables which may each contain multiple records.
Records are often called rows since each new record creates a new row in the table.
Relational database
A relational database is a type of database that stores and provides access to data points that are
related to one another. Relational databases are based on the relational model, an intuitive,
straightforward way of representing data in tables. In a relational database, each row in the table
is a record with a unique ID called the key. The columns of the table hold attributes of the data,
and each record usually has a value for each attribute, making it easy to establish the
relationships among data points.
Hierarchical database
A hierarchical model represents the data in a tree-like structure in which there is a single parent
for each record. To maintain order there is a sort field which keeps sibling nodes into a recorded
manner. These types of models are designed basically for the early mainframe database
management systems, like the Information Management System (IMS) by IBM.
Data in this type of database is structured hierarchically and is typically developed as an inverted
tree. The "root" in the structure is a single table in the database and other tables act as the
branches flowing from the root. The diagram below shows a typical hierarchical database
structure.
TEACHER 3
Network database
A network database model is a database model that allows multiple records to be linked to the
same owner file. The model can be seen as an upside down tree where the branches are the
member information linked to the owner, which is the bottom of the tree. The multiple linkages
which this information allows the network database model to be very flexible. In addition, the
relationship that the information has in the network database model is defined as many-to-many
relationship because one owner file can be linked to many member files and vice versa.
TEACHER 4
Object oriented model
The ODBMS which is an abbreviation for object oriented database management system, is the
data model in which data is stored in form of objects, which are instances of classes. These classes
and objects together makes an object oriented data model.
Database relationships
One to One
In a one-to-one relationship, one record in a table is associated with one and only one record in
another table. For example, in a school database, each student has only one student ID, and each
student ID is assigned to only one person.
One to Many
A one-to-many relationship in a database occurs when each record in Table A may have many
linked records in Table B, but each record in Table B may have only one corresponding record in
Table A.
Many to Many
A many-to-many relationship occurs when multiple records in a table are associated with
multiple records in another table. For example, a many-to-many relationship exists between
customers and products: customers can purchase various products, and products can be
purchased by many customers.
Many to One
Many-to-One relationship occurs when multiple records in a table are associated with one
record in another table. For example a project can have more than one student working on it. A
team of five students in a college in assigned a project that they need to complete in let us say
one month.
TEACHER 5
What is Data Collection?
Interview
An interview is a face-to-face conversation between two individuals with the sole purpose of
collecting relevant information to satisfy a research purpose.
Pros
In-depth information
Freedom of flexibility
Accurate data.
Cons
Time-consuming
Expensive to collect
Documentation
Document review is a way of collecting data by reviewing existing documents. The documents
may be internal to a program or organization (such as records of what components of an asthma
management program were implemented in schools) or may be external (such as records of
emergency room visits by students served by an asthma management program).
Pros
Relatively inexpensive
Good source of background information
Provides a behind-the-scenes look at a program that may not be directly
observable
May bring up issues not noted by other means
Cons
TEACHER 6
Questionnaire
This is the process of collecting data through an instrument consisting of a series of questions
and prompts to receive a response from individuals it is administered to.
Pros
Cons
Observation
This is a data collection method by which information on a phenomenon is gathered through
observation.
Pros
Easy to administer.
There subsists a greater accuracy with results.
It is a universally accepted practice.
It diffuses the situation of an unwillingness of respondents to administer a report.
It is appropriate for certain situations.
Cons
TEACHER 7
Types of requirements
Functional requirements
What is a Functional Requirement?
A Functional Requirement (FR) is a description of the service that the software must offer. It
describes a software system or its component. A function is nothing but inputs to the software
system, its behavior, and outputs. It can be a calculation, data manipulation, business process,
user interaction, or any other specific functionality which defines what function a system is
likely to perform. Functional Requirements are also called Functional Specification.
Helps you to check whether the application is providing all the functionalities that were
mentioned in the functional requirement of that application
A functional requirement document helps you to define the functionality of a system or
one of its subsystems.
Functional requirements along with requirement analysis help identify missing
requirements. They help clearly define the expected system service and behavior.
Errors caught in the Functional requirement gathering stage are the cheapest to fix.
Support user goals, tasks, or activities
Business rules
What do you want your system to do? What are the features you need so you can achieve your
goals?
These requirements examine every transaction’s entry, changing, deleting, canceling, and error
checking.
Authentication functions
They concern the information users share with the system and their authentication level.
Authorization levels
TEACHER 8
These functions determine various system access levels and decide who can CRUD (change,
read, update, or delete) information.
Audit tracking
External interfaces
These functions concern the external interface of systems other than the main system.
Certification requirements
Your organization might require certifications to work on the system, such as security
certifications.
Searching/reporting requirements
This section of requirements will tell you how users can search and retrieve data.
Historical data
You will have a growth of data if your database is dynamic, so you need to define storage
requirements to accommodate these data.
Archiving
Your system’s data may grow beyond your storage capacity, so the projects must have the
capability to archive the data for long-term storage.
These are laws, regulations from the government, and even internal policies that the
organizations and their systems must follow.
Algorithms
Algorithms capture any formulas or manipulations of data elements that need to occur.
Database
The elements and formats you should use when defining what data needs storing in a system.
TEACHER 9
You will need this function in case your system crashes and wipes out all your data.
The software automatically validates customers against the ABC Contact Management
System
The Sales system should allow users to record customers sales
The background color for all windows in the application will be blue and have a
hexadecimal RGB color value of 0x0000FF.
Only Managerial level employees have the right to view revenue data.
The software system should be integrated with banking API
Non-functional requirements
In other words, a non-functional requirement will describe how a system should behave and what
limits there are on its functionality.
TEACHER 10
1. Emails should be sent with a latency of no greater than 12 hours.
2. Each request should be processed within 10 seconds.
3. The site should load in 3 seconds when the number of simultaneous users are > 10000
Records or Rows
A row of data is the collection of all the columns in a table associated with a single occurrence.
Simply speaking, a row of data is a single record in a table. For example, if there are 25,000
book titles with which a bookstore deals, there will be 25,000 records, or rows of data, in the
book titles table once the table is populated.
Fields or Columns
A column, or field, is a specific category of information that exists in a table.
TEACHER 11
Varchar – as the name implies is variable character as the memory storage has variable
length. Each character occupies one byte of space plus 2 bytes for length
information.Note: Use Character for data entries with fixed length, like phone number.
Use Varchar for data entries with variable length, like address.
Boolean – is used for creating true or false statements.
Date, Time and Timestamp – these data types are used to work with data containing
dates and times.
LU 2: DESIGN DATABASE
TEACHER 12