SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Relational Database Management Systems

 Rationale


                Databases are an integral part of an organization. Aspiring
                Database Developers should be able to efficiently design
                and implement databases.
                Knowledge of these will enable the developers to build
                robust database solutions.
                This module will help students understand concepts related
                to relational databases.




     Ver. 1.0                      Session 1                        Slide 1 of 34
Relational Database Management Systems

 Objectives


                • In this session, you will learn to:
                       Define a Database Management System
                       Describe the types of data models
                       Create an entity-relationship model
                       List the types of relationships between entities
                       Define a Relational Database Management System
                       Describe the operators that work on relations




     Ver. 1.0                           Session 1                         Slide 2 of 34
Relational Database Management Systems

 Database Management Systems


                A database is a collection of logically related information.
                Database Management is the task of maintaining databases
                so that information is readily available.
                The software required to perform the task of database
                management is called a Database Management System
                (DBMS).




     Ver. 1.0                      Session 1                         Slide 3 of 34
Relational Database Management Systems

 Data Models


                Can be classified into two categories:
                   Object-based logical model focuses on describing the data, the
                   relationship among the data, and any constraints defined
                   Record-based logical model focuses on describing the data
                   structure and the access techniques in the DBMS




     Ver. 1.0                       Session 1                            Slide 4 of 34
Relational Database Management Systems

 Object-Based Logical Model


                There are various object-based models. The most widely
                used is the Entity-Relationship model (ER model)
                introduced by Peter Chen.




     Ver. 1.0                     Session 1                       Slide 5 of 34
Relational Database Management Systems

 Entities


                 Chen defined an entity as “a thing, which can be easily
                 identified”.
                 An entity is any object, place, person, or activity about
                 which data is recorded.
                 In the diagramming technique, entities are named and
                 represented inside a box.
                 An entity type is a set of things that share common
                 properties:
                    STUDENT, COURSE, and GRADE are examples of entity
                    type.
                    An entity type is usually in uppercase.




      Ver. 1.0                       Session 1                          Slide 6 of 34
Relational Database Management Systems

 Entities (Contd.)


                 Types of Entities:
                    Dependent entity:
                      • Is an entity whose existence depends on the existence of another
                        entity and are also called weak entities
                    Independent entity:
                        Is an entity which does not depend on any other entity for
                        existence and are also called regular entities




      Ver. 1.0                          Session 1                                    Slide 7 of 34
Relational Database Management Systems

 Relationships


                Chen defines a relationship as “an association among
                entities”.
                   For example, the relationship between students and instructors
                    represents the fact that an instructor teaches several students
                   and a student is taught by several instructors. This relationship
                   could be named TEACH.
                Relationships are depicted as a diamond with the name of
                the relationship type.




     Ver. 1.0                        Session 1                              Slide 8 of 34
Relational Database Management Systems

 Relationships (Contd.)


                A relationship type is an association of entity types
                (STUDENT-INSTRUCTOR).
                A relationship can associate an entity with itself. For
                example, one instructor in a university may marry another
                instructor.
                Multiple relationships can also exist between the same
                entities.




     Ver. 1.0                      Session 1                        Slide 9 of 34
Relational Database Management Systems

 Just a minute


                The following statement has been extracted from a case
                presented by a manufacturer regarding the maintenance of
                their data: “A supplier ships certain parts.” Identify the
                entities mentioned in this statement, and their relationship.
                Draw a diagram depicting the relationship.




     Ver. 1.0                       Session 1                         Slide 10 of 34
Relational Database Management Systems

 Just a minute (Contd.)


                Answer:
                   Entities: SUPPLIER, PARTS
                   Relationship: SHIP (or SHIPMENT)




                  SUPPLIERS                   SHIP    PARTS




     Ver. 1.0                     Session 1                   Slide 11 of 34
Relational Database Management Systems

 Types of Relationships


                There are three types of relationships:
                   One-to-One
                   One-to-Many (or Many-to-One)
                   Many-to-Many




     Ver. 1.0                       Session 1             Slide 12 of 34
Relational Database Management Systems

 One-to-One Relationship


                Consider the example of a university. For one
                DEPARTMENT (like the department of social sciences)
                there can be only one department head. This is a
                one-to-one relationship.




     Ver. 1.0                     Session 1                     Slide 13 of 34
Relational Database Management Systems

 Many-to-One Relationship


                A STUDENT can MAJOR in only one course, but many
                STUDENTs would have registered for a given MAJOR
                course. This is a many-to-one relationship.




     Ver. 1.0                    Session 1                   Slide 14 of 34
Relational Database Management Systems

 Many-to-Many Relationship


                A STUDENT can take many COURSEs and many
                STUDENTs can register for a given COURSE. This is a
                many-to-many relationship.




     Ver. 1.0                     Session 1                     Slide 15 of 34
Relational Database Management Systems

 Just a minute


                What do the following ER diagrams represent?




     Ver. 1.0                     Session 1                    Slide 16 of 34
Relational Database Management Systems

 Just a minute (Contd.)


                Answer:
                   Many students can work on many projects.
                   Many employees belong to only one department.




     Ver. 1.0                      Session 1                       Slide 17 of 34
Relational Database Management Systems

 Just a minute

                Consider the following statement of a manufacturing
                company:
                “A supplier ships certain parts. A particular part is not
                necessarily shipped by only one supplier. No supplier ships
                only a single part.”
                What type of relationship is this? Draw a diagram to depict
                the relationship.


                Answer:
                   Many-to-many type

                             m                         m
                  SUPPLIER                 SHIP             PARTS




     Ver. 1.0                      Session 1                        Slide 18 of 34
Relational Database Management Systems

 Attributes


                Attributes are a property of a given entity.
                Attributes are depicted as ellipses, labeled with the name of
                the property.




     Ver. 1.0                       Session 1                         Slide 19 of 34
Relational Database Management Systems

 Just a minute


                A manufacturer needs to maintain the following details
                about the supplier:
                a. Name
                b. Address
                c. Credit Status
                d. Assigned code number
                Draw a diagram to show this information.




     Ver. 1.0                      Session 1                       Slide 20 of 34
Relational Database Management Systems

 Just a minute (Contd.)


                Answer:




                          CODE                NAME


                                 SUPPLIER



                          ADD                CR_STATU
                                             S




     Ver. 1.0                    Session 1              Slide 21 of 34
Relational Database Management Systems

 Subtypes and Supertypes


                Subtype:
                   Is a subset of another entity. It is always dependent on the
                   supertype for its existence
                   Is connected to the supertype by an unnamed relationship
                Supertype:
                   Is connected to the relationship with a line containing a
                   crossbar
                   Is described by attributes that belong to all subtypes. The
                   subtype is described by the attributes that are unique to it




     Ver. 1.0                        Session 1                              Slide 22 of 34
Relational Database Management Systems

 Just a minute


                •   There are two types of suppliers. One type of supplier
                    allows credit, while the other type insists on payment in
                    cash before delivery. The manufacturer wishes to maintain
                    separate information on these two types of suppliers. For
                    the credit supplier, “credit period” and “credit limit” have to
                    be recorded. For the cash supplier, “date of payment” has
                    to be stored. Represent this diagrammatically.

                    Answer:
                                           SUPPLIERS



                              CASH                           CREDIT




                          PAY_DT             CR_LIMIT         CR_PERIOD




     Ver. 1.0                           Session 1                           Slide 23 of 34
Relational Database Management Systems

 Record-Based Logical Model


                The three types of record-based models are:
                   Hierarchical model
                    • In a hierarchical model, data is represented in the form of a tree.
                   Network model
                    • A network model is similar to a hierarchical model in the way that
                      data and the relationships among them are represented in the
                      form of records and links.
                   Relational model
                      In the relational model, the database is structured in fixed-format
                      records of several types.




     Ver. 1.0                         Session 1                                  Slide 24 of 34
Relational Database Management Systems

 Relational Model


                Dr. E. F. Codd first described the relational model in 1970.
                Relational model is an attempt to simplify the database
                structure.
                It represents all data in the database as simple tables in the
                row-column format.
                RDBMS can be defined as a DBMS where all data visible to
                the user is organized strictly as tables of data values and
                where all database operations work on these tables.




     Ver. 1.0                       Session 1                         Slide 25 of 34
Relational Database Management Systems

 Relational Data Structure


                The organizing principle in a relational database is the table,
                a tabular arrangement of data values:
                   A table is called a relation.
                   The row (or record) in the table is called a tuple.
                   The column (or field) is called an attribute.
                   The number of tuples is called the cardinality, and the number
                   of attributes is called the degree of the table.
                   Rows are unordered and each row must have some columns
                   or a combination of columns that uniquely identifies each row,
                   called the primary key of the table.
                A domain is a pool of values from which one or more
                attributes (columns) draw their actual values.




     Ver. 1.0                        Session 1                           Slide 26 of 34
Relational Database Management Systems

 Representing Missing Information


                Missing or unknown information is represented as NULL in
                a relational system:
                   NULL is not the same as space or zero.




     Ver. 1.0                       Session 1                     Slide 27 of 34
Relational Database Management Systems

 Representing Relationships in an RDBMS


                At any given time, no two rows of the table contain the same
                values in a column or column combination. This column (or
                columns) is called the primary key of the table.
                A column in one table whose value matches the primary key
                in some other table is called a foreign key
                Together, a primary key and a foreign key create a
                parent-child relationship between the tables that connects
                them




     Ver. 1.0                      Session 1                        Slide 28 of 34
Relational Database Management Systems

 Relational Operators


                The relational model is based on the principle of relational
                algebra:
                   It is a collection of operators operating on relations.
                   Each operator takes one or two relations as its input and
                   produces a new relation as its output.
                Relational Operators are of the following types:
                 – RESTRICT: Extracts specified tuples or rows from a given
                   relation, based on a condition.
                 – PROJECT: Extracts specified attributes or columns from a
                   given relation.
                 – PRODUCT: Builds a relation from two specified relations. It
                   consists of all possible combinations of tuples, one from each
                   of the two relations.




     Ver. 1.0                        Session 1                            Slide 29 of 34
Relational Database Management Systems

 Relational Operators (Contd.)


                – UNION: Builds a relation from tuples appearing in either or
                  both of the specified relations. To be union compatible, the two
                  tables should have the same types of attributes.
                – INTERSECT: Builds a relation consisting of tuples that appear
                  in both relations.
                – DIFFERENCE: Builds a relation of tuples appearing in the first
                  but not the second of two specified relations.
                – JOIN: Builds a relation from two specified relations which
                  consists of all possible combinations of tuples, one from each
                  relation, that satisfy the specified condition.
                – DIVIDE: The Divide operator takes two relations and builds
                  another relation consisting of values of an attribute of one
                  relation that match all the values in the other relation.




     Ver. 1.0                       Session 1                             Slide 30 of 34
Relational Database Management Systems

 Applications of an RDBMS


                Some typical applications of an RDBMS are:
                   Airline and railway reservations
                   Banking applications
                   Manufacturing industry
                   Order processing
                   Hospital management systems
                   Library management systems
                   Hotel industry




     Ver. 1.0                        Session 1               Slide 31 of 34
Relational Database Management Systems

 Applications of an RDBMS (Contd.)


                Several RDBMS products are available today. Some
                popular products are:
                   Sybase
                   Oracle
                   Microsoft SQL Server
                   Ingress
                   DB2




     Ver. 1.0                      Session 1                       Slide 32 of 34
Relational Database Management Systems

 Summary


                In this session, you learned that:
                   Data models can be classified as:
                     • Object-based models
                     • Record-based models
                   In the entity-relationship diagramming technique:
                     • Entities are represented as rectangles.
                     • Relationships are represented as diamonds.
                     • Attributes are represented as ellipses.
                 – Relationships, whether many-to-many, one-to-many, or
                   one-to-one, are represented symbolically.
                 – Weak entities are represented in double-lined boxes.
                 – Subtypes are connected to the supertype by an unnamed
                   relationship, marked with a crossbar on top.




     Ver. 1.0                         Session 1                        Slide 33 of 34
Relational Database Management Systems

 Summary (Contd.)


                In the relational model, data is represented in tables (relations)
                of rows (tuples) and columns (attributes).
                The number of tuples is called the cardinality of the relation,
                and the number of attributes is called the degree of the
                relation.
                An attribute (or set of attributes) that is unique in every tuple is
                called the primary key.
                Unknown or missing information is represented by a NULL in a
                table.
                The foreign key is a column in one table that matches the
                primary key of another table.
                The relational model is based on the principle of relational
                algebra.
                The eight operators that operate on relations are restrict,
                project, product, union, intersect, difference, join, and divide.


     Ver. 1.0                      Session 1                               Slide 34 of 34

Weitere ähnliche Inhalte

Was ist angesagt?

Bases de datos.ppt presentacion
Bases de datos.ppt presentacionBases de datos.ppt presentacion
Bases de datos.ppt presentacion
andreaydarlys
 
1 introduction databases and database users
1 introduction databases and database users1 introduction databases and database users
1 introduction databases and database users
Kumar
 
Base de Datos - Modelo Entidad Relación
Base de Datos - Modelo Entidad RelaciónBase de Datos - Modelo Entidad Relación
Base de Datos - Modelo Entidad Relación
Angela Inciarte
 
Diagrama de componentes
Diagrama de componentesDiagrama de componentes
Diagrama de componentes
uitron
 
Estrategias de procesamiento de consultas distribuidas
Estrategias de procesamiento de consultas distribuidasEstrategias de procesamiento de consultas distribuidas
Estrategias de procesamiento de consultas distribuidas
José Mendoza
 

Was ist angesagt? (20)

Bases de datos.ppt presentacion
Bases de datos.ppt presentacionBases de datos.ppt presentacion
Bases de datos.ppt presentacion
 
1 introduction databases and database users
1 introduction databases and database users1 introduction databases and database users
1 introduction databases and database users
 
Data Models & Introduction to UML
Data Models & Introduction to UML Data Models & Introduction to UML
Data Models & Introduction to UML
 
The relational database model
The relational database modelThe relational database model
The relational database model
 
Base de Datos - Modelo Entidad Relación
Base de Datos - Modelo Entidad RelaciónBase de Datos - Modelo Entidad Relación
Base de Datos - Modelo Entidad Relación
 
Diagrama de Classe: Relacionamento de Composição
Diagrama de Classe: Relacionamento de ComposiçãoDiagrama de Classe: Relacionamento de Composição
Diagrama de Classe: Relacionamento de Composição
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual Basic
 
Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)
 
Rm reports gerador de relatórios versão - mdi
Rm reports   gerador de relatórios versão - mdiRm reports   gerador de relatórios versão - mdi
Rm reports gerador de relatórios versão - mdi
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
Diagrama de Colaboración
Diagrama de ColaboraciónDiagrama de Colaboración
Diagrama de Colaboración
 
Aula 3 banco de dados
Aula 3   banco de dadosAula 3   banco de dados
Aula 3 banco de dados
 
DBMS and its Models
DBMS and its ModelsDBMS and its Models
DBMS and its Models
 
Diagrama de componentes
Diagrama de componentesDiagrama de componentes
Diagrama de componentes
 
Control de versiones (CVS)
Control de versiones (CVS)Control de versiones (CVS)
Control de versiones (CVS)
 
DBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.pptDBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.ppt
 
Estrategias de procesamiento de consultas distribuidas
Estrategias de procesamiento de consultas distribuidasEstrategias de procesamiento de consultas distribuidas
Estrategias de procesamiento de consultas distribuidas
 
Modelo de datos
Modelo de datosModelo de datos
Modelo de datos
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 

Andere mochten auch

02 rdbms session02
02 rdbms session0202 rdbms session02
02 rdbms session02
Niit Care
 
03 rdbms session03
03 rdbms session0303 rdbms session03
03 rdbms session03
Niit Care
 
Rdbms session 01_a
Rdbms session 01_aRdbms session 01_a
Rdbms session 01_a
Shivam Rai
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management system
emailharmeet
 

Andere mochten auch (10)

02 rdbms session02
02 rdbms session0202 rdbms session02
02 rdbms session02
 
03 rdbms session03
03 rdbms session0303 rdbms session03
03 rdbms session03
 
Relational database management system
Relational database management systemRelational database management system
Relational database management system
 
Rdbms session 01_a
Rdbms session 01_aRdbms session 01_a
Rdbms session 01_a
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 
Introduction to RDBMS
Introduction to RDBMSIntroduction to RDBMS
Introduction to RDBMS
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) i
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management system
 
Rdbms
RdbmsRdbms
Rdbms
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 

Ähnlich wie 01 rdbms session01

Database Management Systems Tutorial
Database Management Systems TutorialDatabase Management Systems Tutorial
Database Management Systems Tutorial
Sachin MK
 
17032658 database-management-systems-tutorial-090917034406-phpapp02
17032658 database-management-systems-tutorial-090917034406-phpapp0217032658 database-management-systems-tutorial-090917034406-phpapp02
17032658 database-management-systems-tutorial-090917034406-phpapp02
Samina Sam Sam
 
An Empirical Study on How Developers Reason about Module Cohesion
An Empirical Study on How Developers Reason about Module CohesionAn Empirical Study on How Developers Reason about Module Cohesion
An Empirical Study on How Developers Reason about Module Cohesion
Bruno C. da Silva
 
An agent based approach for building complex software systems
An agent based approach for building complex software systemsAn agent based approach for building complex software systems
An agent based approach for building complex software systems
Icaro Santos
 

Ähnlich wie 01 rdbms session01 (20)

Dbms viva questions
Dbms viva questionsDbms viva questions
Dbms viva questions
 
Technical Note on DBMS
Technical Note on DBMSTechnical Note on DBMS
Technical Note on DBMS
 
1resume
1resume1resume
1resume
 
Dbms Interview Question And Answer
Dbms Interview Question And AnswerDbms Interview Question And Answer
Dbms Interview Question And Answer
 
DBMS interview questions
DBMS interview questionsDBMS interview questions
DBMS interview questions
 
Dbms basic nots
Dbms basic notsDbms basic nots
Dbms basic nots
 
Database Management Systems Tutorial
Database Management Systems TutorialDatabase Management Systems Tutorial
Database Management Systems Tutorial
 
17032658 database-management-systems-tutorial-090917034406-phpapp02
17032658 database-management-systems-tutorial-090917034406-phpapp0217032658 database-management-systems-tutorial-090917034406-phpapp02
17032658 database-management-systems-tutorial-090917034406-phpapp02
 
Db lec 01
Db lec 01Db lec 01
Db lec 01
 
Rdbms concepts
Rdbms conceptsRdbms concepts
Rdbms concepts
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental concepts
 
DBMS Campus crack Question Prepared by Randhir Kumar
DBMS Campus crack Question Prepared by Randhir KumarDBMS Campus crack Question Prepared by Randhir Kumar
DBMS Campus crack Question Prepared by Randhir Kumar
 
An Empirical Study on How Developers Reason about Module Cohesion
An Empirical Study on How Developers Reason about Module CohesionAn Empirical Study on How Developers Reason about Module Cohesion
An Empirical Study on How Developers Reason about Module Cohesion
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Database Modeling
Database ModelingDatabase Modeling
Database Modeling
 
Dbms interview questions
Dbms interview questionsDbms interview questions
Dbms interview questions
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and Answers
 
An agent based approach for building complex software systems
An agent based approach for building complex software systemsAn agent based approach for building complex software systems
An agent based approach for building complex software systems
 
Unit 1 basic concepts of DBMS
Unit 1 basic concepts of DBMSUnit 1 basic concepts of DBMS
Unit 1 basic concepts of DBMS
 
SE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and DesignSE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and Design
 

Mehr von Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

01 rdbms session01

  • 1. Relational Database Management Systems Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases. Knowledge of these will enable the developers to build robust database solutions. This module will help students understand concepts related to relational databases. Ver. 1.0 Session 1 Slide 1 of 34
  • 2. Relational Database Management Systems Objectives • In this session, you will learn to: Define a Database Management System Describe the types of data models Create an entity-relationship model List the types of relationships between entities Define a Relational Database Management System Describe the operators that work on relations Ver. 1.0 Session 1 Slide 2 of 34
  • 3. Relational Database Management Systems Database Management Systems A database is a collection of logically related information. Database Management is the task of maintaining databases so that information is readily available. The software required to perform the task of database management is called a Database Management System (DBMS). Ver. 1.0 Session 1 Slide 3 of 34
  • 4. Relational Database Management Systems Data Models Can be classified into two categories: Object-based logical model focuses on describing the data, the relationship among the data, and any constraints defined Record-based logical model focuses on describing the data structure and the access techniques in the DBMS Ver. 1.0 Session 1 Slide 4 of 34
  • 5. Relational Database Management Systems Object-Based Logical Model There are various object-based models. The most widely used is the Entity-Relationship model (ER model) introduced by Peter Chen. Ver. 1.0 Session 1 Slide 5 of 34
  • 6. Relational Database Management Systems Entities Chen defined an entity as “a thing, which can be easily identified”. An entity is any object, place, person, or activity about which data is recorded. In the diagramming technique, entities are named and represented inside a box. An entity type is a set of things that share common properties: STUDENT, COURSE, and GRADE are examples of entity type. An entity type is usually in uppercase. Ver. 1.0 Session 1 Slide 6 of 34
  • 7. Relational Database Management Systems Entities (Contd.) Types of Entities: Dependent entity: • Is an entity whose existence depends on the existence of another entity and are also called weak entities Independent entity: Is an entity which does not depend on any other entity for existence and are also called regular entities Ver. 1.0 Session 1 Slide 7 of 34
  • 8. Relational Database Management Systems Relationships Chen defines a relationship as “an association among entities”. For example, the relationship between students and instructors represents the fact that an instructor teaches several students and a student is taught by several instructors. This relationship could be named TEACH. Relationships are depicted as a diamond with the name of the relationship type. Ver. 1.0 Session 1 Slide 8 of 34
  • 9. Relational Database Management Systems Relationships (Contd.) A relationship type is an association of entity types (STUDENT-INSTRUCTOR). A relationship can associate an entity with itself. For example, one instructor in a university may marry another instructor. Multiple relationships can also exist between the same entities. Ver. 1.0 Session 1 Slide 9 of 34
  • 10. Relational Database Management Systems Just a minute The following statement has been extracted from a case presented by a manufacturer regarding the maintenance of their data: “A supplier ships certain parts.” Identify the entities mentioned in this statement, and their relationship. Draw a diagram depicting the relationship. Ver. 1.0 Session 1 Slide 10 of 34
  • 11. Relational Database Management Systems Just a minute (Contd.) Answer: Entities: SUPPLIER, PARTS Relationship: SHIP (or SHIPMENT) SUPPLIERS SHIP PARTS Ver. 1.0 Session 1 Slide 11 of 34
  • 12. Relational Database Management Systems Types of Relationships There are three types of relationships: One-to-One One-to-Many (or Many-to-One) Many-to-Many Ver. 1.0 Session 1 Slide 12 of 34
  • 13. Relational Database Management Systems One-to-One Relationship Consider the example of a university. For one DEPARTMENT (like the department of social sciences) there can be only one department head. This is a one-to-one relationship. Ver. 1.0 Session 1 Slide 13 of 34
  • 14. Relational Database Management Systems Many-to-One Relationship A STUDENT can MAJOR in only one course, but many STUDENTs would have registered for a given MAJOR course. This is a many-to-one relationship. Ver. 1.0 Session 1 Slide 14 of 34
  • 15. Relational Database Management Systems Many-to-Many Relationship A STUDENT can take many COURSEs and many STUDENTs can register for a given COURSE. This is a many-to-many relationship. Ver. 1.0 Session 1 Slide 15 of 34
  • 16. Relational Database Management Systems Just a minute What do the following ER diagrams represent? Ver. 1.0 Session 1 Slide 16 of 34
  • 17. Relational Database Management Systems Just a minute (Contd.) Answer: Many students can work on many projects. Many employees belong to only one department. Ver. 1.0 Session 1 Slide 17 of 34
  • 18. Relational Database Management Systems Just a minute Consider the following statement of a manufacturing company: “A supplier ships certain parts. A particular part is not necessarily shipped by only one supplier. No supplier ships only a single part.” What type of relationship is this? Draw a diagram to depict the relationship. Answer: Many-to-many type m m SUPPLIER SHIP PARTS Ver. 1.0 Session 1 Slide 18 of 34
  • 19. Relational Database Management Systems Attributes Attributes are a property of a given entity. Attributes are depicted as ellipses, labeled with the name of the property. Ver. 1.0 Session 1 Slide 19 of 34
  • 20. Relational Database Management Systems Just a minute A manufacturer needs to maintain the following details about the supplier: a. Name b. Address c. Credit Status d. Assigned code number Draw a diagram to show this information. Ver. 1.0 Session 1 Slide 20 of 34
  • 21. Relational Database Management Systems Just a minute (Contd.) Answer: CODE NAME SUPPLIER ADD CR_STATU S Ver. 1.0 Session 1 Slide 21 of 34
  • 22. Relational Database Management Systems Subtypes and Supertypes Subtype: Is a subset of another entity. It is always dependent on the supertype for its existence Is connected to the supertype by an unnamed relationship Supertype: Is connected to the relationship with a line containing a crossbar Is described by attributes that belong to all subtypes. The subtype is described by the attributes that are unique to it Ver. 1.0 Session 1 Slide 22 of 34
  • 23. Relational Database Management Systems Just a minute • There are two types of suppliers. One type of supplier allows credit, while the other type insists on payment in cash before delivery. The manufacturer wishes to maintain separate information on these two types of suppliers. For the credit supplier, “credit period” and “credit limit” have to be recorded. For the cash supplier, “date of payment” has to be stored. Represent this diagrammatically. Answer: SUPPLIERS CASH CREDIT PAY_DT CR_LIMIT CR_PERIOD Ver. 1.0 Session 1 Slide 23 of 34
  • 24. Relational Database Management Systems Record-Based Logical Model The three types of record-based models are: Hierarchical model • In a hierarchical model, data is represented in the form of a tree. Network model • A network model is similar to a hierarchical model in the way that data and the relationships among them are represented in the form of records and links. Relational model In the relational model, the database is structured in fixed-format records of several types. Ver. 1.0 Session 1 Slide 24 of 34
  • 25. Relational Database Management Systems Relational Model Dr. E. F. Codd first described the relational model in 1970. Relational model is an attempt to simplify the database structure. It represents all data in the database as simple tables in the row-column format. RDBMS can be defined as a DBMS where all data visible to the user is organized strictly as tables of data values and where all database operations work on these tables. Ver. 1.0 Session 1 Slide 25 of 34
  • 26. Relational Database Management Systems Relational Data Structure The organizing principle in a relational database is the table, a tabular arrangement of data values: A table is called a relation. The row (or record) in the table is called a tuple. The column (or field) is called an attribute. The number of tuples is called the cardinality, and the number of attributes is called the degree of the table. Rows are unordered and each row must have some columns or a combination of columns that uniquely identifies each row, called the primary key of the table. A domain is a pool of values from which one or more attributes (columns) draw their actual values. Ver. 1.0 Session 1 Slide 26 of 34
  • 27. Relational Database Management Systems Representing Missing Information Missing or unknown information is represented as NULL in a relational system: NULL is not the same as space or zero. Ver. 1.0 Session 1 Slide 27 of 34
  • 28. Relational Database Management Systems Representing Relationships in an RDBMS At any given time, no two rows of the table contain the same values in a column or column combination. This column (or columns) is called the primary key of the table. A column in one table whose value matches the primary key in some other table is called a foreign key Together, a primary key and a foreign key create a parent-child relationship between the tables that connects them Ver. 1.0 Session 1 Slide 28 of 34
  • 29. Relational Database Management Systems Relational Operators The relational model is based on the principle of relational algebra: It is a collection of operators operating on relations. Each operator takes one or two relations as its input and produces a new relation as its output. Relational Operators are of the following types: – RESTRICT: Extracts specified tuples or rows from a given relation, based on a condition. – PROJECT: Extracts specified attributes or columns from a given relation. – PRODUCT: Builds a relation from two specified relations. It consists of all possible combinations of tuples, one from each of the two relations. Ver. 1.0 Session 1 Slide 29 of 34
  • 30. Relational Database Management Systems Relational Operators (Contd.) – UNION: Builds a relation from tuples appearing in either or both of the specified relations. To be union compatible, the two tables should have the same types of attributes. – INTERSECT: Builds a relation consisting of tuples that appear in both relations. – DIFFERENCE: Builds a relation of tuples appearing in the first but not the second of two specified relations. – JOIN: Builds a relation from two specified relations which consists of all possible combinations of tuples, one from each relation, that satisfy the specified condition. – DIVIDE: The Divide operator takes two relations and builds another relation consisting of values of an attribute of one relation that match all the values in the other relation. Ver. 1.0 Session 1 Slide 30 of 34
  • 31. Relational Database Management Systems Applications of an RDBMS Some typical applications of an RDBMS are: Airline and railway reservations Banking applications Manufacturing industry Order processing Hospital management systems Library management systems Hotel industry Ver. 1.0 Session 1 Slide 31 of 34
  • 32. Relational Database Management Systems Applications of an RDBMS (Contd.) Several RDBMS products are available today. Some popular products are: Sybase Oracle Microsoft SQL Server Ingress DB2 Ver. 1.0 Session 1 Slide 32 of 34
  • 33. Relational Database Management Systems Summary In this session, you learned that: Data models can be classified as: • Object-based models • Record-based models In the entity-relationship diagramming technique: • Entities are represented as rectangles. • Relationships are represented as diamonds. • Attributes are represented as ellipses. – Relationships, whether many-to-many, one-to-many, or one-to-one, are represented symbolically. – Weak entities are represented in double-lined boxes. – Subtypes are connected to the supertype by an unnamed relationship, marked with a crossbar on top. Ver. 1.0 Session 1 Slide 33 of 34
  • 34. Relational Database Management Systems Summary (Contd.) In the relational model, data is represented in tables (relations) of rows (tuples) and columns (attributes). The number of tuples is called the cardinality of the relation, and the number of attributes is called the degree of the relation. An attribute (or set of attributes) that is unique in every tuple is called the primary key. Unknown or missing information is represented by a NULL in a table. The foreign key is a column in one table that matches the primary key of another table. The relational model is based on the principle of relational algebra. The eight operators that operate on relations are restrict, project, product, union, intersect, difference, join, and divide. Ver. 1.0 Session 1 Slide 34 of 34

Hinweis der Redaktion

  1. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  2. Students have learnt the structure of different types of dimensions and the importance of surrogate keys in Module I. In this session, students will learn to load the data into the dimension tables after the data has been transformed in the transformation phase. In addition, students will also learn to update data into these dimension tables. Students already know about different types of dimension tables. Therefore, you can start the session by recapitulating the concepts. Initiate the class by asking the following questions: 1. What are the different types of dimensions? 2. Define flat dimension. 3. What are conformed dimension? 4. Define large dimension. 5. Define small dimension. 6. What is the importance of surrogate key in a dimension table? Students will learn the loading and update strategies theoretically in this session. The demonstration to load and update the data in the dimension table will be covered in next session.
  3. Students know the importance of surrogate keys. In this session students will learn the strategy to generate the surrogate key. Give an example to explain the strategy to generate the surrogate keys by concatenating the primary key of the source table with the date stamp. For example, data from a Product table has to be loaded into the Product_Dim dimension table on Feb 09, 2006. The product_code is the primary key column in the Product table. To insert the surrogate key values before loading the data into the dimension table, you can combine the primary key value with the date on which the data has to be loaded. In this case the surrogate key value can be product_code+09022006.
  4. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  5. Explain the strategy to load the data into conformed dimension with help of an example to load the data in the date dimension given in SG. Explain the strategy to load the data into the Snowflaked dimension with the help of an example given in SG.
  6. Explain the strategy to load the data into conformed dimension with help of an example to load the data in the date dimension given in SG. Explain the strategy to load the data into the Snowflaked dimension with the help of an example given in SG.
  7. Explain the strategy to load the data into conformed dimension with help of an example to load the data in the date dimension given in SG. Explain the strategy to load the data into the Snowflaked dimension with the help of an example given in SG.
  8. Explain the strategy to load the data into conformed dimension with help of an example to load the data in the date dimension given in SG. Explain the strategy to load the data into the Snowflaked dimension with the help of an example given in SG.
  9. Explain the strategy to load the data into conformed dimension with help of an example to load the data in the date dimension given in SG. Explain the strategy to load the data into the Snowflaked dimension with the help of an example given in SG.
  10. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  11. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  12. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  13. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  14. Student already have learnt about type 3 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 3 SCDs? Given an example to explain type 3 SCDs. This will recapitulate what they have learnt about type 3 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 3 SCD and then tell the strategy to update the data into this dimension table. You can now ask the student to explain the difference between the update strategy for all the three SCDs. You can also ask students to think of a scenario where you have a type 3 SCD and then ask them how to update the data in such dimension tabels. Also tell student that they will learn to load data into these dimension table using SSIS.
  15. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  16. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  17. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  18. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  19. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  20. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  21. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  22. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  23. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  24. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.
  25. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.