Database
Database
What is Database?
• Database is a storage of data where the data can be
accessed.
• Most of us use databases everyday, but we may not
call them by that name.
• Such as Telephone directories or Yellow Pages,
Encyclopedias, Library Catalogue, etc.
Databases
CLASS 8 C
NAME MARK
CLASS 8 G
NAME MARK CLASS 8 RESULT
CLASS 8 K
NAME MARK
Databases
Drawbacks of Manual Databases:
• Complex to maintain the order
• Taking a lot of space to store
• Time Consuming to retrieve, update and modify the data
• Cross referencing is complex and cumbersome
A file of data in the form of fields and
records is called a database.
• Data can be easily sorted in specific way. Maintain the data in any order.
• Data we need can be found easily.
• Data sharing facility
• Recalling the data easily and quickly
• Data van be validated to make sure entered data is sensible and realistic.
• A backup copy can easily made.
• Saves Space then manual database.
Database Structure
Records
or
Rows
• Flat-File Database
• Relational Database
• Flat-File databases hold all of their data in one table
only.
• They are only suitable for very simple databases.
• The patient database is an example of a flat-file as all of
the information is stored in one single table:
Flat-File Database
Limitations of a Flat-File Database
• Common fields that are not being used as key fields are
known as foreign keys.
• A foreign key is a regular field in one table which is being
used as the key field in another table.
• Foreign keys are used to provide the link (relationship)
between the tables.
Foreign Key
The foreign key (Doctor Id in the patient table) can then be used to
match to the primary key (Doctor Id in the doctor table) and share the
correct data.
A patient with a Doctor Id of 01 will be automatically assigned to
Doctor Hyde and Room 03.
Advantages of relational database
• Although a relational database is complex in structure, It has
several advantage over a flat file database. Such as:
1. No multiple record changes needed
2. More efficient storage
3. Simple to delete or modify details.
4. All records in other tables having a link to that entry will
show the change.
Performing Searches
Query
Student
Name Class ID Maths English Science History Geography