0% found this document useful (0 votes)
190 views39 pages

Database Management System: Course Outcome

This document provides information about a database management systems course, including its course outcomes, contents, and chapters. The course aims to help students understand relational database theory and implement a commercial relational database like Oracle. It will cover topics such as the relational data model, normalization, database security, and transaction management. The contents are divided into three units, which include an overview of databases, data modeling concepts, and advanced topics such as packages, triggers, and recovery techniques. Chapter 1.2 focuses specifically on data models like the relational, network, and hierarchical models as well as entity-relationship modeling.

Uploaded by

CodeWithSuper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
190 views39 pages

Database Management System: Course Outcome

This document provides information about a database management systems course, including its course outcomes, contents, and chapters. The course aims to help students understand relational database theory and implement a commercial relational database like Oracle. It will cover topics such as the relational data model, normalization, database security, and transaction management. The contents are divided into three units, which include an overview of databases, data modeling concepts, and advanced topics such as packages, triggers, and recovery techniques. Chapter 1.2 focuses specifically on data models like the relational, network, and hierarchical models as well as entity-relationship modeling.

Uploaded by

CodeWithSuper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Department of Computer Science and Engineering (CSE)

Database
Management
System

Course Outcome Will be civered in


CO Title Level this lecture
Number

CO1 To perceive the significance and Remember


implementation of a commercial
relational database system (Oracle)
by writing SQL using the system.
CO2 To understand the relational database Understand
theory, and be able to write
relational algebra expressions for
queries
CO3 To identify the basic issues of Analysis and
transaction processing and applicatin
concurrency control and find out its
solutions.
2
University Insttute of Engineering (UIE)
Department if Cimputer Science and Engineering (CSE)
Contents of the Syllabus
UNIT-I [10h]
Overview of Databases: Database concepts, DBMS, Data Base System Architecture (Three
Level ANSI-SPARC Architecture), Advantages and Disadvantages of DBMS, Data Independence,
DBA and Responsibilities of DBA, Relational Data Structure, Keys, Relations, Attributes, Schema and
Instances, Referential integrity, Entity integrity.
Data Models: Relational Model, Network Model, Hierarchical Model, ER Model: Design,
issues, Mapping constraints, ER diagram, Comparison of Models.

Relational Algebra & Relational Calculus: Introduction, Syntax, Semantics, Additional


operators, Grouping and Ungrouping, Relational comparisons, Tuple Calculus, Domain Calculus,
Calculus Vs Algebra, Computational capabilities.

UNIT-II [10h]
Functional dependencies and Normalization: Functional dependencies, Decomposition, Full
Functional Dependency (FFD), Transitive Dependency (TD), Join Dependency (JD), Multi-valued
Dependency (MVD), Normal Forms (1NF, 2NF, 3NF, BCNF), De-normalization.
Database Security: Introduction, Threats, Counter Measures.
Control Structures: Introduction to conditional control, Iterative control and sequential control
statements, Cursors, Views.

University Insttute of Engineering (UIE)3


Department if Cimputer Science and Engineering (CSE)
Contents of the Syllabus

UNIT-III
[10h]
Package, Procedures and Triggers: Parts of procedures, Parameter modes, Advantages of
procedures, Syntax for creating triggers, Types of triggers, package specification and package body,
developing a package, Bodiless package, Advantages of packages.
Transaction Management and Concurrency Control: Introduction to Transaction Processing,
Properties of Transactions, Serializability and Recoverability, Need for Concurrency Control, Locking
Techniques, Time Stamping Methods, Optimistic Techniques and Granularity of Data items.

Database Recovery of database: Introduction, Need for Recovery, Types of errors,


Recovery Techniques.

University Insttute of Engineering (UIE)4


Department if Cimputer Science and Engineering (CSE)

Chapter 1.2

(Data Models)

Data Models: Relational Model, Network Model, Hierarchical Model, ER Model:


Design, issues, Mapping constraints, ER diagram, Comparison of Models.

University Insttute of Engineering (UIE) 5


Department if Cimputer Science and Engineering (CSE)

Learning Objective
• Method to organize data required in an application as
relations.
• Importance for an integrated database in organizations.
• Goals of Data Base Management systems (DBMS).
• Entity-Relationship(ER) modeling to develop a
conceptual model of data.
• Structure and organization of DBMS

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Learning Outcome
• Define program-data independence, data models for
database systems, database schema and database
instances.
• Identify the methodology of conceptual modeling
through Entity Relationship model.
• Identify the methodology of logical model.
• Identify the methodology of physical model.

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Relationship Types
• Specialization
• Generalization
• Aggregation

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Specialization
In specializatin, an entty is divided
inti sub-enttes based in their
characteristcs. It is a tip-diwn
appriach where higher level entty is
specialized inti twi ir mire liwer level
enttes.
For Example, EMPLOYEE entty in an
Empliyee management system can be
specialized inti DEVELOPER, TESTER
etc. as shiwn in Figure 2. In this case,
cimmin atributes like E_NAME, E_SAL
etc. becime part if higher entty
(EMPLOYEE) and specialized atributes
like TES_TYPE becime part if
specialized entty (TESTER).

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Aggregation
An ER diagram is not capable of
representing relationship between
an entity and a relationship which
may be required in some scenarios.
In those cases, a relationship with its
corresponding entities is aggregated
into a higher level entity.
For Example, Employee working for
a project may require some
machinery. So, REQUIRE relationship
is needed between relationship
WORKS_FOR and entity MACHINERY.
Using aggregation, WORKS_FOR
relationship with its entities
EMPLOYEE and PROJECT is
aggregated into single entity and
relationship REQUIRE is created
between aggregated entity and
MACHINERY.

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Generalization
Generalization is the process of
extracting common properties
from a set of entities and create
a generalized entity from it. It is
a bottom-up approach in which
two or more entities can be
generalized to a higher level
entity if they have some
attributes in common.
For Example,
STUDENT and FACULTY can be
generalized to a higher level
entity called PERSON as shown in
Figure 1. In this case, common
attributes like P_NAME, P_ADD
become part of higher entity
(PERSON) and specialized
attributes like S_FEE become
part of Universityentity
specialized Insttute of Engineering (UIE)
Comparison of Record based
model
Hierarchical Network Relatonal
Relatinship between Relatinship between Relatinship between
recirds is if parent child recirds is expressed in the recirds is represented by a
type. firm if piinters ir links relatin that cintains a key
fir each recird invilved in
the relatinship.

Many ti Many relatinship Many ti Many relatinship Many ti Many relatinship


cannit be expressed in this can be easily implemented. can alsi be implemented.
midel
It is simple, straightirward Recird relatinship Relatinship
and natural methid if implementatin is very implementatin is very easy
implementng recird cimplex due ti the use if thriugh the use if a key ir
relatinships piinters cimpisite key feld

University Insttute of Engineering (UIE)


Comparison of Record based
Hierarchical
model
Network Relatonal
This type if midel is useful Netwirk midel is useful fir Relatinal midel is useful
inly when there is sime representng such recirds fir representng mist if the
hierarchical character in the which have many ti many real wirld ibjects and
database relatinships relatinships aming them

In irder ti represent links In netwirk midel alsi the Relatinal midel dies nit
aming recirds, piinters are recird relatins are physical maintain physical
used. Thus relatins aming cinnectin aming recird.
recirds are physical Data is irganized ligically in
the firm if riws and
cilumns, and stired in
table.

Searching fir recird is very Searching a recird is easy A unique indexed key feld Is
difcult since ine can since there are multple used ti search fir a data
retrieve a child inly afer access paths ti a data element.
giing thriugh its parent elements.
recird

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Data Models: A Summary


• Each new data model capitalized on the shortcomings of previous models
• Common characteristics:
– Conceptual simplicity without compromising the semantic
completeness of the database
– Represent the real world as closely as possible
– Representation of real-world transformations (behavior) must comply
with consistency and integrity characteristics of any data model

14
University Insttute of Engineering (UIE)
Department if Cimputer Science and Engineering (CSE)

Data Models: A Summary

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Data Dictionary
It contains information about the data attributes, elements relationship, user
details, security restrictions and integrity constraints.

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Data Definition Language


(DDL)
• ■ Specification notation for defining the database schema
– ★ E.g. create table account ( account-number char(10), balance integer)
• ■ DDL compiler generates a set of tables stored in a data dictionary
• ■ Data dictionary contains metadata (i.e., data about data)
– ★ database schema
– ★ Data storage and definition language
• ✔ language in which the storage structure and access methods used by the database system are specified
• ✔ Usually an extension of the data definition language

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Data Manipulation Language


(DML)
• ■ Language for accessing and manipulating the data organized by the
appropriate data model
– ★ DML also known as query language
• ■ Two classes of languages
– ★ Procedural – user specifies what data is required and how to get
those data
– ★ Nonprocedural – user specifies what data is required without
specifying how to get those data
• ■ SQL is the most widely used query language

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

SQL COMPONENTS

SQL consists of three components:


1. Data Definition Language (DDL)
2. Data Manipulation Language (DML)
3. Data Control Language (DCL)

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

DATA DEFINITION LANGUAGE (DDL)


This component of the SQL language is used to create and modify tables
and other objects in the database. For tables there are three main commands:

CREATE TABLE tablename  to create a table in the database


DROP TABLE tablename  to remove a table from the database
ALTER TABLE tablename  to add or remove columns from a table in the
database
RENAME <new table name> to <old table name>;  To change the name
of a table as per the user’s wish or requirement.
TRUNCATE TABLE<table name>;  Truncate Tables empties the table
completely. Once the data deleted cannot be retrieved.
DESC tablename  To view just the blank table

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

CREATE TABLE COMMAND


Purpose:- Tables are the basic unit of data storage in an Oracle
Database. Data is stored in rows and columns.

Syntax:- Create table <TableName> (<ColumnName1> <Data


Type>(<Size>), <ColumnName2> <Data Type>(<Size>),
………..<ColumnName n> <Data Type>(<Size>));

Example:-
Create table STUDENT (Roll_no number(5), Name varchar2(20), Branch
varchar2(10));

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

ALTER TABLE COMMAND

Purpose:- The structure of a table can be modified by using a alter table


command. Alter Table allows changing the structure of an existing table. With
Alter Table it is possible to add or delete columns, create or destroy indexes,
change the data type of existing columns, or rename columns or the table itself
Syntax:-
 Adding New Columns
Alter table <table name> add(<new col name> <data type> (<Size>), <new
col name> <data type> (<Size>),…..);

 Modifying Existing Column


Alter table <table name> modify(<col name> <new data type> (< new Size>),
<col name> <new data type> (<new Size>),…..);

 Dropping A Column
Alter table <table name> drop column <col name>;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Example:-
Alter table STUDENT add( Telephone number(10));
Alter table STUDENT modify( Telephone number(20));
Alter table STUDENT drop column Telephone;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

RENAME TABLE COMMAND

Purpose:- To change the name of a table as per the user’s wish or


requirement.

Syntax:- Rename <new table name> to <old table name>;

Example:- Rename STUDENT to group_a101;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

DROP TABLE COMMAND

Purpose:- Sometimes table in the database becomes obsolete and need to be


discarded, so we use drop table command.

Syntax:- Drop table <table name>;

Example:-
Drop table CSEA_Data101;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

DATA MANIPULATION LANGUAGE (DML)


DML component of the SQL language is used to manipulate data within a
table. There are four main commands:

SELECT  to select rows of data from a table

INSERT  to insert rows of data into a table

UPDATE  to change rows of data in a table

DELETE  to remove rows of data from a table

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

INSERT COMMAND

Command:- Insert data into a table

Purpose:- The Insert Into Table command is used to load the created table
with data to be manipulated later.

Syntax:- Insert into <table name>(<col1>,<col2>,……..,<col n>) values


(<expression1>, <expression2> ,……,<expression3>);

Example:-
Insert into STUDENT values(101, ‘Aanchal’, ’CSE’);
Insert into STUDENT values(126, ‘Jotnain’, ’CSE’);
Insert into STUDENT values(149, ‘Sapanpreet’, ’ECE’);
Insert into STUDENT values(151, ‘Savita’, ’CSE’);

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

INSERT DATA INTO A TABLE FROM A TABLE


(Copying contents of a table to another table)
Command:- Insert into….Select

Purpose:- To filter the data that is not required

Syntax:- Insert into <table name>Select <col name1>, <col name2>….


from <table name>;

Example:-
Insert into CSEA_Data101 Select roll_no,name from STUDENT where
roll_no=149;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

SELECT COMMAND

Command:- (a) Selecting all rows and all columns

Purpose:- This command is used to view all the rows and columns of the
table created in the database.

Syntax:- Select * from <table name>;

Example:-
Select * from STUDENT;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

SELECT COMMAND

(b) Selected rows and all columns using where clause

Purpose:- If the information of a particular student is to be retrieved from a


table, its retrieval must be based on a specific condition

Syntax:- Select * from <table name> where <condition>;

Example:-
Select * from STUDENT where roll_no=151;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

ALIAS

Purpose:- SQL aliases are used to give a table, or a column in a table, a


temporary name.

ALIAS COLUMN SYNTAX

Syntax:- SELECT column_name AS alias_name


FROM table_name;

Example:-
SELECT CustomerID AS ID, CustomerName AS Customer
FROM Customers;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

ALIAS TABLE SYNTAX

Syntax:- SELECT column_name(s) FROM table_name AS alias_name;

Example:-
SELECT o.OrderID, o.OrderDate, c.CustomerName
FROM Customers AS c, Orders AS o
WHERE c.CustomerName='Around the
Horn' AND c.CustomerID=o.CustomerID;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

DELETE COMMAND

Purpose:- To delete the rows from the table that satisfies the condition
provided by its where clause and returns the number of records deleted.

Syntax:- Removal of all rows


Delete from <table name>;

Removal of Specific Row(s)


Delete from <table name> where <condition>;

Example:-
Delete from CSEA_Data101 where rollno=149;
Delete from CSEA_Data101;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

DELETE & TRUNCATE


TRUNCATE
TRUNCATE is a DDL command
TRUNCATE is executed using a table lock and the whole table is locked to remove all
records.
We cannot use the WHERE clause with TRUNCATE.
TRUNCATE removes all rows from a table.
Minimal logging in the transaction log, so it is faster performance-wise.

DELETE
DELETE is a DML command.
DELETE is executed using a row lock, each row in the table is locked for deletion.
We can use where clause with DELETE to filter & delete specific records.
The DELETE command is used to remove rows from a table based on WHERE
condition.
It maintains the log, so it slower than TRUNCATE.

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

DROP COMMAND
1. The DROP command removes a table from the
database.
2. All the tables' rows, indexes, and privileges will also
be removed.
3. No DML triggers will be fred.
4. The operation cannot be rolled back.
5. DROP and TRUNCATE are DDL commands, whereas
DELETE is a DML command.
6. DELETE operations can be rolled back (undone),
while DROP and TRUNCATE operations cannot be
rolled back

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

Difference between DELETE, DROP and TRUNCATE


DELETE DROP TRUNCATE

1. It is a DML cimmand. 1. It is a DDL cimmand. 1. It is a DDL cimmand.

2. It is used ti delete riws ir recirds 2. It is used ti delete the entre table 2. It is used ti delete the entre
based in cinditins specifed in the aling with its schema and structure recirds if a table withiut afectng
WHERE clause. respectvely. the schema if the table.

3. If the WHERE clause is nit specifed


with cinditins it deletes all the 3. There is ni WHERE clause. 3. There is ni WHERE clause.
recirds if the table.

4. It is a DDL cimmand. As a result, 4. It is a DDL cimmand. As a result,


4. It is a DML cimmand. As a result, the changes cannit be rilled back ir the changes cannit be rilled back ir
the iperatin can be rilled back.
undine. undine.

5. It is faster than DELETE in executin


5. It scans every riw befire deletng because it dies nit scan every riw
5. It is faster and tme-saving.
making it sliwer and tme-cinsuming. befire deletng which makes it the
least tme-cinsuming.

6. Syntax: DELETE FROM TABLE 6. Syntax: TRUNCATE TABLE


6. Syntax: DROP TABLE Table_Name;
Table_Name WHERE [CONDITIONS]; Table_Name;
University Insttute of Engineering (UIE)
Department if Cimputer Science and Engineering (CSE)

UPDATE COMMAND
Purpose:- The Update statement updates columns in the existing table’s
rows with new values. The Set clause indicates which column data should
be modified and the new valued they should hold.
Syntax:-
 Updating Specific Records
Update <table name> set <col name1>=<expression1>, <col
name2>=<expression2> where <condition>;
 Updating All The Records
Update <table name> set <col name1>=<expression1>, <col
name2>=<expression2>;
Example:-
Update STUDENT set Branch=’ECE’ where roll_no=101;
Update STUDENT set Branch=’CSE’;

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

DATA CONTROL LANGUAGE (DCL)


This component of the SQL language is used to create privileges to allow
users access to, and manipulation of, the database. There are two main
commands:

GRANT  to grant a privilege to a user

REVOKE  to revoke (remove) a privilege from a user.

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

FAQ
1.Define DBMS? List Database system Applications.
2. Discuss Database Administrator’s responsibilities.
3. What do you understand by dimension and attribute?
4. What is a fact & a fact table?
5. List out few common mistakes encountered during Data
Modelling?
6. What do you understand by Data Modelling?
7. Explain your understanding of different data models?

University Insttute of Engineering (UIE)


Department if Cimputer Science and Engineering (CSE)

References
• OTHER REFRENCES
•     ER Diagram: Entity Relationship Diagram Model | DBMS Example (guru99.com)
•  ER Diagram Representation - Tutorialspoint
•  Entity Relationship Diagram - ER Diagram in DBMS (beginnersbook.com)
• http://nptel.ac.in/courses/Webcourse-contents/IISc-BANG/notused/IISc/New
%20Rajaram%20pdfs/module8.pdf
• http://ecomputernotes.com/fundamental/what-is-a-database/type-of-data-models
• https://beginnersbook.com/2015/04/data-models-in-dbms/
• http://www.odbms.org/wp-
content/uploads/2013/11/Data_Modeling_ConcepttoDBMS.pdf

SUGGESTED BOOK REFERENCES


• Ramez Elmasri and Shamkant B. Navathe,“Fundamentals of Database System”, The
Benjamin / Cummings Publishing Co.
• Korth and Silberschatz Abraham, “Database SystemConcepts”, McGraw Hall.
• Pratt,”DBMS”, Cengage Learning.

University Insttute of Engineering (UIE)

You might also like