APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Database Management System (22CSH-243)
Faculty: Ms. Shaveta Jain(E13464)
RELATIONAL MODEL DISCOVER . LEARN . EMPOWER
1
DBMS: Course Objectives
COURSE OBJECTIVES
The Course aims to:
•Understand database system concepts and design databases for different applications
and to acquire the knowledge on DBMS and RDBMS.
•Implement and understand different types of DDL, DML and DCL statements.
•Understand transaction concepts related to databases and recovery/backup techniques
required for the proper storage of data.
2
COURSE OUTCOMES
On completion of this course, the students shall be able to:-
CO2 Design database for an organization using relational model
3
Unit-1 Syllabus
Unit-1 Introduction to Databases and Relational Algebra
Overview of Database concepts, DBMS, Data Base System Architecture (Three
Databases: 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 Introduction, Syntax, Semantics, Additional operators, Grouping and
Algebra & Ungrouping, Relational comparisons, Tuple Calculus, Domain
Relational Calculus, Calculus Vs Algebra, Computational capabilities
Calculus:
4
Intro to Relational Model
Example of a Relation
attributes
(or columns)
tuples
(or rows)
Attribute Types
• The set of allowed values for each attribute is
called the domain of the attribute
• Attribute values are (normally) required to be
atomic; that is, indivisible
• The special value null is a member of every
domain. Indicated that the value is “unknown”
• The null value causes complications in the
definition of many operations
Relation Schema and Instance
• A1, A2, …, An are attributes
• R = (A1, A2, …, An ) is a relation schema
Example:
instructor = (ID, name, dept_name, salary)
• Formally, given sets D1, D2, …. Dn a relation r is a subset
of
D1 x D2 x … x Dn
Thus, a relation is a set of n-tuples (a1, a2, …, an) where
each ai Di
The current values (relation instance) of a relation are specified by
a table
An element t of r is a tuple, represented by a row in a table
Relations are Unordered
Order of tuples is irrelevant (tuples may be stored in an arbitrary order)
Example: instructor relation with unordered tuples
Keys • Let K R
• K is a superkey of R if values for K are sufficient to identify
a unique tuple of each possible relation r(R)
• Example: {ID} and {ID,name} are both superkeys of instructor.
• Superkey K is a candidate key if K is minimal
Example: {ID} is a candidate key for Instructor
• One of the candidate keys is selected to be the primary key.
• which one?
• Foreign key constraint: Value in one relation must appear in
another
• Referencing relation
• Referenced relation
• Example – dept_name in instructor is a foreign key from instructor
referencing department
Schema Diagram for University Database
Relational Query Languages
• Procedural vs .non-procedural, or declarative
• “Pure” languages:
• Relational algebra
• Tuple relational calculus
• Domain relational calculus
• The above 3 pure languages are equivalent in
computing power
• We will concentrate in this chapter on relational
algebra
• Not turning-machine equivalent
• consists of 6 basic operations
Notes about Relational Languages
• Each Query input is a table (or set of tables)
• Each query output is a table.
• All data in the output table appears in one of the
input tables
• Relational Algebra is not Turning complete
• Can we compute:
• SUM
• AVG
• MAX
• MIN
References
• RamezElmasri and Shamkant B. Navathe, “Fundamentals of Database
System”, The Benjamin / Cummings Publishing Co.
• Korth and Silberschatz Abraham, “Database System Concepts”,
McGraw Hall.
• C.J.Date, “An Introduction to Database Systems”, Addison Wesley.
• Thomas M. Connolly, Carolyn & E. Begg, “Database Systems: A
Practical Approach to Design, Implementation and Management”, 5/E,
University of Paisley, Addison-Wesley.
14
THANK YOU
For queries
Email: [email protected]
15