Professional Documents
Culture Documents
UNIT 1:
Record: - A collection of interrelated fields is called record. A single row containing of one
college data is a record. A database record is collection of fields about the same person, item, or
object in a database. A record is a group of data saved in a table.
Record as shown below.
Table: A table is the arrangement of rows and columns. Each table must have unique name. A
row defines a record and a column defines a field in a table.
Objects:
A database object is any defined object in a database that is used to store or reference data.
Anything which we make from create command is known as Database Object. It can be used
to hold and manipulate the data. Some of the examples of database objects are Tables, Forms,
Reports, View, Sequence, Indexes etc.
Table – Basic unit of storage; composed rows and columns
View – Logically represents subsets of data from one or more tables
Sequence – Generates primary key values
Index – Improves the performance of some queries
Synonym – Alternative name for an object
Primary Key
A primary key is the column or columns that contain values that uniquely identify each row
in a table. A table cannot have more than one primary key. A primary key is a special relational
database table column (or combination of columns) designated to uniquely identify each table
record.
A primary key’s main features are:
It must contain a unique value for each row of data.
Candidate Key
It is a set of attributes that uniquely identify tuples in a table. Candidate Key is a super key with
no repeated attributes. The Primary key should be selected from the candidate keys. Every table
must have at least a single candidate key. A table can have multiple candidate keys but only a
single primary key.
Properties of Candidate key:
It must contain unique values
Example: In the given table, Stud ID, Roll No, and email are candidate keys which help us to
uniquely identify the student record in the table.
1.3 Advantages of using DBMS
Advantages of DBMS:
1. Data Abstraction
Data abstraction means, to hide the complexity of data from the basic users.
DBMS abstracts the data from the users, which is not useful for the users. It shows only
those data which are useful to the users.
Data inconsistency means that different files may contain different information about a
particular object or person.
If DBMS has reduced the data redundancy then the database system leads the better data
consistency.
Our data items appear only once (no redundancy) so the updated values are immediately
available to all users.
In DBMS, Data can be manipulated easily, because data is centralized so once the data
structure is defined, we can easily change in the data like- insertion, modification, or
deletion.
Data can be shared easily by multiple applications in centralized DBMS. The applications
can be developed without having to create any new stored files.
The DBMS helps to develop a friendly environment where end-users can access and
manage data.
6. Data Security
DBMS provides data security means protecting your precious data from unauthorized
access. Data can be access only by authorized users of the organization.
A database can be accessed only by proper authentication usually by verifying login and
password.
8. Concurrent Access
Better organized data and improved data access give us better quality information which
helps for making better decisions.
Disadvantages of DBMS:
To run the DBMS software, we need a high-speed processor and a large memory size is
required which causes expensive hardware is needed.
2. Cost of Data Conversion
When a computer file-based system is replaced with a database system, then the data stored in
data files must be converted into database files. It is the difficult and time-consuming method to
convert the data of data files into database
DBMS are often complex systems, so training is required for the users to use the DBMS. The
organization has to be paid plenty of amount for the training of workers to run the database
management system.
1.4 DDL (Data Definition Language) and DML (Data Manipulation Language)
Database Language
Database languages can be used to read, store and update the data in the database. Structured
Query Language (SQL) as we all know is the database language by the use of which we can
perform certain operations on the existing database and also we can use this language to create
a database. SQL uses certain commands like Create, Drop, Comments and Insert etc. to carry
out the required tasks.
3. DCL – Data Control Language: It is used to retrieve the stored or saved data.
4. TCL – Transaction Control Language: TCL is used to run the changes made by the
DML statement. TCL can be grouped into a logical transaction.
DDL (Data Definition Language): It is used to define database structure or pattern. DDL
actually consists of the SQL commands that can be used to define the database schema. It simply
deals with descriptions of the database schema and is used to create and modify the structure of
database objects in the database.
DML (Data Manipulation Language): It is used for accessing and manipulating data in a
database. It handles user requests. The SQL commands that deals with the manipulation of data
present in the database belong to DML and this includes most of the SQL statements.
Stands for DDL stands for Data Definition DML stands for Data Manipulation
1
Language. Language.
Usage DDL statements are used to create DML statement is used to insert, update
2 database, schema, constraints, users, or delete the records.
tables etc.
Classification DDL has no further classification. DML is further classified into procedural
3
DML and non-procedural DML.
1.5 Database Model: Network Model, Hierarchical Model and Relational Database
Model
A Database model is a data model that defines the logical design and structure of a database and
defines how data will be stored, accessed and updated in a database management system. There
are different types of database model among them Relational database Model is the most widely
used database model.
1. Hierarchical Model
2. Network Model
3. Entity-relationship Model
Hierarchical Model was the first DBMS model. This model organizes the data in the hierarchical
Tree Structure. The hierarchy starts from the root which has root data and then it expands in
the form of a tree adding child node to the parent node. This model easily represents the real-
world relationships like food recipes, sitemap of a website etc.
Example: We can represent the relationship between the shoes present on a shopping website
in the following way:
Example: In the example below we can see that node student has two parents i.e. CSE
Department and Library. This was earlier not possible in the hierarchical model.
1. Ability to merge more Relationships: In this model, there are more relationships so
data is more related. This model has the ability to manage one-to-one relationships as
well as many-to-many relationships.
2. Many paths: There are more relationships so there can be more than one path to the
same record. This makes data access fast and simple.
Advantages of Network Model
This model is more flexible due to many to many relationship.
The data can be accessed faster as compared to the hierarchical model.
There is a parent-child relationship so data integrity is present. Any change in parent
record is reflected in the child record.
Disadvantages of Network Model
It is very complex type of database model.
It is difficult to handle the relationship in complex programs.
Any change like updation, deletion, insertion is very complex.//////
Entity-Relationship Model
In the above diagram, the entities are Teacher and Department. The attributes of Teacher entity
are Teacher_Name, Teacher_id, Age, Salary, Mobile_Number. The attributes of
entity Department entity are Dept_id, Dept_name. The two entities are connected using the
relationship. Here, each teacher works for a department.
Features of ER Model