Database Presentation
Database Presentation
The collection of all inter related information about an organization , etc… which is used to ensure its
efficiency and smooth functioning can be called database. Simply, a database is an
organized collection of data.
It is more than a simple table. A database can give a use true command of the data included allowing the
user to do various actions like , analyzing , retrieving , sorting and summarizing .
We can either manually maintain data organizing them in text written by hand which is known as manual
database or we can maintain the data on Electronic medium where we use a Database Management System
or Software(DBMS) is known as Electronic Database.
Thus a DBMS can be defined as a program which manages databases easily , efficiently , and accurately.
Advantages of Databases
More efficient in retrieving information
Required information can found out very quickly, data is properly organized.
Independence of data.
Though databases & software are connected , database tables can be updated without
changes to the application software.
FEATURES OF a DATA
• BASE.
Reduce Data Redundancy.
IT reduces duplication of data.
• Data Consistency.
By minimizing data redundancy , the same data being saved in various tables can be reduced
or prevented. This enables maintenance of data consistency.
• Increases Efficiency.
Efficiency of databases are higher as they are well organized.
• Increases Accuracy.
Since data redundancy can be minimized in a database , data consistency is maintained. This
increase accuracy.
• Increases Validity.
Properties of fields can be assigned when a database is planned. Validity can be checked at the
data entry stage. This increases the validity of the database,
• Security.
Unauthorized access can be controlled by using a password or encrypting the data base.
Comparison between Manual and Electronic
Data bases.
Record Field
Student Name Date of Date of
Number Birth Admission
100 Manoj Dayarathne 2/9/2008 G. Dayarathne
Record1 + Record2 + Record3….(Records)
101 FirosaLai Rafeeqa 4/2/2008 K. Fais
Table Student Book Borrowed Return
Number Number Date Date
Tables
Table1 + Table 2 + Table 3…. (Tables) 101 2222 2/9/2014 16/9/2014
100 3333 3/9/2014 17/9/2014
101 1111 3/9/2014 17/9/2014 Records
Relational Database 100 3333 4/9/2014 18/9/2014
• A Column (or a combination of columns) which enables to
PRIMARY identify a record uniquely is called a PRIMARY KEY
KEYSpecial Attributes.
• Should Not Be empty(Data being there is mandatory)
Composite Primary Key • The Primary Key which consists of two or more
columns of a table uniquely identifies a record is
called Composite Primary Key.
Foreign KEY • If a field (or combination of fields ) of one table can be used to
uniquely identify rows of another table, then this/these filed/s
is/are called the foreign key.
• Builds a connection between two tables.
Special Features. • The related data of the primary key field exist in the other table.
• Foreign key of one table is the primary key of the other table.
EXAMPLES
When considering the tables 9.11
and 9.12, Registration Number is
the primary key of 9.11 - Student
Table where as Registration
Number is the foreign key of 9.12 -
Subject Table. Further, a separate
primary key is available for subject
table and that is candidate number
PRIMARY KEY
For
ei g
nK
ey
Creating A Simple Database Manually.
• You can create a database manually on media such as paper using pen and pencil.
• Mainly Created by drawing tables.
To create any database , specially electronic but also including manual databases, we must know what data
types we must use. Let us learn some Data Types
• Data type related to the field should be identified when the table is created.
Exa
mpl
e
Creating the Primary Key for a Data Table
Ex
a mp
le
Entering Data to the Table
• The table view
should be changed
to input data to a
prepared table.
1. One-to-one.
2. One-to-many.
3.Many-to-many.
One-to-one Relationship
• If only a row of a table is related to a row of another table, it is called
a one-to-one relationship.
Example
Given below is Table 9.19 which includes the marks students scored of the Grade 5 scholarship
exam. Let us tabulate data in this table
into two tables:
– Student Table and Table 9.19– Scholarship Marks
– Marks Table.
Admission No Name Date of Index No Marks
Birth
• A record of the Marks Table is related to only one record of the Student Table. A record of the
Student Table is related to only one record of the Marks Table as well.
•
• The primary key of the Student Table is the Admission Number and it is the foreign key of the
Marks Table. The Primary key of the Marks Table is the Index Number. The relationship built
between these two tables through the foreign key is one-to-one.
An arrow is drawn from the foreign key to the primary key
to indicate the relationship.
One-to-many Relationship
• If each record of a table is related to several records of the other table, this is called a one-to-many relationship.
Thus,
• There is a one-to-many relationship between the Student Table and the Students Sports Table.
• There is a one-to-many relationship between Sports Table and Students Sports Table.
• Hence, by using an extra table, many-to-many relationships can be converted to one-to-many relationships.
Creating a Relational Database Using Database
Management System Software
Build up relationship between tables
SPECIAL FEATURES IN REALATED TABLES
As soon as the values of a primary key field of the Student Table are updated using
'Referential Integrity,' the foreign key field values of the related table are automatically
changed.
Further, when a record of the Student Table is deleted, the related records of the related
table are automatically deleted.
First, data should be entered to the student Table. After that, data can be entered to the
Marks Table.
After entering the marks to the Student Table, data can be entered to the Marks Table
through it.
For this, click on the + mark which is in front of the Admission Number of the Student
Table. Then data can be entered to Marks Table easily.
Creating Forms to Entering and Displaying Data
Forms are used to enter data to a table in Database Management Systems. Further, forms are used
to display entered data as well.
Create → Form Design → Add Existing Fields → Show tables → Select the required
table → Drag table fields to the form (Refer Figure 9.21)
Showing Table Records in Data Form
Showing Table Records in Data Form
Entering
3' Entering Control Wizards to a Wizards
Control Form to a Form
For Microsoft Office Access '''
Design Tab → Select 'Control Wizards' (Refer Figure 9.23) → Select the button indicated as
XXXX → Establish the button in data form → Select Record Operation in Command Button
Wizard (Refer Figure 9.24) → Select the Action which should be entered (E.g.: Add New
Record) → Give a proper name to the button → Finish
Designing Query to Get Information
• Let us use a query to obtain necessary information from the data of related
tables
Designing a Query given below is the information received after running the
query.
Designing Reports to Present Information
Reports are used to obtain printed copies of important information received from the
data of related tables. Both tables and queries can be used to design reports.
Report Wizard can be used to design reports.