Relational Database Management
Systems(RDBMS) and Legal Analytics
Ms.G.A.Pethunachiyar,
Assistant Professor,
The Tamil Nadu Dr.Ambedkar Law University,
Chennai.
BCALLB(Hons)-RDBMS and Legal Analytics
Database Management Systems
What is Data?
Data can be facts related to any object in
consideration.
Example : Student Name, Age,Class , Mark are the
data related to student
what is Database?
A database is an organized collection of structured
information, or data, typically stored electronically in a
computer system. A database is usually controlled by
a database management system (DBMS).
BCALLB(Hons)-RDBMS and Legal Analytics
What is DBMS?
Database Management System (DBMS) is a
software for storing and retrieving users' data
while considering appropriate security
measures. It consists of a group of programs
which manipulate the database. The DBMS
accepts the request for data from an application
and instructs the operating system to provide
the specific data. In large systems, a DBMS
helps users and other third-party software to
store and retrieve data.
BCALLB(Hons)-RDBMS and Legal Analytics
Applications of DBMS
BCALLB(Hons)-RDBMS and Legal Analytics
Database Management System (DBMS)
• Collection of interrelated data
• Set of programs to access the data
• DBMS contains information about a particular enterprise
• DBMS provides an environment that is both convenient and
efficient to use.
• Database Applications:
– Banking: all transactions
– Airlines: reservations, schedules
– Universities: registration, grades
– Sales: customers, products, purchases
– tax deductions
• Databases touch all aspects of our lives
BCALLB(Hons)-RDBMS and Legal Analytics
Purpose of Database System
• In the early days, database applications were built on top of file
systems
• Drawbacks of using file systems to store data:
– Data redundancy and inconsistency
• Multiple file formats, duplication of information in different
files
– Difficulty in accessing data
• Need to write a new program to carry out each new task
– Data isolation — multiple files and formats
– Integrity problems
• Integrity constraints become part of program code
• Hard to add new constraints or change existing ones
BCALLB(Hons)-RDBMS and Legal Analytics
Purpose of Database Systems
• Drawbacks of using file systems (cont.)
– Atomicity of updates
• Failures may leave database in an inconsistent state
with partial updates carried out
• E.g. transfer of funds from one account to another
should either complete or not happen at all
– Concurrent access by multiple users
• Concurrent accessed needed for performance
• Uncontrolled concurrent accesses can lead to
inconsistencies
– E.g. two people reading a balance and updating it at
the same time
– Security problems
• Database systems offer solutions to all the above problems
BCALLB(Hons)-RDBMS and Legal Analytics
View of Data
An architecture for a database system
BCALLB(Hons)-RDBMS and Legal Analytics
Levels of Abstraction
• Physical level describes how a record (e.g.,
customer) is stored.
• Logical level: describes data stored in database,
and the relationships among the data.
type customer = record
name : string;
street : string;
city : integer;
end;
• View level: application programs hide details of data
types. Views can also hide information (e.g.,
salary) for security purposes.
BCALLB(Hons)-RDBMS and Legal Analytics
Data Models
• Definition : A collection of tools for describing
data
data relationships
data semantics
data constraints
TYPES
• Entity-Relationship model
• Relational model
• Other models:
object-oriented model
semi-structured data models
Older models: network model and hierarchical
model BCALLB(Hons)-RDBMS and Legal Analytics
Data Modeling and Data Models
• Data modeling: Iterative and progressive process of
creating a specific data model for a determined problem
domain
Data models: Simple representations of complex
real-world data structures
Useful for supporting a specific problem domain
Model - Abstraction of a real-world object or event
11
Data Model Basic Building Blocks
Entity: Unique and distinct object used to collect and store
data
Attribute: Characteristic of an entity
Relationship: Describes an association among entities
One-to-many (1:M)
Many-to-many (M:N or M:M)
One-to-one (1:1)
Constraint: Set of rules to ensure data integrity
12
Naming Conventions
Entity names - Required to:
Be descriptive of the objects in the business
environment
Use terminology that is familiar to the users
Attribute name - Required to be descriptive of the
data represented by the attribute
Proper naming:
Facilitates communication between parties
Promotes self-documentation
13
The Evolution of Data Models
14
Standard Database Concepts
Schema
Schema : Conceptual organization of the entire database as viewed by
the database administratorsch
ema
Sub schema : Portion of the database seen by the application programs
that produce the desired information from the data within the database
15
The Conceptual Model
Represents a global view of the entire database by the entire
organization
Conceptual schema: Basis for the identification and high-
level description of the main data objects
Has a macro-level view of data environment
Is software and hardware independent
Logical design: Task of creating a conceptual data model
16
The Internal Model
Representing database as seen by the DBMS mapping
conceptual model to the DBMS
Internal schema: Specific representation of an internal model
Uses the database constructs supported by the chosen database
Is software dependent and hardware independent
Logical independence: Changing internal model without
affecting the conceptual model
17
The Physical Model
Operates at lowest level of abstraction
Describes the way data are saved on storage media such as
disks or tapes
Requires the definition of physical storage and data access
methods
Relational model aimed at logical level
Does not require physical-level details
Physical independence: Changes in physical model do not
affect internal model
18
Hierarchical Model
This database model organises data into a tree-like-
structure, with a single root, to which all the other data is
linked. The heirarchy starts from the Root data, and expands
like a tree, adding child nodes to the parent nodes.
In this model, a child node will only have a single parent
node.
In hierarchical model, data is organised into tree-like
structure with one one-to-many relationship between two
different types of data, for example, one department can
have many courses, many professors and many students.
BCALLB(Hons)-RDBMS and Legal Analytics
Hierarchical Model
BCALLB(Hons)-RDBMS and Legal Analytics
Hierarchical and Network Models
Hierarchical Models Network Models
Manage large amounts of data Represent complex data
for complex manufacturing relationships
projects Improve database
Represented by an upside- performance and impose a
down tree which contains database standard
segments Depicts both one-to-many
Segments: Equivalent of a file (1:M) and many-to-many
system’s record type (M:N) relationships
Depicts a set of one-to-many
(1:M) relationships
21
Hierarchical Model
Advantages
Promotes data sharing
Parent/child relationship promotes conceptual simplicity and data
integrity
Database security is provided and enforced by DBMS
Efficient with 1:M relationships
Disadvantages
Requires knowledge of physical data storage
characteristics
Navigational system requires knowledge of
hierarchical path
Changes in structure require changes in all application
programs
22
Implementation limitations
Network Model
BCALLB(Hons)-RDBMS and Legal Analytics
Network Model
• The network database model was created to
solve the shortcomings of the hierarchical
database model. In this type of model, a child can
be linked to multiple parents, a feature that was
not supported by the hierarchical data model. The
parent nodes are known as owners and the child
nodes are called members.
BCALLB(Hons)-RDBMS and Legal Analytics
Network Model
Advantages
Conceptual simplicity
Handles more relationship types
Data access is flexible
Data owner/member relationship promotes data integrity
Conformance to standards
Includes data definition language (DDL) and data manipulation
language (DML)
Disadvantages
System complexity limits efficiency
Navigational system yields complex implementation, application
development, and management
Structural changes require changes in all application programs
25
The Relational Model
Relational model can represent as a table with columns and rows.
Each row is known as a tuple. Each table of the column has a
name or attribute.
Domain: It contains a set of atomic values that an attribute can
take.
Attribute: It contains the name of a column in a particular table.
Each attribute Ai must have a domain, dom(Ai)
Relational instance: In the relational database system, the
relational instance is represented by a finite set of tuples. Relation
instances do not have duplicate tuples.
Relational schema: A relational schema contains the name of the
relation and name of all columns or attributes.
Relational key: In the relational key, each row has one or more
attributes. It can identify the row in the relation uniquely. 26
Relational Model
Advantages
Structural independence is promoted using independent table
Tabular view improves conceptual simplicity
Ad hoc query capability is based on SQL
Isolates the end user from physical-level details
Improves implementation and management simplicity
Disadvantages
cost : The cost of database is expensive
performance : It depends on number of tables
Physical Storage :A relational database also require
tremendous amount of physical memory since it is with rows an
columns. Each of the operations depend on separate physic
storage. 27
The Entity Relationship Model
Graphical representation of entities and their relationships in a
database structure
Entity relationship diagram (ERD)
Uses graphic representations to model database components
Entity instance or entity occurrence
Rows in the relational table
Connectivity: Term used to label the relationship types
28
ER Model
Advantages
Visual modeling yields conceptual Simplicity
Visual representation makes it an effective communication tool
Is integrated with the dominant relational model
Disadvantages
Limited constraint representation
Limited relationship representation
No data manipulation language
Loss of information content occurs when attributes are removed
from entities to avoid crowded displays
The ER Model
30
The Object-Oriented Data Model (OODM)
or Semantic Data Model
Object-oriented database management system(OODBMS)
Based on OODM
Object: Contains data and their relationships with operations that
are performed on it
Basic building block for autonomous structures
Abstraction of real-world entity
Attributes - Describe the properties of an object
31
The Object-Oriented Data Model (OODM)
Class: Collection of similar objects with shared structure and
behavior organized in a class hierarchy
Class hierarchy: Resembles an upside-down tree in which each class
has only one parent
Inheritance: Object inherits methods and attributes of parent class
Unified Modeling Language (UML)
Describes sets of diagrams and symbols to graphically model a system
32
Object Oriented Data Model
BCALLB(Hons)-RDBMS and Legal Analytics
Database Languages
• Data Definition Language (DDL)
• Data Manipulation Language (DML)
BCALLB(Hons)-RDBMS and Legal Analytics
Data Definition Language (DDL)
• Specification notation for defining the database schema
– E.g.
create table student(
regno char(10),
name char(25) )
• 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
BCALLB(Hons)-RDBMS and Legal Analytics
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
BCALLB(Hons)-RDBMS and Legal Analytics
Database Users
• Users are differentiated by the way they expect to interact
with the system
• Application programmers – interact with system through
DML calls
• Sophisticated users – form requests in a database query
language
• Specialized users – write specialized database applications
that do not fit into the traditional data processing framework
• Naïve users – invoke one of the permanent application
programs that have been written previously
– E.g. people accessing database over the web, bank
officers
BCALLB(Hons)-RDBMS and Legal Analytics
Database Administrator
• Coordinates all the activities of the database system;
the database administrator has a good
understanding of the enterprise’s information
resources and needs.
• Database administrator's
duties/Responsibilities include:
Schema definition
Storage structure and access method definition
Schema and physical organization modification
Granting user authority to access the database
Specifying integrity constraints
Acting as liaison with users
Monitoring performance
BCALLB(Hons)-RDBMS and Legal Analytics
and responding to changes in
Schema Defintion
BCALLB(Hons)-RDBMS and
Legal Analytics
Storage Structure
BCALLB(Hons)-RDBMS and
Legal Analytics
Physical Organization Modification
Databases are stored physically on storage
devices and organised as files and records.
The overall performance of a database
system is determined by the physical
database organisation. Therefore, it is
important that the physical organisation of
data is efficiently managed.
BCALLB(Hons)-RDBMS and
Legal Analytics
Overall System Structure
BCALLB(Hons)-RDBMS and Legal Analytics
Application Architectures
Two-tier architecture: E.g. client programs using ODBC/JDBC to
communicate with a database
Three-tier architecture: E.g. web-based applications, and
applications built using “middleware”
BCALLB(Hons)-RDBMS and Legal Analytics
ER Diagram
An Entity Relationship Diagram (ERD) is a
visual representation of different entities
within a system and how they relate to
each other.
BCALLB(Hons)-RDBMS and
Legal Analytics
ER Diagram Elements
BCALLB(Hons)-RDBMS and Legal Analytics
Entity
An entity can be a person, place, event, or
object that is relevant to a given system.
For example, a College system may include
students, teachers, major courses, subjects,
fees, and other items. Entities are represented
in ER diagrams by a rectangle
BCALLB(Hons)-RDBMS and
Legal Analytics
Entity Diagram
Weak Entity
•A weak entity is an entity that depends on the
existence of another entity.
The bank account of a particular bank has no
existence if the bank doesn’t exist anymore.
The existence of rooms is entirely dependent
on the existence of a hostel. So room can be
seen as the weak entity of the hostel.
BCALLB(Hons)-RDBMS and
Legal Analytics
Weak Entity
BCALLB(Hons)-RDBMS and Legal Analytics
Attribute
An attribute is a
property, or
characteristic of an
entity, relationship,
or another
attribute.
BCALLB(Hons)-RDBMS and
Legal Analytics
Multivalued Attribute
If an attribute can have
more than one value it is
called a multi-valued
attribute
BCALLB(Hons)-RDBMS and
Legal Analytics
Derived Attribute
An attribute based
Example
on another attribute.
This is found rarely Date of Birth
in ER diagrams.
Age
BCALLB(Hons)-RDBMS and Legal Analytics
Composite Attributes
• Attributes can have
its own attributes
BCALLB(Hons)-RDBMS and Legal Analytics
Relationship
A relationship describes
how entities interact. For
example, the entity
“Carpenter” may be
related to the entity
“table” by the relationship
“builds” or “makes”.
Relationships are
represented by diamond
shapes and are labeled
using verbs.
BCALLB(Hons)-RDBMS and Legal Analytics
Recursive Relationship
• If the same entity
participates more
than once in a
relationship it is
known as a
recursive
relationship.
BCALLB(Hons)-RDBMS and Legal Analytics
ER Diagram for online Banking System
• We want to build a system for online banking
system. In the system the accounts can be opened
in a branch. The branch gives loan to the
customer. The customer borrows loan and the loan
is paid through a weak entity “payment”. The
customer can deposit in his account. The
employee serves the customer. An account can be
a saving account or a current account.
• Identify the possible entities and their attribute, the
relationships among the attributes and draw the E-
R diagram for the above mentioned activities
Entities and their attributes
Step 1: Identify the entities and their attributes
1. Branch branch-name, branch-city, assets
2. Customer customer-id, customer-name,
Customer-street, customer-city
3. Loan loan-number, amount
4. Payment payment-number, payment-amount, payment-date
5. Account account-number, balance
6. Saving-account interest-rate, Account no., Name
7.Current-account interest-rate, Account no. Name
8. Employee employee-ID, employee-name, start-
date,telephone-number
BCALLB(Hons)-RDBMS and
Legal Analytics
ER Diagram
Step 2: Identify the relationships among the
entities
•1. Branch have Account
•2. Branch gives Loan
•3. loan paid as payment
•4. Customer borrows loan
•5. Customer deposits account
•6. Employee serves Customer
BCALLB(Hons)-RDBMS and
Legal Analytics
ER Diagram