Lesson Notes By Weeks and Term - Junior Secondary School 3

DATABASE

SUBJECT: HOME ECONOMICS

CLASS:  JSS 3

DATE:

TERM: 1st TERM

 

 
WEEK 7-8

TOPIC: DATABASE

FOR WEEKS 7-8

What is a database?

  1. A database is a collection of information organized to provide efficient retrieval. 
  2. A database is a set of data that has a regular structure and that is organized in such a way that a computer can easily find the desired information.

What is database management system?

A database management system (DBMS)A software package that allows for the creation, storage, maintenance, manipulation, and retrieval of large datasets distributed over one or more files. is a software package that allows for the creation, storage, maintenance, manipulation, and retrieval of large datasets that are distributed over one or more files

TYPES OF DATABASE

Five main types of database organization: 

  1. Flat database
  2. Hierarchical  database
  3. Relational  database
  4. Object-oriented database
  5. Network database

FLAT-FILE DATABASE

A flat-file  database is one that only contains a single table of data.   

A flat –file databaseA database model whereby all data are stored in a single table. is a database whereby all data are stored in a single, large table.

 Below is an example of how our database might look built around a flat file model? The table is separated into rows and columns. A single column represents an attribute, and a single row represents a record in this database. The table below is an example of a flat file database.

Player ID

First Name

Last Name

Address

Club

League

101

Ryan

Giggs

15 Meade Lane

Manchester United

Premier

102

Frank

Lampard

16 Rope Street

Chelsea

Premier

103

Steven

Gerrard

17 Camel Lane

Liverpool

Premier

104

Adel

Taarbt

18 Leather Lane

QPR

Championship

105

Martin

John

19 Apple Grove

GardffCity 

Championship

Another example is the table that shows the properties of seven fishes such as habitat, color, and speed and caretaker schedule table. Since some animals can live on land or in water, two columns are needed for the Habitat properties. Similarly, three columns are needed for the Color properties. This leads to the flat file database shown in the following figure.

Name

Habitat1

Habibat2

Color1

Color2

Color3

Speed

Caretaker schedule

Dolphin

Water

 

Grey

  

Fast

Mary:(6-8am,3-6pm)

Duck

Land

Water

Brown

Green

Grey

Slow

Joe: (10am-4pm)

Fish

Water

 

White

  

Fast

Joe: (10am-4pm)

Grog

Land

Water

Green

  

Slow

Joe: (10am-4pm)

Horse

Land

 

Black

Brown

White

Fast

Alex:( 6-7am,3-4pm)

Ladybug

Land

 

Black

Red

 

Slow

Mary:(6-8am,3-6pm)

Lion

Land

 

Yellow

  

Fast

Alex :( 6-7am,3-4pm)

 

RELATIONAL DATABASE

A relational database is the type of database that contains two or more tables of data, connected by links called relationship.

A relational database A software package that records information in such a way that data can be accessed without reorganization of the tables.is a collection of tables that are connected in such a way that that data can be accessed without reorganization of the tables. The tables are created such that each column represents a particular attribute.

Practice your understanding of databases by answering the following questions:

  1. Which animals can live on land and are red? 
  2. Which animals are slow and either black or grey? 
  3. Which animals are fast and can live on land and are not yellow? 

 

A HIERARCHICAL DATABASE

Meaning 

  1. A   hierarchical databaseA simple database model that organizes data into a “one-to-many” association across levels. is also a database model that organizes data into a “one-to-many” association across levels.  Consider a company's organizational structure. At the top we have a General Manager (GM). Under him we have several Deputy General Managers (DGMs). Each DGM looks after a couple of departments and each department will have a manager and many employees. When represented in hierarchical model, there will be separate rows for representing the GM, each DGM, each department, each manager and each employee. The row position implies a relationship to other rows. A given employee belongs to the department that is closest above it in the list and the department belongs to the manager that is immediately above it in the list and so on as shown.

ADVANTAGES OF HIERARCHICAL DATABASE

  1. Simplicity: Data naturally have hierarchical relationship in most of the practical situations. Therefore, it is easier to view data arranged in manner. 
  2. Security: This database system can enforce varying degree of security feature unlike flat-file system. 
  3. Database Integrity: Because of its inherent parent-child structure, database integrity is highly promoted in these systems. 
  4. Efficiency: The hierarchical database model is a very efficient, one when the database contains a large number of I: N relationships (one-to-many relationships) and when the users require large number of transactions, using data whose relationships are fixed. 

 

DISADVANTAGES OF HIERARCHICAL DATABASE

  1. Complexity of Implementation: The actual implementation of a hierarchical database depends on the physical storage of data. This makes the implementation complicated. 
  2. Difficulty in Management: The movement of a data segment from one location to another cause all the accessing programs to be modified making database management a complex affair. 
  3. Complexity of Programming: Programming a hierarchical database is relatively complex because the programmers must know the physical path of the data items. 
  4. Poor Portability: The database is not easily portable mainly because there is little or no standard existing for these types of database. 
  5. Database Management Problems: If you make any changes in the database structure of a hierarchical database, then you need to make the necessary changes in all the application programs that access the database. Thus, maintaining the database and the applications can become very difficult. 
  6. Lack of structural independence: Structural independence exists when the changes to the database structure does not affect the DBMS's ability to access data. 
  7. Programs Complexity: Due to the structural dependence and the navigational structure, the application programs and the end users must know precisely how the data is distributed physically in the database in order to access data. 
  8. Operational Anomalies: A hierarchical model suffers from the Insert anomalies, Update anomalies and Deletion anomalies, also the retrieval operation is complex and asymmetric, and thus hierarchical model is not suitable for all the cases. 
  9. Implementation Limitation: Many of the common relationships do not conform to the l: N format required by the hierarchical model. The many-to-many (N: N) relationships, which are more common in real life are very difficult to implement in a hierarchical model. 

Network database

The network model  is the type of database that allows many-to-many relationships in a tree-like structure that allows multiple parents.




TERMINOLOGIES USED IN DATABASE

  1. A field
  2. A record
  3. A file
  4. A key 

A FIELD

 A field is an item of stored data. A field could be a name, an address, city, State and country

 

Name

Address

City 

State 

Country 

Josephine

7,Accord St

Lagos

Lagos

Nigeria

From the table above:

 

Josephine is a filed

  1. Accord Street is a field

Lagos is filed

Lagos (City) is a field

Nigeria is a filed 

 

A RECORD

A record is the collection of fields that relate to a single entity

For example, we could have a student record that includes fields for the student’s name, address, homeroom, date of birth.

Example: A complete name and address.

Last name

Address

Date of birth

State 

Country 

Godwin

7,Pipeline St

Lagos

Kaduna

Nigeria

 

A FILE

 A file is a collection of related records. For example, a student file might include all of the records of students enrolled at a school.

Admission NO

First Name

Last name

Address

Date of birth

State 

Country 

001

Olaniyi 

Titilayo 

7,Pipeline St

23/10/2001

Kaduna

Nigeria

002

James

Matthew

25 Accord St

15/6/1998

Lagos

Ghana

003

Godwill

Jonathan

13 Powerline St

06/12/1976

Kano

Congo 

 

A key field is a field in a data file containing information capable of uniquely identifying a record in relation to all other records in the same data file.





WEEK 9-10

TOPIC: SPREADSHEET

FOR WEEK 9-10

Meaning of Spreadsheet package

A spreadsheet package is application software that is made of horizontal (columns) and vertical (rows) which is used in data analysis and calculation. 

A spreadsheet is made up of three things: rows, columns and their intersections are called cells. Columns are typically labelled using letters (A, B, C, D,) and rows are typically labelled using numbers (1, 2, 3, 4,). An intersection of a column and a row makes a cell in a spreadsheet

USES OF SPREADSHEET PACKAGES

The following are the uses of spreadsheet

  1. It is used for  preparation  of budget
  2. It is used for analysis of daily sales
  3. It is used for   preparation  of examination results
  4. It is used for  chart creation  (Bar chart and pie chart)
  5. It is used for managing inventory for a small  business

EXAMPLES OF SPREADSHEET

  1. Google Docs Spreadsheets, 
  2. Open Office Calc spreadsheet
  3.  Microsoft Excel spreadsheet
  4.  Lotus 1-2-3  
  5. Corel Quattro Pro

SPREADSHEET FEATURES AND TERMINOLOGIES

There are various spreadsheet terminologies .These are:

  1. Column
  2. Row
  3. Cell
  4. Cell address
  5. range
  6. Worksheet
  7. Workbook
  8. Function 
  9. Formula

A COLUMN 

A column is a range of cells that extending from top to down (vertical) in a spreadsheet or worksheet.   Columns are labeled with letters, for example, column A, column B.  The highlighted part of the spreadsheet is a column, and it is labeled B.

A  ROW

 A row is the horizontal range of cells that go across the spreadsheet/worksheet from left to right. Numbers are used to label each row’s location.  The highlighted part of the spreadsheet is a row, and it is labeled 3.

A  CELL 

A cell is the space where a specified row and column intersect.  Each CELL is assigned a name according to its COLUMN letter and ROW number.  The highlighted part of the spreadsheet is a cell, and it is labeled C3.  When naming a cell, you should put the column first and the row second. A cell can contain a value (number), a formula (simple math or more complex formulas called functions).

 

CELL ADDRESS OR CELL REFERENCE: 

Cell address or cell reference is a cell  

 

A RANGE

A range is a group of selected cells which can be next to one another (adjacent) or non-adjacent.  

Ranges are identified by cell references e.g. A1:B6 or a name e.g. sales_table.

 

Labels: (Text with no numerical value) Column A and Row 1 are labels because they contain text.  They help identify what we are talking about.

 Values: These are numbers insert in each cell of a spreadsheet or worksheet: 

WORKSHEET OR SPREADSHEET

A worksheet is a single sheet (page) of rows and columns in a workbook. A worksheet consists of all of the cells on that single sheet.

WORKBOOK

A workbook is a collection of worksheets which are stored together in a single file and given a single name.   Workbooks can contain links between different worksheets.

FORMULA

A set of instructions to manipulate the contents of other cells. These operations can be simple arithmetic operations, or more complex ones. An example would be: + (B1/B4) to divide the value found in cell B1 by the value found in cell B4.

FUNCTION 

A function is a pre-written formula that makes complex formulas easier to write. They are distinguished from regular formulas by the name of the function. For example the formula=SUM (B1:B4) would add each value in the column B from row 1 to row 4

 



© Lesson Notes All Rights Reserved 2023