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

Access Database2016

The document provides an overview of databases, explaining their structure, components, and the use of SQL for data manipulation. It details the parts of a database, including tables, fields, records, primary keys, and foreign keys, as well as how to create and manage a database using Microsoft Access. Additionally, it covers creating tables, setting primary keys, using input masks, entering data, and creating queries to analyze data.

Uploaded by

wonyskzozo0325
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Access Database2016

The document provides an overview of databases, explaining their structure, components, and the use of SQL for data manipulation. It details the parts of a database, including tables, fields, records, primary keys, and foreign keys, as well as how to create and manage a database using Microsoft Access. Additionally, it covers creating tables, setting primary keys, using input masks, entering data, and creating queries to analyze data.

Uploaded by

wonyskzozo0325
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Access Database

Year 8
Introduction
A database is a persistent collection of related data or information which is
held together in an organised or logical way.
A database is persistent because the data and structures are maintained even
when the applications that use the data are no longer running.
A database is organised because the data is stored in a very structured way,
using tables, records and fields so that users and data handling applications
can easily add, delete, edit, search and manipulate the data.
A database is made up of related data because the individual items of data
have a connection of some sort.
For example, a database of students would contain related items such as
name, date of birth, address, classes etc.
Because of the high organisation of a database, data can be retrieved,
sorted and updated very efficiently.
Adding and retrieving information in a database is done using a
special-purpose programming language called SQL.
Examples:
• address book
• Yellow Pages
• Electoral register
• DVLA vehicles / driving licences
Entity Relational Databases
• Entity – An object, person, event or thing of interest to an
organisation and about which data is recorded.

• Relationship – an association or link between two entities


Parts of a database
• A database is made up of one or more tables.
• Each table should be given a relevant name. The table above is
named 'Characters' because it contains well known cartoon or
comic characters.
• Each column in a table is called a field and contains
information about a particular item of data. Each field should
be given a relevant name, for instance the field called 'city'
contains a city name
• Each row in a table is called a record. Here is a single record from
the table above
• A record is made up of collection of fields related to a single item.

In short:
o Each piece of information is entered into a 'field'
o Related fields are collected into records
o Related records are collected into tables
o Related tables are collected into a database
• Primary key: the field (or combination of fields) that can
uniquely identify a record.

• Foreign key: the primary key of one table exists in another,


establishing a relationship, a link between the two tables.
Which fields below are considered to be primary
keys?
Which fields below are considered to be primary
keys?
● CourseID
● LessonID
● MemberID
Which fields below are considered to be foreign
keys?
Which field is the primary key
in this table?

A.Start_Date
B.Sessions
C.Level
D.CourseID
Glossary of key terms
Ms Access
The Navigation Pane:
The Navigation Pane is a list containing every
object in your database. For easier viewing, the
objects are organized into groups by type. You
can open, rename, and delete objects using
the Navigation Pane.

To Minimize and Maximize the Navigation Pane:


Click the double arrow in the upper-right
corner of the Navigation Pane to minimize and
maximize.
Sorting the Objects in the Navigation
Pane:
By default, objects are sorted by type, with the tables in
one group, the forms in another, etc. However, you can
change how the objects are sorted.

Click the drop-down arrow to the right of the All Access


Objects and click on a sort option from the list.
Creating a Database:
1. Start Access
2. Click on Blank desktop
database

3.Under File Name type a name for the database


4.To change the location of where to store the
database, click the folder icon and select a location
5.Click Create
Access opens in a new table in Datasheet View.

Understanding Views:
There are multiple ways to view a database object. The two
views for tables are Design View and
Datasheet View.

• Design View is used to set the data types, insert or delete


fields, and set the Primary Key
• Datasheet View is used to enter and view the data for the
records
Switching Between Design View and Datasheet View:
Click the View arrow on the Home tab and click on either
Datasheet View or Design View
Creating a Table:
A table is a collection of data about a specific topic, such as employee
information, products or customers. The first step in creating a table is
entering the fields and data types. This can be done in either
Datasheet View or Design View but it is recommended to set up the
table in Design View.
Understanding Fields and Their Data Types:
Field - an element of a table that contains a specific item of information, such as a last name.
Field’s Data Type - determines what kind of data the field can store.
Format Use to display
Short Text Alphanumeric data (names, titles, etc.) - up to 255 characters
Long Text Large amounts of alphanumeric data: sentences and paragraphs – 64,000 characters
Number Numeric data
Date/Time Dates and times
Currency Monetary values
AutoNumber Unique value generated by Access for each new record
Yes/No Yes and No values and fields that contain only one of two values
OLE Object Pictures, graphs, or other ActiveX objects from another Windows-based application
Hyperlink A link address to a document or file on the Internet
You can attach files such as pictures, documents, spreadsheets, or charts; each Attachment
Attachment field can contain an unlimited number of attachments per record, up to the storage limit of the
size of a database file.
Calculated You can create an expression that uses data from one or more fields. You can designate
different result data types from the expression.
Displays either a list of values that is retrieved from a table or query, or a set of values that you
Lookup Wizard specified when you created the field. The Lookup Wizard starts and you can create a Lookup
field. The data type of a Lookup field is either text or number, depending on the choices that
you make in the wizard.
To Create a Table in Design View:
1. Click on the Create tab
2. Click on Table
3. Switch over to Design View on the
Home tab
4. If prompted to save the table, enter a
name and click on OK
5. Type the field names and select the
appropriate data type for each field
6. Continue until all fields are added

Note: The order that you enter the field


names is the order the fields will appear in
the table.
Setting a Primary Key:
The Primary Key is the unique identifier for each record in a
table. Access will not allow duplicate entries in a primary key
field. When creating a new table, Access automatically creates
a field “ID” with the autonumber data type, and assigns this
as the Primary Key.

To Set a Primary Key:


1. In Design View, position your cursor in the field you
wish to set as the Primary Key
2. Click the Primary Key button on the toolbar
3. Save the table

Note: To turn off the Primary Key simply click on the Primary
Key button again.
Input Masks:
An input mask is used to pre-format a field to
“look/act” a certain way when a user inputs data.
Examples: Social Security Number input mask
automatically inserts the dashes; phone numbers
automatically inserts the parentheses and
dashes.
The input mask data can either be stored in the table
or simply displayed and not stored.

To Create an Input Mask for a Field:


1. In Design View, click in a field for which you’d like
to apply an input mask
2. In the Field Properties section at the bottom of
the screen, click in the Input Mask line and notice
the Build button that appears at the right end of
the line (see below):

3. Click the Build button to start the Input


Mask Wizard (shown below).
4. Select the appropriate input mask
5. Click Next
6. Click Next for additional screens on which you can set
options for the input mask
7. Click Finish on the last screen of the input mask
wizard

To Save the Table:


1. Click the Save icon on the toolbar
2. Enter a name for the table if you haven’t done so
already
3. Click OK
Entering Data in a Table:
1. In Datasheet View, start typing the data into the table by
pressing the tab key to move to the next cell
2. When you have completed the record (row), press Enter
3. You can also click on the New record icon on the Home tab in
the Records group

Navigating in a Table:
Use the arrows at the bottom of the table to
navigate among records.
Sorting Records in a Table:
1. Position your cursor in the field that you wish to sort by clicking
on any record in the table
2. Click either the Sort Ascending or Sort Descending icon on the
Home tab in the Sort & Filter
group
Queries:
You use queries to view, change, and analyse data
in different ways. You can also use them as a source
of records for forms and reports.

To Create a Query:
1. Click on the Create tab
2. Click on Query Design in the Queries group
3. Select the table that you would like to base
your query on
4. Click Add
5. Repeat steps 3 and 4 until all tables are added
6. Close the Show Table window

The table(s) will now be displayed in the upper


part of the Query Design Screen by boxes
containing the tables’ fields.

7. Double-click on the field names in the field list


window which you would like to include in the
query
Defining Criteria in the Query:
In order to control which records are displayed, you must define criteria in a query. The most common
type of query is the Select Records query which will be discussed below.

To Define Criteria for Your Query:


1. Position your cursor in the criteria row in the field for which you wish to define the criteria for
2. Type the criteria

Example: To find all Excel courses:


3. Position your cursor in the criteria row of the Course ID field
4. Type Excel (Access adds the quote marks to the criteria automatically when you tab to the next
column)
5.Click the Run Query button
• To Save the Query:
1. Click the Save icon
2. Enter a name for the query
3. Click OK

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy