0% found this document useful (0 votes)
62 views42 pages

Intro To Database Management

This document provides an overview of databases and database management systems. It defines a database as a container for holding related data and explains that database management systems are software used to create and manage database files by storing, modifying, and extracting information. The document then lists several advantages of using a database management system over a file system, such as improved availability, minimized redundancy, and higher accuracy. It also describes common database terminologies like table, field, record, primary key, and foreign key. Finally, it identifies some common data types like text, number, date/time, and currency that are used when creating database tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views42 pages

Intro To Database Management

This document provides an overview of databases and database management systems. It defines a database as a container for holding related data and explains that database management systems are software used to create and manage database files by storing, modifying, and extracting information. The document then lists several advantages of using a database management system over a file system, such as improved availability, minimized redundancy, and higher accuracy. It also describes common database terminologies like table, field, record, primary key, and foreign key. Finally, it identifies some common data types like text, number, date/time, and currency that are used when creating database tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 42

Database System

Mr. Stewart
1
Objectives

 Define what is a database

 List the advantages of using a database over a file system

 Explain the purpose of a database.

 Describe 7 commonly used database terminologies.

 Identify 5 datatypes used in creating a database

2
What is a database?

3
Database management

 Database management is the process of creating and manipulation the data as


useful information.

 A database is a container / holding place for data. You already know about
manual databases such as writing or typing a set of related data about a
number of entities using a table.
Database management system

 the software which is used to create and manage the database files (storing,
modifying, and extracting information).
 Examples: : MS Access, File Maker Pro (Apple software), Oracle,
Microsoft Visual FoxPro, MySQL, IBM Lotus Approach, and OpenOffice.org Base (and
many others).
The process of computerizing a File
system
1. System Analysis (by the system analyst)
2. Creation of a DFD – Data Flow Diagram
3. Creation of a ERD – Entity Relationship Diagram
4. Final design of the database
5. Creation of the database
6. Testing and implementation
Advantages of using a DBMS

 Improved availability

 Minimized redundancy

 Higher accuracy

 Ease in updating

 Ease of Use

 Improved Security
The DBMS – MS Access 2016

 Each database has a number of OBJECTS. These are found in the CREATE tab. The ones you need
to memorize are: TABLES, QUERIES, FORMS, REPORTS & MODULES.
The DBMS – MS access 2016
Two views – Design View, Data Sheet View

View Toggle button


Database Terminologies

 Table
 Contains FIELDS & RECORDS
Fields are in columns
 Records are in rows; also called TUPLES
 Primary Key
 Secondary Key
 Foreign Key
 Candidate key
Fields & records
 Field (Column) – holds one item of data about each entity

 Record (Row)– holds all data items about a single entity

 Table - A table is a collection of related data held in a table format


within a database. It consists of columns and rows

 Primary Key - is a column or group of columns in a table that uniquely


identify every row in that table.

 Secondary Key - is an additional key, or alternate key, which can be use in


addition to the primary key to locate specific data.
 Foreign Key
Field types
 Text (which can be all letters, letters and numbers, or all numbers)

 Number - this one is reserved for fields in which calculations are to be performed. The two types
of numbers to be used are Integer (whole numbers) and Double (numbers with decimal places).


Date/Time – reserved for dates and times

 Boolean – (Yes/No) This one is used when the user has to make a choice
between two states, usually TRUE or FALSE.

 Currency – reserved for money values


Design view (table)
Data sheet view
Activity
Posted in Google Classroom
Today’s Objectives

At the end students should be able to:

1. Identify the steps in creating a Database and table in


Microsoft Access.
2. Demonstrate correctly how to create a database and
add a table to the database in Design view
3. Know how to modify a table

17
Steps in creating a Database in MS
Access
Step 1: Locate the MS Application and open
Steps to create a Database in MS
Access
Step 2: Select blank database
Steps to create a Database in MS
Access
Step 3: After selecting blank database, you will be directed to this window. Enter
the name or title of your database then select create
Steps to create a Database in MS
Access
 After selecting create, your database has created . You will then be directed
to your blank database.
Creating a table in Database in MS
Access
 The best way to create a database table in MS access is to do it in
design view.
 Step 1: close the current table by selecting this x
Creating a table in MS Access
 Step 2: Next select the “Create” tab
 Step 3: Then select “table design” or table in “design view”
Creating a table in MS Access
 Step 4: You will then be directed to this window “design view”. This where you will
create your Fields, select the data type and add description
Creating a table in MS Access
 Step 5: Enter your field and select the data type based on the data you will enter
under each field.
 Step 6: After you have entered and select your data type, select the small x
Creating a table in MS Access
 Step 7: After selecting the x, a pop up menu will appear asking if you want to save
or cancel. Select yes.
Creating a table MS Access
 Step 8: Next enter the name of your table in the “save as” pop up menu then select ok
Creating a table in MS Access
 Step 9: If you have NOT selected a primary key, a menu will pop up asking if you want
to create a primary key now, select “NO”. and your table will be created.
 Then you will be able to add records to your table
Objects in MS Access: Query
 A query is a request for a specific data results, and for action on data. You can use
a query to answer a simple question, to perform calculations, to combine data from
different tables, or even to add, change, or delete table data.
Objects in MS Access: Relationship
 A relationship in Access helps you combine data from two different tables.
Each relationship consists of fields in two tables with corresponding data. ... When you
use related tables in a query, the relationship lets Access determine which records from
each table to combine in the result set.
What is a Primary Key?

 A primary key is a field with values that are unique throughout a table. Values of the
key can be used to refer to entire records, because each record has a different value
for the key. Each table can only have one primary key.
Characteristics of a Primary Key

 A primary have basically two characteristics


1. It must contain a unique value for each row of data. No duplicates
2. It cannot contain null values. i.e. cannot be left blank
What is a Foreign Key?

 FOREIGN KEY is a column that creates a relationship between two tables. The purpose of

Foreign keys is to maintain data integrity and allow navigation between two different

instances of an entity. It acts as a cross-reference between two tables as it references the

primary key of another table.


Linking Tables

First you must know that every table must have a field which takes a unique identifier for each entity

which is added to the table. e.g. ID’s are unique to a specific person or thing.

This ID appears in all related tables which hold data on that set of entities.

In one table, a Key is added to that field and is called a Primary Key.

Primary Key – is a field in a table that uniquely identifies the record

In the other tables, the database recognizes that field as a key field. However, it is called a Foreign Key.

So

A Foreign Key is a field in another table that is the primary key in another table.
Linking Tables
To link two (or more) tables, close all tables  Go to database Tools tab and click Relationships.
Load the tables  Drag the primary key to the foreign key  Turn on Referential Integrity as shown
below.

Note that you must enforce (turn on) both Cascade Update and Cascade Delete.
Why should we enforce this?

This will prevent the user from adding new entities to the tables with the foreign key

without having that entity in the main table. Also, if a record is deleted from the main table,

all entries in the other tables will automatically be deleted.

Note that you must enforce (turn on) both Cascade Update and Cascade Delete.
Query criterion

1. Show all employee name, address and salary

2. Show all models of Toyota cars and the cost

3. Show all drivers who have a drivers license

4. Show all cars that have not crashed

5. Show all employees who earn less than 100 000

AND
OR AND
Other db objects - forms

 a window or screen that contains numerous fields or spaces to enter data


 Each field holds a field label
 is used to display and maintain records
 displays records one at a time
Form example
Other db objects - reports

 formatted result of database tables & queries


 contains useful data for decision-making and analysis
 presents data in an attractive format
 especially suitable for printing
Report example
THE END

You might also like