Intro To Database Management
Intro To Database Management
Mr. Stewart
1
Objectives
2
What is a database?
3
Database management
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
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
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.
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
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
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.
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,
Note that you must enforce (turn on) both Cascade Update and Cascade Delete.
Query criterion
AND
OR AND
Other db objects - forms