Download presentation
Presentation is loading. Please wait.
1
Introduction to RDBMS
2
RDBMS Relational database management system.
Data is stored in the form of tables and there is a relationship between these tables.
3
DATA PROCESSING Sequence of operations on data to convert it into useful information. Different operations and methods are applied on the data. OPERATIONS- Arithmetic and logical operations. To send and receive data from one location to other. Classification of data. Arranging data into a specific order etc.
4
METHODS OF DATA PROCESSING
Manual data processing. Mechanical data processing. Electronic data processing.
5
DATA MODELS Data Model can be defined as an integrated collection of concepts for describing and manipulating data, relationships between data, and constraints on the data in an organization. It is used for representing entities of interest and their relationships in database.
6
TYPES OF DATA MODELS Record-based data model Object- based data model
Physical data model
7
RECORD BASED DATA MODELS
Record based data models specify the overall logical structure of the database and provides a higher-level description of the implementation. Record based models are so named because the database is structured in fixed format records of several types. The three most widely accepted record based data models are: • Hierarchical Model • Network Model • Relational Model
8
OBJECT BASED MODELS Object–based data models are used to describe data and its relationships. It uses concepts such as entities, attributes and relationships. Following are the common types of object-based data models: • Entity-Relationship • Object Oriented • Semantic • Functional
9
PHYSICAL DATA MODELS Physical data models describe how data is stored in the computer, representing information such as record structures, record ordering, and access paths. Two types of physical data models are: • Unifying model • Frame memory model
10
HIERARCHICAL DATA MODEL
A hierarchical database model is a data model in which the data is organized into a tree-like structure. The data is stored as records which are connected to one another through links. E.g. University Department Faculty
11
NETWORK DATA MODEL This model is same as hierarchical model, except that a record can have multiple parents. Network model has three basic components- record type , data items and links.
12
RELATIONAL DATA MODEL Relational model stores data in the form of tables. The relational model consists of three major components: The set of relations and set of domains that defines the way data can be represented (data structure). Integrity rules that define the procedure to protect the data (data integrity). The operations that can be performed on data (data manipulation).
14
DATABASE DESIGN TECHNIQUES
Top down Approach – E R Modeling Bottom Up approach – Normalization
15
ER MODELLING The ER model is a conceptual data model that views the real world as entities and relationships. A basic component of the model is the Entity-Relationship diagram, which is used to visually represent data objects. Entity relationship model defines the conceptual view of database.
16
BASIC CONCEPTS IN ER MODEL
An entity is an object that exists and is distinguishable from other objects. Example: specific person, company, event, plant An entity set is a set of entities of the same type that share the same properties. Example: set of all persons, companies, trees, holidays Entities have attributes- simple attributes, composite attributes, derived attributes, single-valued attributes etc. Example: people have names and addresses A relationship A Relationship represents an association between two or more entities. Relationships are classified in terms of degree, connectivity, cardinality, and existence.
17
DEGREE OF RELATIONSHIP- The number of participating entities in an relationship defines the degree of the relationship. Unary = degree 1 Binary = degree 2 Ternary = degree 3 employee manager-of employee is unary employee works-for department is binary customer purchase item, shop keeper is a ternary relationship MAPPING CARDINALITIES: Cardinality defines the number of entities in one entity set which can be associated to the number of entities of other set via relationship set..
18
One-to-one: one entity from entity set A can be associated with at most one entity of entity set B and vice versa One-to-many: One entity from entity set A can be associated with more than one entities of entity set B but from entity set B one entity can be associated with at most one entity.
19
Many-to-one: More than one entities from entity set A can be associated with at most one entity of entity set B but one entity from entity set B can be associated with more than one entity from entity set A. Many-to-many: one entity from A can be associated with more than one entity from B and vice versa.
20
NOTATIONS IN ER MODEL
22
EXTENDED ER FEATURES Specialization: Top-down design process. Specialization is the process of taking subsets of a higher-level entity set to form lower level entity sets. It is a process of defining a set of subclasses of an entity type, which is called as superclass of the specialization. For example, specialization of the Employee entity type may yield the set of subclasses namely Salaried_Employee and Hourly_Employee on the method of pay
23
Generalization: A bottom-up design process
A generalization hierarchy is a form of abstraction that specifies that two or more entities that share common attributes can be generalized into a higher-level entity type called a super type or generic entity. The lower level of entities becomes the subtype, or categories, to the super type. Subtypes are dependent entities. Generalization is denoted through a triangle component labeled ‘IS A”.
24
Aggregation One limitation of the E-R model is that it cannot express relationships among relationships. The best way to model a situation like this is by the use of aggregation.
25
NORMALIZATION Normalization is a process of decomposing a set of relations with anomalies to produce smaller and well structured relations that contain minimum or no redundancy. It is a formal process of deciding which attributes should be grouped together in a relation. The process of normalization can be defined as the procedure of successive reduction of a given collection of relational schemas based on their FD’s and primary keys to achieve some desirable form of minimized redundancy.
26
NORMAL FORMS First normal form (1NF) Second normal form (2NF)
Third normal form (3NF) Boyce/ Codd normal form (BCNF) Fourth normal form (4NF) Fifth normal form (5NF)
27
LOGICAL DATABASE DESIGN
The logical design is more conceptual and abstract than the physical design. In the logical design, you look at the logical relationships among the objects. In the physical design, you look at the most effective way of storing and retrieving the objects. The process of logical design involves arranging data into a series of logical relationships called entities and attributes. An entity represents a chunk of information. In relational databases, an entity often maps to a table. An attribute is a component of an entity and helps define the uniqueness of the entity. In relational databases, an attribute maps to a column. You can create the logical design using a pen and paper, or you can use a design tool such as Oracle Warehouse Builder or Oracle Designer.
28
SQL (Structured Query Language)
SQL is a relational the query language. It is the standard command set used to communicate with the relational database management system (RDBMS). It is a non-procedural language. SQL is both data definition language and data manipulation language.
29
COMPONENTS OF SQL Data structure. Data type. SQL operators.
Data definition language (DDL) Data query language (DQL) Data manipulation language (DML) Data control language (DCL) Data administration statements (DAS) Transaction control statements (TCS)
30
ADVANTAGES AND DISADVANTAGES
very flexible , free-format syntax. Supported by every product. It can express arithmetic operations as well as operations to aggregate data and sort data for output. Disadvantages: It is not a general-purpose programming language and thus the development of an application requires the use of a SQL with a programming language.
31
DDL(Data Definition Language)
DDL is a special language used to specify a database conceptual schema using set of definitions. It supports the definitions or declaration of objects. Create Alter Drop Truncate
32
DML(Data Manipulation Language)
DML is a mechanism that provides a set of operations to support the basic data manipulation operations on the data. It is used to retrieve data stored in a database, express database queries and updates . It helps in communicating with DBMS. Insert Update Delete Select
33
DCL (Data Control Language)
DCL statements are used to control access to data stored in a database. Commands of DCL are: Grant Revoke Commit Rollback
34
SQL JOINS SQL join is used for combining column from two or more tables by using values common to both tables. Join keyword is used in SQL queries for joining tables. Minimum required condition is ,(n-1). A table can also join to itself known as, Self Join
35
TYPES OF JOINS Cartesian Product Inner join Equi join Outer join
– Left-outer join – Right-outer join Self join
36
Cartesian Product: Returns All rows from first table, Each row from the first table is combined with all rows from the second table. Inner join : is the Cartesian product that satisfies the join condition in the WHERE clause. Equi join : In this join , where clause is based on the equality condition “=“. Hence it is called equi join.
37
Outer Join: Retrieve all rows that match the WHERE clause and also those that have a NULL value in the column used for join. Left outer joins include all records from the first (left) of two tables, A = B (+) Right outer joins include all records from the second (right) of two tables, A (+) = B
38
SUB QUERIES Queries inside the main query.
Sub queries are used to structure the queries. In many cases, a sub query can be used instead of a JOIN (and vice versa) e.g Select cust_ID, Loan_no From Customer_Loan Where amount_in_dollars > (Select amount_in_dollars Where Cust_ID = 104);
39
VIEWS A view is a kind of “virtual table”.
Views are tables whose contents are taken or derived from other tables. To the user, the view appears like a table with columns and rows. But in reality, the view doesn’t exists in the database as a stored set of values View is like a window through which we see a limited region of the actual table The table from where the actual data is obtained is called the source table
40
e.g.CREATE VIEW ViewCustomerDetails AS SELECT *FROM Customer_Details;
We can use views in select statements like. Select * from view_employees where age > 23; Create a view e.g.CREATE VIEW ViewCustomerDetails AS SELECT *FROM Customer_Details;
41
TYPES OF VIEWS Horizontal views- Horizontal view restricts a user’s access to only selected rows of a table. Vertical views - A view which selects only few columns of a table, Vertical view restricts a user’s access to only certain columns of a table Row/column subset views – e.gCREATE VIEW View_Cust_VertHor AS SELECT Cust_Id,Account_No,Account_Type FROM Customer_Details WHERE CUST_ID IN (101,102,103);
42
Grouped views-The query contains a group by clause
e.g CREATE VIEW View_GroupBY(Dept,NoofEmp) AS SELECT Department, count(Employee_ID) FROM Employee_Manager GROUP BY Department; Joined views- Created by specifying a two-table or three-table query in the view creation command e.g. Create view View_Cust_Join as Select a.Cust_Id,b.Cust_First_Name,b.Cust_Last_Name, Amount_in_dollars from Customer_loan a, customer_details b where a.cust_id = b.cust_id;
43
DATABASE DESIGN ISSUES
Poor or missing documentation for database(s) in production Little or no normalization Not treating the data model like a living, breathing organism Improper storage of reference data Not using foreign keys or check constraints Not using domains and naming standards Not choosing primary keys properly
44
ANY QUERIES???
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.