You are on page 1of 34

MS-Access 2016

03/26/24 Computer skills Activities 1


Outlines
What is database?
What is data Types ?
What is relational database?
What is Primary key and Reference key (Foreign Key)
How to create Database and Tables ?
How to enter data in a table?
How to create Relationship between tables
using( primary key and Reference key)
How to retrieve information by using (Query)
Student Activity Overview (Quran Database Structure)

03/26/24 Computer skills Activities 2


Data Types

03/26/24 Computer skills Activities 3


What is database?
A database is a collection of information that is
organized so that it can easily be accessed, managed,
and updated.
Example Database :- Student Information

03/26/24 Computer skills Activities 4


What is Relational Database?
Relational databases : is a computer database in which all data is
stored in Relations which (to the user) are tables with rows and
columns. Each table is composed of records (called Tuples) and
each record is identified by a field (attribute) containing a
unique value. Every table shares at least one field with another table
in 'one to one', 'one to many,' or 'many to many' relationships. These
relationships allow the database user to access the data in almost an
unlimited number of ways, and to combine the tables
as building blocks to create complex and very large databases.

Relational databases characteristic :


Relational databases are a collection of data stored across multiple tables
Relational databases reduce duplication and make it easier to find and
analyze data

03/26/24 Computer skills Activities 5


A Primary Key & Reference Key (Foreign Key)
What does primary key mean ?
A primary key uniquely specifies a tuple within a table. In
order for an attribute to be a good primary key it must not
repeat. Primary key is used by access for searching and
finding data stored in tables.
 Uniqueness, prevent any duplicate or Null values from being
entered in the primary key fields.
What does Reference Key (Foreign Key) mean?
A 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 . Foreign keys need not have
unique values in the referencing relation.

03/26/24 Computer skills Activities 6


Student table College table

Student ID (PK) Primary Key


College ID (PK)

College Name
Student Name

College Place
College ID (RK)
Reference Key

03/26/24 Computer skills Activities 7


Relational DB Diagram Example (Academic DB) and
type of relationships (one to one ,one to many, many to many)

PK PK

RK
RK
RK

PK
PK
Dean

03/26/24 Computer skills Activities 8


Example of Relational Database : ( Academic DB )

03/26/24 Computer skills Activities 9


Relational Database Example 1

03/26/24 Computer skills Activities 10


Relational Database Example 2

03/26/24 Computer skills Activities 11


Practical Section
Using Microsoft Access 2016

03/26/24 Computer skills Activities 12


How to Create a database (Practical Section)

03/26/24 Computer skills Activities 13


How to Create a database (Practical Section)

03/26/24 Computer skills Activities 14


How to create table?

There are several ways to create a table, the following are


two ways to do that.
1.Create Table in Design View
2.Create Table in Datasheet View(Essay way)

03/26/24 Computer skills Activities 15


1.Create Table in Design View

03/26/24 Computer skills Activities 16


Define table Fields’ Information

Primary Key

Field’s Name Field’s Data Type

Field’s Properties

03/26/24 Computer skills Activities 17


Save and Name the Table
(ctrl+S)

03/26/24 Computer skills Activities 18


Save and Name the Table
(ctrl+S)

After you fill the fields’ information, it is the time to give


your table a name.

03/26/24 Computer skills Activities 19


Example of Fields’ Information in design mode

03/26/24 Computer skills Activities 20


Creating student Info table

03/26/24 Computer skills Activities 21


Creating Course table

03/26/24 Computer skills Activities 22


How to insert data (records) in student info table

03/26/24 Computer skills Activities 23


How to create Relationship Between Tables

we now create a link or joint


table between Student Table
and Course Table
03/26/24 Computer skills Activities 24
Example1: One to Many Relationship

03/26/24 Computer skills Activities 25


Example 2:- Many to Many Relationship

03/26/24 Computer skills Activities 26


The Activity Database Quran DB (Tables structure -
Data types – PK and RK)

03/26/24 Computer skills Activities 27


Before
Due Date
3- Table Name:
1- Table Name: tblQuranWordAnalysis
tblQuranSuraName
Field Data Descrip
Field Data Descrip Name Type tion
Name Type tion
SuraNo Number ‫رقم السورة‬
SuraNo Number ‫رقم السورة‬
AyiaNo Number ‫رقم اآلية‬
SuraName ShortText ‫أسم السورة‬
WordNo Number ‫رقم الكلمة‬
Place ShortText ‫مكان‬
‫النزول‬ WordTex shortText
t
Root shortText ‫جزر الكلمة‬
2- Table Name:
tblQuranAyiaText
Origin shortText ‫أصل الكلمة‬
Field Data Type Descrip
Name tion
Noun shortText ‫أسم‬
SuraNo Number ‫رقم السورة‬
AyiaNo Number ‫رقم اآلية‬ Verb shortText ‫فعل‬
AyiaTex ShortText ‫نص اآلية‬
t
1- MS Excel (Sheet
2): Sura Name and
1- Table Name: place
tblQuranSuraName Note : Open Mode
Note : Design Mode
Field Data Type Description
Name
SuraNo Number ‫رقم السورة‬
SuraName ShortText ‫أسم السورة‬
Place ShortText ‫مكان النزول‬
3- MS Excel (Sheet 3): Quran Ayiah Text
Note : Open Mode
2- Table Name:
tblQuranAyiaText
Field Data
Name Type
SuraNo Number ‫رقم‬
‫السورة‬
AyiaNo Number ‫رقم اآلية‬

AyiaText ShortText ‫نص‬


‫اآلية‬
3- Table Name:
tblQuranWordAnalysis 3- MS Excel (Sheet 4): Quran Word Analysis
Note : Design Mode Note : Open Mode
Field Data Descripti
Name Type on
SuraNo Number ‫رقم السورة‬
AyiaNo Number ‫رقم اآلية‬
WordNo Number ‫رقم الكلمة‬
Word shortText ‫الكلمة‬
Root shortText ‫جزر الكلمة‬
Origin shortText ‫أصل الكلمة‬
Verb shortText ‫أسم‬
Noun shortText ‫فعل‬
Proper shortText ‫أسم علم‬
Noun
Adjective shortText ‫صفة‬
The Quran Activity Database (Tables structure –
Relationship – PK and RK)

03/26/24 Computer skills Activities 33


The Quran Activity Database (Tables info –
Relationship – PK and RK)

03/26/24 Computer skills Activities 34

You might also like