0% found this document useful (0 votes)
3 views

Database Management

The document provides an overview of database management, explaining key concepts such as tables, queries, forms, and reports, as well as essential terms like primary keys and foreign keys. It outlines the process of creating a database and tables, including data types and field sizes. Additionally, it discusses establishing relationships between tables and the importance of enforcing referential integrity in database management.

Uploaded by

kayoinim
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)
3 views

Database Management

The document provides an overview of database management, explaining key concepts such as tables, queries, forms, and reports, as well as essential terms like primary keys and foreign keys. It outlines the process of creating a database and tables, including data types and field sizes. Additionally, it discusses establishing relationships between tables and the importance of enforcing referential integrity in database management.

Uploaded by

kayoinim
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/ 5

Old Harbour High School

Database Management

A database is a collection of tables that are related to each other. Or a database allows you to store
information related to a specific topic in an organized way. Database allows you to:
1. Create and manage tables
2. Perform queries on data and create additional ones as the need arises
3. Enforce the integrity of the data
4. View reports on the data and create new ones as the need arises

Terms associated with database


● Table (relation) – a data structure in which data is organized (for access) in columns and rows. It is
also referred to as a two dimensional array.
● Entity – a person, place, thing (tangible or intangible) about which information may be kept.
● Tuple (Record) – a set of data items which are related to a particular entity and are treated as a
single unit. A collection of these is known as a file.
● Attribute – a unit of information that describes a particular entity. Eg. Name is an attribute in
relation to the entity, ‘man’
● Primary key – the main key field of a multi-key file. In an alternate- key indexed sequential file,
the field for which direct and sequential access are supported.
● Secondary key – this is the use of any key, except the primary key field in accessing a record in a
file.
● Composite key – also called compound or concatenated key. It consists of 2 or more attributes. It is
used in situations in which more that one key is needed to identify a record.
● Candidate key – is a key that uniquely identifies rows in a table. Any of the identified candidates
keys can be used as the table’s primary key.
● Alternative key – any of the set of keys that may be used as a secondary key.
● Foreign key – is a field in a relational table that matches the primary key column of another table.
The foreign key can be used to cross-reference tables.

NB: Access is called a relational database management program, because the tables are linked, or
related.

A database is made up of several components, or objects. These objects include:


● tables
● queries
● forms
● reports
We'll look at each of these objects in more detail in later lessons, but you can access them from the
Navigation Pane like you can with tables.
Tables
A table is the database object that contains the basic information you wish to store. A blue and white icon
represents the table in the Navigation Pane.

Table Icon

In the Customer Info table below, there are columns, or fields, of information including title and author.
Each row is a record that contains the information specific to the fields listed.
1
Table

Queries
Another database object is called a query. A query allows you to retrieve information from one or more
tables based on a set of search conditions you define using the table fields.
For example, if you want to know the name of the books that have sold in Colorado and Kansas, you could
create a query that would retrieve information from multiple tables to determine the answer. In this example,
you would retrieve information from the Order table and Books table. Queries are covered in more detail in
later lessons.

Forms
A third database object is the form. Forms are an Access tool that users can create to make data entry in
database tables easier.

Entering data directly into a table can be difficult if there is a lot of information to enter. Like an Excel
spreadsheet, an Access table is essentially a screen filled with blank rows where a user enters records.
Forms, however, provide users with an easy-to-read interface where they can enter table data. Forms are
especially useful for Access users that aren’t comfortable working with databases.

Reports
The final database object is the report. A report is an effective way to analyze and present data using a
specific layout. The text can be formatted in an Access report, just like it can be in Word documents.

To Close an Object:
● Select the tab for the object you wish to close. (The highlighted tab is the active tab).
● Right-click the tab and select Close from the menu.

Close Object

How to create your database


● Click the Microsoft office button
● Click new
● In the blank database section at the right of the windows, click the folder icon

● In the dialogue box that appears, type the name of the file and choose the location where it will be
stored.
● Click create button

2
How to create you’re a table in database
● Click on the create tab of the ribbon and then click the table design button.
● Type in the fieldname and select the appropriate data type and field size. (if the a field is need for a
primary key, right-click on its row and click on primary key)

● Save the table by clicking out of the table design as the required name

NB: if you need to modify your design view; just click on table and select design view

Data Types
Data Types Purposes
Text Used to store alphanumeric characters (letters or numbers) up to 255
characters. Example include name, address, phone numbers and country
Number Used to store numbers with or without decimal places. Examples include
age, quantity and average
Currency Used to store money values. Examples includes salary, price, and
discount
Data/Time Used to store date/time types values. Examples include data of birth,
purchase date and date joined
Autonumber Creates automatic numbers, such as an ID Number
Memo Used to store blocks of text like notes up to 65536 characters long.
Examples include remarks and project details
Yes/No Used for storing a yes or no value. Examples include available and
passed

Filed Size
● Byte - used to store integers values between 0 and 255 without decimal places
● Integers – used to store integers values between -32,768 to 32,767 without decimal places.
● Long integers – used to store values between approximately -2 billion and +2 billion without any
decimal places. If you enter any values with decimal values, it will be rounded off to the next
whole number.
3
● Decimal – store numbers with decimal places
● Single – stores numbers with decimal numbers
● Double – store numbers with decimal numbers

The relationship map lists all of the tables that were selected to relate, and all of the fields that were set up
for that table previously. Notice that the first field has a key icon next to it. This is the Primary Key for the
table.

Primary Keys

Primary and Foreign Keys

A Primary Key is the first field in each table of the database. You may recall that this field auto numbers by
default, so that every record in the table has its own unique number to identify it. Access uses this number to
quickly pull information together for you when you run queries or reports, which are covered later.

In the example above, the primary key for the Customers table is Customer ID, the primary key for the
Orders table is Order ID, and the primary key for the Books table is Book ID.
A Foreign Key is a field that is the Primary Field in its own table, but that shows up in another table. If you
look closely at the Orders table, the fields Customer ID and Book ID appear there, as well as in their own
respective tables. These fields are the primary key in their own tables, but in the Orders table, they are
considered Foreign Keys.

Foreign Keys

Relating Tables
There are a few ways to establish relationships between tables:
● Using the Edit Relationships command located on the Design tab of the Ribbon
● Using the Drag and Drop method

Both methods give you the same end result, but the Drag and Drop method is much easier and saves you
several steps.
Relating Tables with the Drag and Drop Method
It is easy to relate tables from the relationship map:

● Select a field name from one table by holding down the left mouse button.

Relationship Map

● Drag the field name from the one table to the other table in the desired relationship.
● Drop the first field name onto the field name that you want to relate by releasing the left mouse button.
In the example above, we selected the Book ID field from the Books table, and dragged and dropped
it on the Book ID field in the Orders table.
4
● The Edit Relationships dialog box appears.

Edit Relationships Dialog Box


● Select the Enforce Referential Integrity option. This option is explained in detail below.
● Click Create.

Understanding Types of Relationships

Access 2007 allows for several different types of relationships. These include:
● One to One
● One to Many
● Many to Many
The relationship type you will come across most frequently, and the one created in our bookstore scenario, is
the One to Many relationship.

One to Many
The One to Many relationship means that data for that field will show up a single time in one table, but
many times in the related table.

For example, let's look at one of the book titles in our bookstore. The Book ID for that book should appear
only once in the Books table, because that table lists every title that we stock. But it will probably appear
many times in the Orders table, because we hope that it gets ordered by many people many times.

The symbols for the One to Many relationship look like this:

One to Many Relationships

Enforcing Referential Integrity

In the Edit Relationships dialog box, an option to Enforce Referential Integrity appears.
You should click Enforce Referential Integrity to make sure that we NEVER have an order for a book that
doesn't appear in our Books table. Selecting this option tells Access to check for these things when someone
is working with your data records.
Editing Existing Relationships

Access 2007 allows you to edit relationships that already exist. This can be done using the Edit
Relationships command on the Ribbon. However, a much simpler way is to simply double click on the
link that appears in the relationship map. Either method brings up the Edit Relationships dialog box, where
you can change your settings.

You might also like