0% found this document useful (0 votes)
8 views8 pages

U3 G 11

Unit 3 covers database management, contrasting file-based data management with the database approach, which utilizes a Database Management System (DBMS) for better data organization and access. It discusses data models, including entities, attributes, and relationships, and introduces the Entity Relationship Diagram (ERD) and relational data models. Additionally, it provides practical guidance on creating and managing databases using Microsoft Access, including table creation, queries, and data retrieval from multiple tables.

Uploaded by

awelhaile31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views8 pages

U3 G 11

Unit 3 covers database management, contrasting file-based data management with the database approach, which utilizes a Database Management System (DBMS) for better data organization and access. It discusses data models, including entities, attributes, and relationships, and introduces the Entity Relationship Diagram (ERD) and relational data models. Additionally, it provides practical guidance on creating and managing databases using Microsoft Access, including table creation, queries, and data retrieval from multiple tables.

Uploaded by

awelhaile31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

UNIT 3

DATABASE MANAGEMENT
Database management is a method used to organize data in a more effective way
for easy management and use of data.
3.1. Data Management Approaches
 The first computer-based data management is a file-based data
management approach.
 The database approach was introduced later and addressed the inherent
weaknesses of the file-based approach.
3.1.1 File based data management
File-based data management is an approach in which data is stored in separate
files without explicit relationships. Data in different files is managed by different
application programs.
Any change to data requires modification of the program that uses the data.
Changes made on the program may also require change in the file structure.
In file-based data management approach, each department creates and processes
its own files separately.
The file-based data management approach creates problems of data duplication
and data inconsistency.
3.1.2 Database approach to data management
In the database approach to data management, data is managed by a database
using a database management system (DBMS) software.
A database is a collection of logically-related data. It stores all organization’s data
in one repository.
DBMS is software that manages databases. DBMS is used to add new data, modify
data retrieve data and delete data in the database. DBMS essentially serves as an
interface between the database and end users or application programs. It ensures
that data is easily accessed by potential users.
The database management process has three main components.
1. At the bottom is the database which stores the actual data.
2. In the middle is a DBMS which manages the database.
3. At the top of the DBMS are application programs that use the database. The
application programs submit database query to the DBMS.
The database approach to data management provides many advantages to the
organization.
 Data independence
 Data sharing
 Avoiding data redundancy
 Improved data security
3.2. Data Model
 Is the blue print of the database.
 It is used as a guide to store data in a database.
 It shows database entities, attributes and the relationships between the entities.
 It also specifies what data to store in the database.
3.2.1 Basic Concepts in Data Modelling 11E A
1. Entities are basically people, places or events about which you want to store
data.
2. Attributes (Fields) are properties of an entity that are used to differentiate one
entity from other entity.
3. Tuples,( Records) Collection of related data items
4. A relationship is an association between entities.
The relationship between entities can take different forms:
1. One-to-one relationship: An instance of an entity has only one instance
(occurrence) in the other entity with which it is associated.
For example, a country and a capital city.
2. One-to-many relation: An instance in one entity is associated with many
instances in the other related entity.
For example a department called ‘Computer Science’ is associated with
multiple students.
3. Many-to-many relationship: Instances on both sides of the relationship are
associated with multiple instances of the other entity.
For example an employee may work in multiple projects. At the same time,
a project may have multiple employees assigned to it.
3.2.2 Entity Relationship Diagram (ERD)
 ERD is used to visually represent a data model.
 It has three main components namely entity, attribute and relationship.
o Entities are represented as a rectangle.
o Relationships represented as a line and
o Attributes are represented as ellipses.
 As Figure 3.10 shows, student entity has student_id, name, age and address
attributes.
 On the other hand, book entity has book_id, book_title, publication_year
attributes.
 The two entities are related by ‘borrows’ relationship.

Figure 3.10

3.2.3 Relational Data Model


 The relational data model represents data in terms of two-dimensional
tables called relations.
 A relation is nothing but a table of rows and columns.
 Each row, also called a record or tuple, contains a unique instance of data.
 The columns in a relation, also known as attributes or fields, are used to
describe the properties of relations.

Figure 3.11 shows an example of a student relation.

Student

Student Name Sex Grade Address Attributes


ID Or Fields
ST001 Brook Assefa M 12 Kebel 05
Records
ST002 Chaltu Bayissa F 11 Kebel 01
ST003 Ali Mohammed M 10 Kebel 03
ST004 Tsion Gabissa F 10 Kebel 01
Figure 3.11
A relational data model captures a collection of
relations,
their attributes, and
their relationships. See Figure 3.12.

Figure 3.12
3.2.4 Relational Database
 Relational database is a type of database that contains logically
related set of tables.
 Relational database is implemented using relational database
management system (RDBMS) software.
 In RDBMS tables are identified by a unique field called a Primary
Key.
 A Primary Key is a field which has a unique value (no two students
can have the same id) for each record.
 The relational database uses Foreign Keys .
 A foreign key is an attribute in a table that matches (link) the
primary key of another related table.

3.3 Creating Relational Database in Microsoft Access


How to create and manage a database on Microsoft (MS) Access.
Relations or entities are represented as database tables.
Attributes are represented as table fields.
The data type column indicates the type of data to be stored for the
respective field.
3.3.1 Creating Microsoft Access Database
How to create and manage database objects using MS Access 2010.

In order to create a database, follow the following steps:

1. Open MS Access Software

2. In the main Window, click on Blank database

3. Enter the database name in the File Name input box. (use names that
properly describe the data stored in the database.)

4. Click on the Create button.

 Before other database objects are created, a table object must be created.

 A table is a set of fields that store data about a certain entity.

3.3.2 Creating Table in Microsoft Access

When you create a new table, Microsoft Access asks you to define table
fields. Table fields are entity attributes. One or more tables can be created in
one database.
• Each table name must be unique.
• The tables must also have two or more fields. Field names must be
unique in a table.
Follow the following steps to create a table in MS Access
1. Open a database file.
2. Click on Table Design button from the Create menu.
3. Enter field names for the new table such as Student ID, Sname, Sex,
Age and Grade_level .
4. Specify the data type of the field. The data type can be text, number,
date/ time, currency, etc. depending on the type of data that the field
is used to store.
5. When you finish, click on the Save button.
6. In the popup that is displayed, enter the table name and click on the
Ok button.
Notes

 When you want to create a new table or add data into or modify an existing
table, you must first open the database in which you want to store your
database objects. This is important because there can be more than one
database in a single computer.

 When you define a field to a table, you must specify the appropriate data type
for a Field name. The data type could be text, number, date and currency.
Data types are one form of validation mechanisms that ensure the
correctness of data in the database. If you set the data type as Text, it will not
accept its data as Number or any other type. Only text is a valid value to it.
 To set the field as primary key, go to the table design view, select the field and
click on Primary Key ( ) button in the toolbar.

Follow the following steps in order to enter data into a database table:
1. Open a database if it is not already opened
2. Click on the table name and select Datasheet View from View in the toolbar. For
example, open student table.
3. Enter appropriate values for each field.
4. Enter all the records of the Student table .

3.3.3 Creating Query in Microsoft Access

Query is a database object that provides a custom view of data from one or more
tables. It is a way of searching for and compiling data from one or more tables. In MS
Access, data is retrieved through query by creating graphical query or writing
Structured Query Language (SQL) statements.
Follow the following steps in order to create a query in Microsoft Access:
1. Open a database where your database tables are stored
2. Click on Create menu button. You can create query using Query Wizard or Query
Design. Let us see how to create a query using Query Design option.
3. Click on Query Design button from Microsoft Access toolbar.
4. Select a table or tables from Show Table box from which you want to select records
for your query and click on OK bottom.
5.Select the fields in the Field row. For example, if you want to select only sname and sex
field, select sname in the first column and sex in the second column of the Field row.
6.Select Datasheet View from the toolbar to see your query results. If you do it
correctly, you get the following results.

see Figure 3.19 Query Results

3.3.4 Adding Criteria to Query Design


By adding additional criteria to a query design, it is possible to retrieve specific data
from a table.
Follow the following steps in order to add criteria to a query.
1. Open the Query Design Window.
2. Add a table to query design window.
3. Select fields to be displayed in Query Result Window.
4. In the Criteria row, enter query selection criteria. For example, if you want to
display only Male students, under Sex column, enter M as your query selection
criteria
Notes
The criteria you enter in the criteria row must be exactly the same with the data stored
in the table. For example, if sex data is kept in the table using a single character (for
example m), you cannot get the required result if you enter ‘Male’.

3.3.5 Selecting Data from Multiple Tables


The power of a relational database is that it allows you to retrieve data from two or
more tables.
Follow the following steps in order to select data from multiple tables:
1. Open the Query Design window.
2. Add a table to the Query Design window. If Show Table window is not displayed,
click on Show Table button from the Toolbar. You will have a list of tables in the
Show Table Box.
3. Select a table and click on Add button to add the table into Query Design Window.
4. Repeat step 3 to add more tables.
5. Establish a relationship between the tables by dragging the primary key field in the
Parent table to the Child Table
6. Select the fields to be displayed in Query Datasheet View. For example, we
want to select student name (fname) from student table, subject and grade from grade
table, and teacher name (tname) from teacher table.
7. Choose the Save button from the File menu to save your query.
8. Enter a file name for the new Query, and click on the OK button.
9. Click on the View button in the Toolbar to see the query results.
Key Terms
Attributes are properties of entities that are used to describe the entities.
Data model is a blueprint of the database.
Database is a shared collection of logically related data.
DBMS which stands for database management system is a software which is used to
create and manage databases.
Entities are people, places, or things about which you want to keep information
a database.
Entity Relationship Diagram (ERD) is a visual representation tool for data models.
Field refers to a column of a table in the database table. It is similar to an attribute in the
logical data model.
File based data management is a system of data management based on a single file.
Foreign key is an attribute in a table that matches the primary key of another related
table.
Microsoft Access is relational DBMS software. It is used to manage databases.
Primary Key is a field which has a unique value for each record in a table.
Record is a row in a database table. It stores data about one real-world object
represented in a table.
Relational data model is a type of data model that represents data in terms of two-
dimensional tables called relations.
Relational database is a type of database that contains a logically related set of tables.
Relationship is an association between entities.
The End of Unit 3

You might also like