Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Db Concepts2
1. DATABASE CONCEPTS
DATABASE
An electronic filing cabinet
A repository for a collection of computerized data files
A collection of persistent data that is used by the application
system of some given enterprise
The term enterprise is a generic term for any self-contained
commercial, scientific, technical or other organization
MG/DB CONCEPTS/CL12
2. DATABASE SYSTEM
A computerized record-keeping system. A database system
involves four major components: data, hardware(secondary
storage devices, processor(s) and associated main memory etc.,),
software(the DBMS) and users(application programmers, end
users, database administrator).
MG/DB CONCEPTS/CL12
3. Data independence
The ability to modify the scheme definition in one level
without affecting the scheme definition in the next higher
level is called data independence.
Physical data independence :
refers to the ability to modify the scheme followed at the physical
level without affecting the scheme followed at the conceptual level
i.e., the application programs remain the same even though the
scheme at physical level gets modified.
Logical data independence :
refers to the ability to modify the conceptual scheme without
causing any changes in the schemes followed at view level.
MG/DB CONCEPTS/CL12
5. The hierarchical model
The oldest model and is popular on main frames
Represents data by a collection of records organized in
the form of a tree structure
Relationships among data are represented by links
The record at the top of the tree is the root
The hierarchy is maintained in the form of nodes and
branches
The root may have any number of dependents, each of
these dependents may have any number of lower
level dependents and so on to any number of levels
MG/DB CONCEPTS/CL12
6. Consider a student course-marks database.
In the hierarchical model, a student can register for many
courses and get marks for each course.
Scode Sname Scode Sname
S2 B
S1 A
Ccode Cname Marks Ccode Cname Marks
C1 Physics 65 C3 Maths 83
C2 Chemistry 78 C4 CompSc 85
C3 Maths 83
C4 CompSc 85
MG/DB CONCEPTS/CL12
7. The student record is called as root.
It has got a course-marks record that is called the child record.
A parent can have many children.
A child cannot have more than one parent and no child can exist
without its parent.
In this type of model following possibilities exist.
Insert : Since no child record can exist without its parent, it is not
possible to insert a new course details without introducing a dummy
student
Delete : If a course is selected by only one student, then deleting
that student will automatically delete all info about the course
Update : To change the course name of one course, the whole
database has to be searched. This may result in data inconsistency.
MG/DB CONCEPTS/CL12
8. The network model
A NW model represents data by a collection of records and
relationships among data are represented by links.
The student and course records are linked together through a
marks record.
There are no restrictions on number of parents.
A record type can have any number of parent and child
record types.
It is more complex than the hierarchical model because of
links.
It can represent any structure designed in hierarchical
model, and so is a superset of the hierarchical model.
MG/DB CONCEPTS/CL12
9. In network model following possibilities exist:
Insert
Inserting a course record or student record poses no
problems as they can exist without any connectors till a
student takes the course.
Delete
Deleting any record automatically adjusts the chain.
Update
Update can be done only to a particular child record
MG/DB CONCEPTS/CL12
10. The relational model
Developed by Codd
In relational model, data is organized into tables
consisting of rows and columns
The table is referred to as a relation, the rows as
tuples/records and columns as fields/attributes
A row in a table represents a relationship among a set of
values
Since a table is a collection of such relationships, it is
referred to as a relation
The relationships among data are represented by a
collection of tables. MG/DB CONCEPTS/CL12
12. Characteristics of a relation
There are no duplicate tuples
Tuples are not ordered
Attributes are not ordered
All attribute values are atomic
MG/DB CONCEPTS/CL12
13. Terminology
Cardinality
The number of tuples is called the cardinality
Degree
The number of attributes is called the degree
Domain
A pool of values from which specific attributes of specific
relations draw their values.
A domain is just a data type
It provides a set of values from which various attributes in
various relations take their actual values.
MG/DB CONCEPTS/CL12
14. Primary key
A column or a group of columns in a table that uniquely
identifies records in the table.
It is a unique identifier for the table.
It contains unique value for each record.
Foreign key
A column or a group of columns in a table that is used to
reference a primary key in another table.
MG/DB CONCEPTS/CL12
15. Database concepts (Revision)
A database is a container for data
It is repository for storing organized information
in the form of files
A db management system is a software package
that handles the database
It is an interface between the user and the
database
A DBMS organizes data as a data model
Data model is an infrastructure of data
organization MG/DB CONCEPTS/CL12
16. In a Relational Data Model, the data is organized
into tables consisting of rows and columns
A table is referred to as a relation
The rows are referred to as tuples/records
The columns are referred to as fields / attributes
Primary key
A primary key is a unique identifier for the table
It consists of one/more attributes that uniquely
identify each and every record in a table
It contains unique value for each record
MG/DB CONCEPTS/CL12
17. A database is a collection of tables
Tables consist of organized related information
Each table consists of a collection of records
Each record contains info about a specific entity
The info in each record is contained in fields
A field is the basic unit of a db
A field can contain text, numbers, dates or even
photographs
MG/DB CONCEPTS/CL12
18. A data base system has 2 parts
The back end
The frond end
Front-end s/w interfaces with the user
Eg> Visual Basic
The back-end s/w holds data
Eg> IBM DB2, MS SQL SERVER, ORACLE,
SYBASE, INFORMIX, MS ACCESS
MG/DB CONCEPTS/CL12
19. Structured Query Language(SQL)
Enables you to create and operate on relational
databases
A relational database is a collection of tables
Used for defining and manipulating relational
databases
Non-procedural language
Format free language (Tabs, carriage return and
spaces can be included anywhere in the statemen
Case insignificant
MG/DB CONCEPTS/CL12
20. The language consists of the following components:
Data definition component/language:
This component is used for defining and destroying objects
like relations/tables, index etc
Eg> Create, alter, drop
Data manipulation component/language:
This component is used to retrieve and modify data.
It contains retrieval, manipulation and update directives
Eg> select, insert/delete, update
MG/DB CONCEPTS/CL12
21. Data control component:
Used for defining security and access control of
the database.
Allows the user to grant access privileges.
Eg> grant, revoke
MG/DB CONCEPTS/CL12