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

4.Database Concepts

The document discusses the importance of data and the limitations of traditional file processing systems, highlighting the advantages of using a Database Management System (DBMS) for data storage and management. It explains the relational database model, including concepts such as tables, keys, and referential integrity, while also addressing the advantages and disadvantages of DBMS. Additionally, it provides examples of relational databases and the structure of data within them.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

4.Database Concepts

The document discusses the importance of data and the limitations of traditional file processing systems, highlighting the advantages of using a Database Management System (DBMS) for data storage and management. It explains the relational database model, including concepts such as tables, keys, and referential integrity, while also addressing the advantages and disadvantages of DBMS. Additionally, it provides examples of relational databases and the structure of data within them.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Database Concepts

Data:
Importance of Data:
Human beings rely on data for making decisions. Besides, large amount of data when processed
with the help of a computer, show us the possibilities or hidden traits which are otherwise not
visible to humans. When one withdraws money from ATM, the bank needs to debit the
withdrawn amount from the linked account. So the bank needs to maintain data and update it as
and when required. The meteorological offices continuously keep on monitoring satellite data
for any upcoming cyclone or heavy rain.
Data of a student:
Name - Arun
Class- VI
Sec- A
Age- 11
Father’s name- Kumar
Mother’s Name- Geetha
Phone no- 9834512345
we need to explore the methods to store and manage data electronically.

File Processing system


Records are stored in different files.
Different application programs are written to extract and add records to appropriate files.

Limitation of file system


 Difficult to access- no mechanism for retrieval of data
 Data Redundancy- data’s are duplicated in different places
 Data Inconsistency- same data maintained in different places do not match.
 Data Isolation-there is no link or mapping between data’s
 Data Dependence- data stored is in a specific format
 Controlled Data Sharing-no mechanism to control sharing of data.
DATABASE
A database is defined as a collection of interrelated data stored together to serve multiple
application
It is computer based record keeping system.
It not only allows to store but also allows us modification of data as per requirements.
A DBMS provides a centralized control of the data, thereby minimizing the problems in the
database.
DBMS
A DBMS refers to Database Management System
It is a software that is responsible for storing, manipulating, maintaining and utilizing database.
A database along with the DBMS is referred to as a database system. Different application
programs are written to extract records from and add records to the appropriate file.
Purpose of DBMS:
Database reduces Redundancy: It removes duplication of data because data are kept at one
place and all the application refers to the centrally maintained database
Database controls Inconsistency: When two copies of the same data do not agree to each
other, then it is called Inconsistency. By controlling redundancy, the inconsistency is also
controlled.
Database facilitates sharing of data: data stored in a database can be shared among several
users.
Database ensures Security: Data are protected against accidental or intentional disclosure to
unauthorized person or unauthorized modification.
Database maintains Integrity: It enforces certain integrity rules to insure the validity or
correctness of data. For Ex. A date can’t be like 24/22/2021
Database enforces standard: Database is maintained in a standard format which help to data
interchange or migration of data between two systems.
Disadvantages of Database Management System:
 Security and Integrity may be compromised without good control.
 Extra hardware any be required
 Performance overhead may be significant
 System is like to be complex
Relational database model
In relational data base model, the data is organized into tables (rows and columns).
These tables are called relation.
A row in a table represents a relationship among a set of values
Student Info
Student Name Age DOB Father’s Mother’s Phone Mark
ID Name Name %
1011A Arun 11 2002-12-12 Kumar Geetha 121222313 45
4
1011B Priya 11 2002-11-04 Ram Seetha 122241112 65
1
1011C Priya 11 2001-12-07 Tarun Prema 454468676 56
1011D Avinash 11 2002-08-09 - HArini 453416890 45
4

Mark Register
Student ID Name Mark1 Mark2 Mark3 Total
1011A Arun 87 78 68

Rows of relations referred to as tuple/Record


Columns of relation referred to as attributes/fields
Components of a table:
Byte: A byte is a group of eight bits and is used to store a character
Data Item: A data item is the smallest unit of named data.
Record: is a collection of data items which logically represents a complete unit of information
Table: A table is a collection/group of logical records
Fields: Columns which contain one type of information
In a table, each record is identified with a unique value.
There are unique values for all the table. This unique value identifies the record. It is called the
primary key. In a table there may be many fields which has unique values in such case only one
field will be identified/declared as primary key.
Staff Details
Emlpoyee id Empname EmpSalary Emp_area
T101 Jai 25000 Adyar
T102 Ravi 21000 Velachery
T103 Sujatha 26000 Mylapore

Staff Department
Emlpoyee id EmpDepartment Empname desiganamtion
T101 D10 Jai Manager
T102 D20 Ravi Sales
T103 D30 Sujatha SPARES
Manager

Departments STAFFRecord:
Empdept Check in time Check out time
D10 12,30 4.30pm
D20 9am 5,30
D30 3pm 6pm
D45 4pm 7pm
D453 3pm 9pm

Examples of common Relational Database Management Systems includes Oracle database,


Microsoft SQL server, MYSQL, IBM DB2, IBM Informix, PostgreSQL, SQLite etc.
Out of these , MYSQL, PostgreSQL, SQLite are open source Implementations.
Domain is a pool of values from which actual values appearing in a given columns are drawn.
It is to be atomic if elements of the domain are considered to be indivisible units.

Tuple: The rows of tables (relations)


Cardinality: The number of tuples/records (rows) in a relation

Attributes: The columns of the tables (relations)


Degree: The number of attributes/fields in a relation

Table name: Employee detail


Emlpoyee id Empname EmpSalary Emp_area Age
T101 Jai 25000 Adyar 34
T102 Ravi 21000 Velachery 25
T103 Sujatha 25000 Mylapore 56
T104 Prem 28000 T.nagar 44

Cardinality of the table Employee detail: 4


Degree of the table Employee detail: 5
Views:
A view is a kind of table whose content are taken from other table depending upon a
condition

Empname EmpSalary
Jai 25000
Sujatha 25000
The above table we view employees who have a salary of 25000
A view can just like any other table. It can be queried, updated, inserted into, deleted
from, and join with other tables and view

Advantages of view
 We have great control over your data
 We can give people access to some but not all of the information in a table
 Read only view can also be given(cannot update)
Structure of Relational database

Emlpoyee id Empname EmpSalary Emp_area


T101 Jai 25000 Adyar
T102 Ravi 21000 Velachery
T103 Sujatha 25000 Mylapore
T104 Prem 28000 Velachery

Each attribute as a set of permitted values called the domain of that attribute
Keys:
Primary key-
 is a set of one or more attributes that can uniquely identify tuples within the relation.
 There can be only 1 primary key in a table.
 Allows only distinct (no duplicate) values and also forces mandatory entry (NOT
NULL) i.e. we cannot left it blank.

Candidate key-All attribute combinations inside a relation that can serve as primary key are
candidate keys as they are candidates for the primary key position
Alternate key-A candidate key that is not the primary key is called an Alternate Key.
Foreign Key- is a non-key attribute whose value is derived from the primary key of another
table is known as foreign key in its current table

REFERENTIAL INTEGRITY –is a rule that a DBMS uses to ensure relationship between
records in related tables are valid and user don’t accidentally delete or change the related data.

Referential integrity can be applied when:

 The master table’s column is a Primary Key or has a unique index


 The related fields have the same data type
 Both tables must belong to same database.

When referential integrity is enforced using Foreign Key you must observe the following
rules:

 You cannot enter a value in Child Table which is not available in Master Table’s
Primary key column. However you can enter NULL values in foreign key.

Ex: we cannot have a order that is assigned to a customer that doesn’t exist.

 You cannot delete a record from Master Table if matching record exists in related table.

Ex: we cannot a employee from employee table if there are orders assigned to the
employee in Order table

 You cannot modify or change the Primary Key value in Master table if its matching
record is present in related table.

Ex: we cannot change the employee id in the employee table if there are orders
assigned to the employee in Order table.

You might also like