SlideShare a Scribd company logo
Business Information Systems Physical Data Modeling
Mapping Logical to Physical Model the entity names have been changed to table names, changed attribute names to column names, assigned nulls and not nulls, and datatype to each column.  Comment  Definition  Foreign Key  Relationship  Check Rule, Default Value Rule Non Unique Index Inversion Key  Unique Key or Unique Constraint Alternate Key Primary Key Constraint Primary Key  Column Attribute  Table Entity Represents the physical implementation of the model in a database.  Represents business information and defines business rules  Physical Data Model  Logical Data Model
The Physical Data Model Includes all required  tables, columns, relationships, database properties  for the physical implementation of databases.  Database performance, indexing strategy, physical storage and denormalization are important parameters of a physical model.  Logical data model is approved by functional team and there-after development of physical data model work gets started.  The transformations from logical model to physical model include imposing database rules, implementation of referential integrity, super types and sub types etc.
DBMS A database is a collection of organized and structured data, stored in the computer as files. Various data types like numeric, textual, image, multimedia etc., can be managed and maintained more efficiently in a database. Often used databases (RDBMS) in most of the practical applications are Oracle, Sql Server, Informix, Terradata, DB2 etc.,  Some Oracle Objects Instance Schema Table Column Datatype Primary Key Constraint Unique Constraint Check Constraint Null / Not Null Index Sequence View Materialized View Synonym Procedure Function Package Trigger
Overview of objects A database instance can have many schemas;  A schema  contains multiple database objects like tables, views Tables A set of related data, arranged in the form of rows and columns.  Columns Also known as Field that provides the structure for organizing the rows and contains the related information.  Datatype : This is set of property associated with a column, which helps to store and identify the type of data and its length.
Constructs for “constraints” Null / Not Null A value that indicates that the column contains should or should not have a valid data Primary Key Constraint This is a constraint imposed on the column so that all values in the column should be different from each other. This constraint can be imposed on one column or group of columns. he primary key will be always used as a parent key when adding a referential constraint by connecting it to a child table.  Unique Constraint: Unique + Null Values Primary Key Constraint: Unique + Not Null Values  Foreign Key Constraint This is a constraint imposed on the child table. Whatever values are present in the child table, their corresponding values should be present in the parent table. This constraint can be imposed on one column or group of columns and NULL values are allowed in the child table.  Check Constraint This is a constraint that is imposed to validate the data within some value or range of values. This constraint can be imposed on one column or group of columns.
Constructs for “better” access Index Index is a database object that enables faster retrieval of data. Unique Index, Bitmap Index etc., are the different types of Index.  Views This is a PSEUDO table that is not stored in the database and it is just a query.  Materialized Views are similar to a view but these are permanently stored in the database and often refreshed. This is used in optimization for the faster data retrieval and is useful in aggregation and summarization of data.
Constructs for ‘automatic’ processing Procedure This is a program that contains set of code, which will carry out a specific action when called by other programs.  Functions This is a program that contains set of code, which will do a specific action when called by other programs. It will return a single VALUE  Trigger This is a program that contains set of code for doing some useful action when a record is inserted or deleted or updated in a table.
Raw Data on Employees For the sample data provided in the table, as a Data Modeler you have to design logical data model, physical data model and generate DDL scripts. In order to do the above tasks, you need to create the following:  Create 2 tables  DEPARTMENT, EMPLOYEE. Assign correct datatypes to the columns. Create constraints like primary key, unique key, null, not null, check to the columns. Assign correct PHYSICAL names for tables and columns. Select  DEPARTMENT as parent table and EMPLOYEE as the child table and connect them.
Employee Table
DEPARTMENT Table  Since ‘dept’ will be repeated for several records in EMPLOYEE table, you have to design this lookup for saving disk space. Sometimes the detail table may not show all information For example nuances of department name Department could have additional information, viz location, manager You have to create a column Dept Code, which is not present in sample data and this column should be assigned Primary Key to validate the detailed data in EMPLOYEE table.
DDL : Creating Tables Create the Department Lookup Table CREATE TABLE DEPARTMENT ( DEPT_ID NUMBER(2) NOT NULL,  DEPT_NAME VARCHAR(50) NOT NULL, LOCATION  VARCHAR(10), MANAGER NUMBER(6), CONSTRAINT DEPARTMENT_PK PRIMARY KEY (DEPT_ID ), );  An Oracle database consists of DDL commands, which are useful to create, modify and drop the database objects. In this section, we will try to explain about important database CREATE commands that are used by a data modeller by relating it with our example data.
The Main Table Create the final employee detail table CREATE TABLE EMPLOYEE ( EMP_ID NUMBER NOT NULL, FIRSTNAME VARCHAR(30) NOT NULL, LASTNAME VARCHAR(30) NOT NULL, JOBDESC VARCHAR(10), JOINDATE DATE,  EMP_SAL NUMBER(7,2) NOT NULL, COMM NUMBER (3,2), DEPT_CD NUMBER(2) CONSTRAINT EMPLOYEE_PK PRIMARY KEY (EMP_ID ), CONSTRAINT EMPLOYEE_FK01 FOREIGN KEY (DEPT_CD ) REFERENCES DEPARTMENT );
More Automation Defining a sequence CREATE SEQUENCE SEQ_EMPLOYEE_DTL INCREMENT BY 1 START WITH 1 NOMAXVALUE NOMINVALUE NOCACHE NOCYCLE NOORDER ;  Defining a trigger CREATE OR REPLACE TRIGGER TRG_SEQ_EMPLOYEE_DTL BEFORE INSERT ON EMPLOYEE FOR EACH ROW BEGIN SELECT SEQ_EMPLOYEE.NEXTVAL INTO :NEW.EMP_ID FROM DUAL; END;  Installing a trigger Whenever a record is inserted into "EMPLOYEE_DTL" table, this trigger selects the next unique number from the sequence "SEQ_EMPLOYEE_DTL" and inserts into the column "EMP_ID".  In our INSERT STATEMENTS example, we have not provided values for the column "EMP_ID" and inserting values into "EMP_DTL_ID is taken care by sequence and trigger.
Altering Tables Add Columns ALTER TABLE EMPLOYEE ADD PASSPORT_NUM NUMBER(6);  Rename Columns ALTER TABLE EMPLOYEE RENAME column PASSPORT_NUM TO EMP_EXTID;  Modify Column ALTER TABLE EMPLOYEE MODIFY EMP_EXTID VARCHAR2(10);  Drop Column ALTER TABLE EMPLOYEE DROP COLUMN EMP_EXTID;
Implementing Constraints Add Constraints ALTER TABLE EMPLOYEE ADD CONSTRAINT CH_SAL CHECK(EMP_SAL BETWEEN 4000 AND 7000);  Unique Constraints ALTER TABLE EMPLOYEE ADD CONSTRAINT UN_ID UNIQUE(EMP_EXTID);  ALTER TABLE EMPLOYEE DISABLE CONSTRAINT UN_ID; ALTER TABLE EMPLOYEE ENABLE CONSTRAINT UN_ID; ALTER TABLE EMPLOYEE DROP CONSTRAINT UN_ID;  Additional indexes CREATE INDEX IND_UNID ON EMPLOYEE(UN_ID);
Structured Query Language  A high language to manipulate the database Data Description Language Data Manipulation Language Data Control Language SQL

More Related Content

ODP
Oracle SQL Advanced
PPTX
Referential integrity
PPT
Advanced Sql Training
ODP
SQL Tunning
PPT
Ch 9 S Q L
PDF
Chapter8 my sql revision tour
DOC
Module 3
PDF
Assignment#07
Oracle SQL Advanced
Referential integrity
Advanced Sql Training
SQL Tunning
Ch 9 S Q L
Chapter8 my sql revision tour
Module 3
Assignment#07

What's hot (20)

PDF
Ch05
PDF
Ch04
PDF
Oracle SQL Basics
PPTX
Oraclesql
PDF
Mysql cheatsheet
PDF
View & index in SQL
PPTX
Relational Database Management System
PPTX
Sql.pptx
PDF
Assignment#02
PPTX
advanced sql(database)
DOCX
Dbms important questions and answers
PPTX
STRUCTURE OF SQL QUERIES
PPTX
WEKA: Data Mining Input Concepts Instances And Attributes
PDF
Assignment#04
PPT
Myth busters - performance tuning 101 2007
PPTX
Lab1 select statement
PPT
SQL- Introduction to PL/SQL
PDF
Assignment#05
PPTX
Dbms relational data model and sql queries
Ch05
Ch04
Oracle SQL Basics
Oraclesql
Mysql cheatsheet
View & index in SQL
Relational Database Management System
Sql.pptx
Assignment#02
advanced sql(database)
Dbms important questions and answers
STRUCTURE OF SQL QUERIES
WEKA: Data Mining Input Concepts Instances And Attributes
Assignment#04
Myth busters - performance tuning 101 2007
Lab1 select statement
SQL- Introduction to PL/SQL
Assignment#05
Dbms relational data model and sql queries
Ad

Viewers also liked (19)

PPTX
Data Modeling PPT
PPTX
Karen Lopez 10 Physical Data Modeling Blunders
PDF
Scalable
PPTX
Aurora Project
PPTX
Data Modeling Basics
PDF
246 deview 2013 신기빈
PDF
[2 d1] elasticsearch 성능 최적화
PDF
XML, NoSQL, 빅데이터, 클라우드로 옮겨가는 시장 상황 속, 데이터모델링 여전히 중요한가
PDF
SSD 개념 및 활용_Wh oracle
PDF
데이터베이스 모델링
PPT
Data Modeling Presentations I
PDF
Db 진단 및 튜닝 보고 (example)
PDF
Ssd 성능시험 cubrid mysql
PDF
컴퓨터 네트워크와 인터넷
PPSX
09. Memory, Storage (RAM, Cache, HDD, ODD, SSD, Flashdrives)
PPS
Data models
PDF
[오픈소스컨설팅]Day #3 MySQL Monitoring, Trouble Shooting
PPT
Different data models
PDF
SSD Deployment Strategies for MySQL
Data Modeling PPT
Karen Lopez 10 Physical Data Modeling Blunders
Scalable
Aurora Project
Data Modeling Basics
246 deview 2013 신기빈
[2 d1] elasticsearch 성능 최적화
XML, NoSQL, 빅데이터, 클라우드로 옮겨가는 시장 상황 속, 데이터모델링 여전히 중요한가
SSD 개념 및 활용_Wh oracle
데이터베이스 모델링
Data Modeling Presentations I
Db 진단 및 튜닝 보고 (example)
Ssd 성능시험 cubrid mysql
컴퓨터 네트워크와 인터넷
09. Memory, Storage (RAM, Cache, HDD, ODD, SSD, Flashdrives)
Data models
[오픈소스컨설팅]Day #3 MySQL Monitoring, Trouble Shooting
Different data models
SSD Deployment Strategies for MySQL
Ad

Similar to BIS06 Physical Database Models (20)

PPT
Les09 (using ddl statements to create and manage tables)
PPT
Preparing for BIT – IT2301 Database Management Systems 2001d
PPT
Using ddl statements to create and manage tables
PPT
PPTX
Database Basics
PPTX
PPTX
SQL _UNIT_DBMS_PRESENTSTATION_SQL _UNIT_DBMS_PRESENTSTATION
PPTX
Dbms & oracle
PPT
CSE311_IAH_Slide07_SQL Advanced Quries.ppt
PDF
SQL-8 Table Creation.pdf
PPTX
Physical Design and Development
PDF
Relational database- Fundamentals
PPTX
Structured Query Language (SQL) _ Edu4Sure Training.pptx
PPT
plsql Les09
PPT
Dbms oracle
PPTX
DDL(Data defination Language ) Using Oracle
PPT
D B M S Animate
PPT
Structure query language - Data definition language.ppt
Les09 (using ddl statements to create and manage tables)
Preparing for BIT – IT2301 Database Management Systems 2001d
Using ddl statements to create and manage tables
Database Basics
SQL _UNIT_DBMS_PRESENTSTATION_SQL _UNIT_DBMS_PRESENTSTATION
Dbms & oracle
CSE311_IAH_Slide07_SQL Advanced Quries.ppt
SQL-8 Table Creation.pdf
Physical Design and Development
Relational database- Fundamentals
Structured Query Language (SQL) _ Edu4Sure Training.pptx
plsql Les09
Dbms oracle
DDL(Data defination Language ) Using Oracle
D B M S Animate
Structure query language - Data definition language.ppt

More from Prithwis Mukerjee (20)

PPTX
Bitcoin, Blockchain and the Crypto Contracts - Part 2
PDF
Bitcoin, Blockchain and Crypto Contracts - Part 3
PDF
Internet of Things
PDF
Thought controlled devices
PDF
Cloudcasting
PDF
Currency, Commodity and Bitcoins
PDF
Data Science
PPT
05 OLAP v6 weekend
ODP
04 Dimensional Analysis - v6
PDF
Thought control
PPT
World of data @ praxis 2013 v2
ODP
BIS 08a - Application Development - II Version 2
PPT
Lecture02 - Data Mining & Analytics
ODP
ইন্টার্নেট কি এবং কেন ?
PPT
Data mining clustering-2009-v0
PPT
Data mining classification-2009-v0
PPT
Data mining arm-2009-v0
PPT
Data mining intro-2009-v2
PPT
PPT
Business Intelligence Industry Perspective Session I
Bitcoin, Blockchain and the Crypto Contracts - Part 2
Bitcoin, Blockchain and Crypto Contracts - Part 3
Internet of Things
Thought controlled devices
Cloudcasting
Currency, Commodity and Bitcoins
Data Science
05 OLAP v6 weekend
04 Dimensional Analysis - v6
Thought control
World of data @ praxis 2013 v2
BIS 08a - Application Development - II Version 2
Lecture02 - Data Mining & Analytics
ইন্টার্নেট কি এবং কেন ?
Data mining clustering-2009-v0
Data mining classification-2009-v0
Data mining arm-2009-v0
Data mining intro-2009-v2
Business Intelligence Industry Perspective Session I

Recently uploaded (20)

PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Computing-Curriculum for Schools in Ghana
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Complications of Minimal Access Surgery at WLH
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Pre independence Education in Inndia.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Computing-Curriculum for Schools in Ghana
Abdominal Access Techniques with Prof. Dr. R K Mishra
STATICS OF THE RIGID BODIES Hibbelers.pdf
VCE English Exam - Section C Student Revision Booklet
Module 4: Burden of Disease Tutorial Slides S2 2025
Sports Quiz easy sports quiz sports quiz
Complications of Minimal Access Surgery at WLH
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Pre independence Education in Inndia.pdf
TR - Agricultural Crops Production NC III.pdf
Microbial diseases, their pathogenesis and prophylaxis
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Anesthesia in Laparoscopic Surgery in India
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf

BIS06 Physical Database Models

  • 1. Business Information Systems Physical Data Modeling
  • 2. Mapping Logical to Physical Model the entity names have been changed to table names, changed attribute names to column names, assigned nulls and not nulls, and datatype to each column. Comment Definition Foreign Key Relationship Check Rule, Default Value Rule Non Unique Index Inversion Key Unique Key or Unique Constraint Alternate Key Primary Key Constraint Primary Key Column Attribute Table Entity Represents the physical implementation of the model in a database. Represents business information and defines business rules Physical Data Model Logical Data Model
  • 3. The Physical Data Model Includes all required tables, columns, relationships, database properties for the physical implementation of databases. Database performance, indexing strategy, physical storage and denormalization are important parameters of a physical model. Logical data model is approved by functional team and there-after development of physical data model work gets started. The transformations from logical model to physical model include imposing database rules, implementation of referential integrity, super types and sub types etc.
  • 4. DBMS A database is a collection of organized and structured data, stored in the computer as files. Various data types like numeric, textual, image, multimedia etc., can be managed and maintained more efficiently in a database. Often used databases (RDBMS) in most of the practical applications are Oracle, Sql Server, Informix, Terradata, DB2 etc., Some Oracle Objects Instance Schema Table Column Datatype Primary Key Constraint Unique Constraint Check Constraint Null / Not Null Index Sequence View Materialized View Synonym Procedure Function Package Trigger
  • 5. Overview of objects A database instance can have many schemas; A schema contains multiple database objects like tables, views Tables A set of related data, arranged in the form of rows and columns. Columns Also known as Field that provides the structure for organizing the rows and contains the related information. Datatype : This is set of property associated with a column, which helps to store and identify the type of data and its length.
  • 6. Constructs for “constraints” Null / Not Null A value that indicates that the column contains should or should not have a valid data Primary Key Constraint This is a constraint imposed on the column so that all values in the column should be different from each other. This constraint can be imposed on one column or group of columns. he primary key will be always used as a parent key when adding a referential constraint by connecting it to a child table. Unique Constraint: Unique + Null Values Primary Key Constraint: Unique + Not Null Values Foreign Key Constraint This is a constraint imposed on the child table. Whatever values are present in the child table, their corresponding values should be present in the parent table. This constraint can be imposed on one column or group of columns and NULL values are allowed in the child table. Check Constraint This is a constraint that is imposed to validate the data within some value or range of values. This constraint can be imposed on one column or group of columns.
  • 7. Constructs for “better” access Index Index is a database object that enables faster retrieval of data. Unique Index, Bitmap Index etc., are the different types of Index. Views This is a PSEUDO table that is not stored in the database and it is just a query. Materialized Views are similar to a view but these are permanently stored in the database and often refreshed. This is used in optimization for the faster data retrieval and is useful in aggregation and summarization of data.
  • 8. Constructs for ‘automatic’ processing Procedure This is a program that contains set of code, which will carry out a specific action when called by other programs. Functions This is a program that contains set of code, which will do a specific action when called by other programs. It will return a single VALUE Trigger This is a program that contains set of code for doing some useful action when a record is inserted or deleted or updated in a table.
  • 9. Raw Data on Employees For the sample data provided in the table, as a Data Modeler you have to design logical data model, physical data model and generate DDL scripts. In order to do the above tasks, you need to create the following: Create 2 tables DEPARTMENT, EMPLOYEE. Assign correct datatypes to the columns. Create constraints like primary key, unique key, null, not null, check to the columns. Assign correct PHYSICAL names for tables and columns. Select DEPARTMENT as parent table and EMPLOYEE as the child table and connect them.
  • 11. DEPARTMENT Table Since ‘dept’ will be repeated for several records in EMPLOYEE table, you have to design this lookup for saving disk space. Sometimes the detail table may not show all information For example nuances of department name Department could have additional information, viz location, manager You have to create a column Dept Code, which is not present in sample data and this column should be assigned Primary Key to validate the detailed data in EMPLOYEE table.
  • 12. DDL : Creating Tables Create the Department Lookup Table CREATE TABLE DEPARTMENT ( DEPT_ID NUMBER(2) NOT NULL, DEPT_NAME VARCHAR(50) NOT NULL, LOCATION VARCHAR(10), MANAGER NUMBER(6), CONSTRAINT DEPARTMENT_PK PRIMARY KEY (DEPT_ID ), ); An Oracle database consists of DDL commands, which are useful to create, modify and drop the database objects. In this section, we will try to explain about important database CREATE commands that are used by a data modeller by relating it with our example data.
  • 13. The Main Table Create the final employee detail table CREATE TABLE EMPLOYEE ( EMP_ID NUMBER NOT NULL, FIRSTNAME VARCHAR(30) NOT NULL, LASTNAME VARCHAR(30) NOT NULL, JOBDESC VARCHAR(10), JOINDATE DATE, EMP_SAL NUMBER(7,2) NOT NULL, COMM NUMBER (3,2), DEPT_CD NUMBER(2) CONSTRAINT EMPLOYEE_PK PRIMARY KEY (EMP_ID ), CONSTRAINT EMPLOYEE_FK01 FOREIGN KEY (DEPT_CD ) REFERENCES DEPARTMENT );
  • 14. More Automation Defining a sequence CREATE SEQUENCE SEQ_EMPLOYEE_DTL INCREMENT BY 1 START WITH 1 NOMAXVALUE NOMINVALUE NOCACHE NOCYCLE NOORDER ; Defining a trigger CREATE OR REPLACE TRIGGER TRG_SEQ_EMPLOYEE_DTL BEFORE INSERT ON EMPLOYEE FOR EACH ROW BEGIN SELECT SEQ_EMPLOYEE.NEXTVAL INTO :NEW.EMP_ID FROM DUAL; END; Installing a trigger Whenever a record is inserted into "EMPLOYEE_DTL" table, this trigger selects the next unique number from the sequence "SEQ_EMPLOYEE_DTL" and inserts into the column "EMP_ID". In our INSERT STATEMENTS example, we have not provided values for the column "EMP_ID" and inserting values into "EMP_DTL_ID is taken care by sequence and trigger.
  • 15. Altering Tables Add Columns ALTER TABLE EMPLOYEE ADD PASSPORT_NUM NUMBER(6); Rename Columns ALTER TABLE EMPLOYEE RENAME column PASSPORT_NUM TO EMP_EXTID; Modify Column ALTER TABLE EMPLOYEE MODIFY EMP_EXTID VARCHAR2(10); Drop Column ALTER TABLE EMPLOYEE DROP COLUMN EMP_EXTID;
  • 16. Implementing Constraints Add Constraints ALTER TABLE EMPLOYEE ADD CONSTRAINT CH_SAL CHECK(EMP_SAL BETWEEN 4000 AND 7000); Unique Constraints ALTER TABLE EMPLOYEE ADD CONSTRAINT UN_ID UNIQUE(EMP_EXTID); ALTER TABLE EMPLOYEE DISABLE CONSTRAINT UN_ID; ALTER TABLE EMPLOYEE ENABLE CONSTRAINT UN_ID; ALTER TABLE EMPLOYEE DROP CONSTRAINT UN_ID; Additional indexes CREATE INDEX IND_UNID ON EMPLOYEE(UN_ID);
  • 17. Structured Query Language A high language to manipulate the database Data Description Language Data Manipulation Language Data Control Language SQL