Advanced Data Modeling Training with SAP PowerDesigner

Logical Data Modeling Training with SAP PowerDesigner 16.5:

 

  • How to normalize the logical data model?
  • Clinic, Students, Order Form Model Examples
  • How to group entities?
  • How to add data item, entity attributes to entities?
  • How to add identifier? (Key group in Erwin)
  • How to add inheritance link? (subtype relationship in Erwin)
  • How to add inheritance? (subtype category in Erwin)
  • How to create relationships?
  • What is cardinality? How to connect different entities with relationship lines?
  • How to add diagram?  (stored display and subject area in Erwin)
  • How to add annotations? (notes in Erwin)
  • How to add text block (text symbol in Erwin)
  • How to add text symbol? (text block in Erwin)
  • How to compare different versions of a Logical Data Model?
  • Banking, Mortgage, Staffing, Insurance, and Training Data Models

Physical Data Modeling Training with SAP PowerDesigner 16.5:

 

  • Understanding the technical requirements/specifications from Database Administrator.
  • How to add those requirements/specifications in a physical data model?
  • How to add check constraints?
  • How to add Reference (Relationship in Erwin)?
  • How to convert logical data model to physical data model?
  • How to implement the physical data model in different database (forward engineering?
  • What is reverse engineering?
  • How to compare the different versions of a physical data model?
  • How to compare the physical data model and a Current DBMS (Current DBMS)?
  • Banking, Mortgage, Staffing, Insurance, and Training Data Model Examples
  • Comparison between Erwin and PowerDesigner

Dimensional Data Modeling training with SAP PowerDesigner 16.5?

 

  • Why do you need a data warehouse in SAP PowerDesigner Data Modeling?
  • What is the reason for a data mart?
  • Why is star schema? How is that different from dimensional data modeling?
  • Why customers prefer dimensional data modeling or snow flake modeling?
  • What are slowly changing dimensions?
  • Point of Sales Data Model, Banking, Mortgage, and Clinic Examples

If you need more information on this SAP PowerDesigner Data Modeling Training, please contact: Training@LearnDataModeling.com or 91-9080157239.

Data Modeling Demo Videos

01. Data Modeling Development Life Cycle

 

02. Data Warehouse Training – Table and PK

 

03. Simple Select Statement and Alter Statements

 

04. Data Warehouse Training ETL Tools

 

05. Demo Data Modeling and Data Warehouse Training Normalization

 

06 Demo Data Modeling and Data Warehouse Training – Cardinality and Optionality

 

 

Oracle Database DDL Statements – DROP Object Commands

Oracle Database Data Definition Language (DDL Statements) – DROP Object Commands:

In this section, we will try to explain about important database DROP commands that are used by a data modeler by relating it with our example data.

Drop Index:

DROP INDEX IND_SSN; 

Drop Synonym:

DROP SYNONYM SYN_EMPLOYEE_DTL; 

Drop View:

DROP VIEW VIEW_EMPLOYEE_DTL; 

Drop Sequence:

DROP SEQUENCE SEQ_EMPLOYEE_DTL; 

Drop Trigger:

DROP TRIGGER TRG_SEQ_EMPLOYEE_DTL; 

Drop Table:

DROP TABLE EMPLOYEE_DTL; 

Drop Table with Cascading Option:

In our example tables, try to drop tables GENDER_LKP, and DEPARTMENT_LKP after the data is loaded into GENDER_LKP, DEPARTMENT_LKP, and EMPLOYEE_DTL. You will get an error message.

If you want to drop parent tables that are connected with child tables, then you can use the following command.

DROP TABLE GENDER_LKP CASCADE CONSTRAINTS;

DROP TABLE DEPARTMENT_LKP CASCADE CONSTRAINTS; 

 

Oracle Database DML Commands

Oracle Database Data Manipulation Language (DML) Commands:

In this section, we will try to explain about important database DML commands that are used by a data modeler.

Insert statements:

  • Insert Values into GENDER_LKP:

Insert statements are used to insert data into the table. In our example, we have used SYSDATE, an Oracle’s function, which is used to insert the date and time into the column “DTTM_STMP”.

INSERT INTO GENDER_LKP VALUES ( ‘M’, ‘MALE’, SYSDATE);

INSERT INTO GENDER_LKP VALUES (‘F’, ‘FEMALE’, SYSDATE); 

  • Insert Values into DEPARTMENT_LKP:
INSERT INTO DEPARTMENT_LKP VALUES (10, ‘IT’, SYSDATE);

INSERT INTO DEPARTMENT_LKP VALUES (20, ‘HR’, SYSDATE); 

  • Insert Values into EMPLOYEE_DTL:
INSERT INTO EMPLOYEE_DTL(GNDR_CD, DPTMT_NUM, FRST_NM, LST_NM, MDLE_NM, BRTH_DT, SSN, SLRY_AMT, DTTM_STMP) VALUES (‘M’, 10,’Kevin’,’A’,’Schulte’, TO_DATE(’13-OCT-1969′,’DD-MON-YYYY’),’123-45-67′, 5000,SYSDATE);

 

INSERT INTO EMPLOYEE_DTL(GNDR_CD, DPTMT_NUM, FRST_NM, LST_NM, MDLE_NM, BRTH_DT, SSN, SLRY_AMT, DTTM_STMP) VALUES (‘F’, NULL,’Valencia’,’D’,’Schipper’, TO_DATE(’20-APR-1973′,’DD-MON-YYYY’),’765-43-21′, 5000,SYSDATE);

 

INSERT INTO EMPLOYEE_DTL(GNDR_CD, DPTMT_NUM, FRST_NM, LST_NM, MDLE_NM, BRTH_DT, SSN, SLRY_AMT, DTTM_STMP) VALUES (‘M’, 10,’Chris’,’A’,’HERIER’, TO_DATE(’10-JUN-1963′,’DD-MON-YYYY’),’795-82-63′, 6000,SYSDATE); 

  • Insert Values into EMPLOYEE_DTL_COPY:

This statement will copy all records from table “EMPLOYEE_DTL” to “EMPLOYEE_DTL_COPY”.

INSERT INTO EMPLOYEE_DTL_COPY SELECT * FROM EMPLOYEE_DTL; 

Update Statements:

Update statements are used to update records with/without conditions. The following example uses a condition in where clause. Update statements can be committed to the database by using explicit “commit” command or it can be rolled back by using “rollback” command.

UPDATE EMPLOYEE_DTL SET DPTMT_NUM=20 WHERE EMP_DTL_ID=2; 

Delete Statements:

Delete statements are used to delete records with/without conditions. The following example uses some condition in where clause. Delete statements can be committed to the database by using explicit “commit” command or it can be rolled back by using “rollback” command.

DELETE FROM EMPLOYEE_DTL WHERE EMP_DTL_ID=2; 

Select all rows:

Select statements are used to retrieve records from the database with/without conditions. Select statements are the most powerful commands, which you have to learn since you can avoid unnecessary “PLSQL” in many cases.

SELECT * FROM EMPLOYEE_DTL; 

Select rows by using a WHERE clause:

SELECT * FROM EMPLOYEE_DTL WHERE EMP_DTL_ID=1; 

Select few columns:

SELECT EMP_DTL_ID, FRST_NM, SLRY_AMT FROM EMPLOYEE_DTL WHERE

SSN=’123-45-67′; 

Select records by Sorting (ASC = ascending and DESC = descending):

SELECT * FROM EMPLOYEE_DTL ORDER BY EMP_DTL_ID ASC;

SELECT * FROM EMPLOYEE_DTL ORDER BY EMP_DTL_ID DESC; 

Select records by Grouping and Having clause:

SELECT DPTMT_NUM, COUNT(DPTMT_NUM) FROM EMPLOYEE_DTL GROUP BY DPTMT_NUM;

 

SELECT DPTMT_NUM, COUNT(DPTMT_NUM) FROM EMPLOYEE_DTL GROUP BY DPTMT_NUM HAVING COUNT(DPTMT_NUM) > 1;

 

SELECT DPTMT_NUM, COUNT(DPTMT_NUM) FROM EMPLOYEE_DTL GROUP BY DPTMT_NUM HAVING COUNT(DPTMT_NUM) < 2; 

Select records by using a Sub Query:

SELECT * from EMPLOYEE_DTL WHERE DPTMT_NUM IN(SELECT DPTMT_NUM FROM DEPARTMENT_LKP WHERE DPTMT_DESC=’IT’); 

Select Distinct records:

SELECT DISTINCT(DPTMT_NUM) FROM EMPLOYEE_DTL; 

Select Count of records:

SELECT COUNT(*) FROM EMPLOYEE_DTL; 

 

Oracle Database DDL Statements – ALTER Commands

Oracle Database Data Definition Language (DDL Statements) – ALTER Commands:

In this section, we will try to explain about important database ALTER commands that are used by a data modeler by relating it with our example data.

ALTER TABLE – Add Column:

 ALTER TABLE EMPLOYEE_DTL ADD JOIN_DATE DATE; 

ALTER TABLE – Rename Column:

 ALTER TABLE EMPLOYEE_DTL RENAME column JOIN_DATE TO EMP_JOIN_DT; 

ALTER TABLE – Modify column’s Data Type:

 ALTER TABLE EMPLOYEE_DTL MODIFY EMP_JOIN_DT VARCHAR2(10); 

ALTER TABLE – Drop Column:

 ALTER TABLE EMPLOYEE_DTL DROP COLUMN EMP_JOIN_DT; 

ALTER TABLE – Add Check Constraint:

ALTER TABLE EMPLOYEE_DTL ADD CONSTRAINT CH_SAL CHECK(SLRY_AMT BETWEEN 4000 AND 7000); 

ALTER TABLE – Add Unique Constraint:

ALTER TABLE EMPLOYEE_DTL ADD CONSTRAINT UN_SSN UNIQUE(SSN); 

ALTER TABLE – Disable/Enable/Drop Constraint:

ALTER TABLE EMPLOYEE_DTL DISABLE CONSTRAINT UN_SSN; 

ALTER TABLE EMPLOYEE_DTL ENABLE CONSTRAINT UN_SSN;

ALTER TABLE EMPLOYEE_DTL DROP CONSTRAINT UN_SSN; 

ALTER TABLE – Modify Constraint:

 ALTER TABLE EMPLOYEE_DTL MODIFY SLRY_AMT NUMBER(7,2) NULL;

 ALTER TABLE EMPLOYEE_DTL MODIFY SLRY_AMT NUMBER(7,2) NOT NULL; 

Challenging Situations in Data Modeling

Challenges & Solutions in Data Modeling:

Anyone can Learn Data Modeling Concepts by reading some books or going through online or by getting some help from experts in the field. But practically, while working with a particular Data Model, there may arise many challenging situations where one has to think about various possibilities and requirements, before imposing a cardinality rule or before creating a relationship. Will it be sufficient if I go with one additional entity or I should create one lookup in order to satisfy the Business Requirement? Will the current data structures be hold good for any future expansions and modifications?

So many challenging situations may arise during the course of one Data Modeling Life Cycle. This page is entirely for that purpose which makes Data Modeler to be to think ahead and decide on what rule to apply in order to create the right Data Model.

We will come up with many difficult situations and present you with some practical based scenarios and post it on this page on the daily or weekly basis. Data Modelers make a note of this page and use it as a reference or an assignment to improve your skills in the Data Modeling Field.

Challenging Situations in Data Modeling from the Client End:
  • No documents or fewer documents with less information which explains the business process and business rules.
  • Less knowledge and no proper explanation from SME or BAs.
  • User requirements and demands are more.
  • No proper plan in the Enterprise Architecture.
Challenging Situations in Data Modeling from the Data Modeler’s Perspective:
  • Not able to understand the business requirements.
  • Understanding the business requirements but not able to predict the entities required for this project.
  • Understanding the entities required but not able to place the attributes properly in the entity.
  • Placing the attributes in entities but not able to create identifying relationships or non-identifying relationships.
  • Able to create identifying and non-identifying relationships but not sure whether ZeroOrOne to ZeroOneorMore, One to ZeroOneorMore.

How the change in the business rules affects the data model?

Original Business Rule 1:

  • Employee’s present manager to whom he reports must be tracked.
  • An entity called Employee is created and by using Self Referential Integrity and the role name, Manager is added.

Business Rule 1 Change:

  • Employee’s previous manager, present manager and future managers are to be tracked.

Original Business Rule 2:

  • Employees current residential address must be tracked.
  • An entity called address is created and you connect that address with employee entity.

Business Rule 2 Change:

Employees previous/current/future residential address must be tracked.

Here how these Business Rules(1 & 2) affects the current Data Model and as a data modeler, how will you implement these changes? What is the best way to do it?

Business Rule 3:

If there are three definite values for a column, and if you are sure that these values never change over time then what approach you will follow? – a Lookup or a Check Constraint?

Example: In URLA 1003 form provided by Fannie Mae, Page No.5, Section No. 4 one can see Purchase, Refinance and Other as the values for the field “Loan Purpose”. Should we create a lookup for these 3 values or will it be better if we create an identifier and impose a check constraint on these 3 values.

Business Rule 4:

How will you implement a Candidate Key – By creating it as a Primary Key or an Unique Constraint?

Example: Social Security Number is always a Candidate Key and whether this should be created as a Primary Key in a table or a stand alone column with Unique Constraint imposed on it.

 

Reach US!!!

 

  • We provide online training in advanced OLTP Data Modeling and DIMENSIONAL Data Modeling.
  • We also teach the data structures with Data Analytics Software “R”.
  • We provide online Data Modeling Project Support when you get struck with projects that you are involved.
  • We can analyse your Business Requirements, understand and suggest solutions to create OLTP Data Models and Dimensional Data models.
  • We provide Data Modeling Interview Preparation Sessions with a lot of Data Modeling Interview Questions/Answers, which will help you to clear any interview.

If you are interested, please reach us at Training@LearnDataModeling.com or 91-9080157239

Online Data Modeling Job Support for OLTP & Dimensional Data Modeling

CPT/OPT EAD/L2 EAD/H4 EAD holders:

If a new opportunity is provided and you are facing difficult challenges in understanding the business requirements to derive data models.

Data Modelers, Data Analyst,  ETL Developers and BI Developers:

Interview:

  • If you face tough scenario based  interview questions and not able to answer.

Less Productivity: 

  • If the duties and responsibilities are changed by the client for no reasons and if you are one among those who find it difficult to cope up with puzzling scenarios.

In Between Projects: 

  • If your roles and responsibilities must be updated in near future
  • If you are finding difficulties in data modeling (designing RDBMS database or Data Warehouse or Data Mart),  you want to take your knowledge and understanding of the Database design to the next level.

If you are the one who got struck in the above-mentioned scenarios or if you are finding difficulties in data modeling (designing RDBMS database or Data Warehouse or Data Mart), please approach Training@LearnDataModeling.com or 91-90801 57239.

What we can offer through ONLINE:

  • Our consultants have more than 15 plus years of experience in Data Modeling in normalized databases, Data Warehouses and Data Marts.
  • Has hands on with OLTP / Dimensional Data Modeling, OLAP Cubes, Informatica, Oracle Warehouse Builder, Cognos, Brio and SQL/PLSQL.
  • Provide solutions on data modeling.
  • Provide solutions on data analysis, business analysis, user expectations related to data modeling.
  • Share knowledge to implement complicated Data Modeling scenarios.
  • Will meet your deadlines on each individual task or group of tasks.
  • Can sign agreement on a daily basis/weekly basis/monthly basis.

 

Online Dimensional Data Modeling Training

Online Dimensional Data Modeling Training | Data Warehouse Training | Data Mart Training

Course Description:

The dimensional data modeling training explains how to design Data Ware House and Data Marts from OLTP data models using Erwin, Power Designer & Oracle SQL Data Modeler!

To get more information about this training program, send an email to Training@LearnDataModeling.Com 0r call us @ 91-9080157239.

Course Information:
  • Mode of Training: Online Through GotoMeeting.
  • Course Fee: $125 (One hundred and seventy five US Dollars) per person
  • Mode of Payment: To USA Savings Account or India Savings Account or through www.Xoom.com
  • Total no. of theoretical/Practical classes: At least 10 Hours
  • Instructor: Neelesh (US Employee) & Antony (Owner of LearnDataModeling.com)
  • Office: USA and Chennai
Course Requirements:
  • Internet connection
  • Lap Top or Desk Top
Tools:
  • Erwin
  • Power Designer
  • Oracle SQL Data Modeler
  • MS Word, MS Excel
  • My SQL
  • Windows Operating System
Training Certificates:
  • Will be provided.

Course Syllabus

Part 1 – Dimensional Data Modeling (OLAP):
  • Need for Strategic Information
  • Examples of Business Objectives
  • Characteristics of Information
  • Operational Systems – OLTP
  • Examples of Operational Systems
  • Decision Support Systems – OLAP
  • Operational VS Decision Support
Part 2 – Introduction to Data Warehouse:
  • Data Warehouse Definition
  • Data Marts
  • Data Warehouse and Data Mart
  • Pioneer of Data Warehousing (Inmon)
  • Bill Inmon’s Approach (HUB and Spoke Architecture)
  • Pros and Cons of Inmon’s Approach
  • Pioneer of Data WareHousing (Ralph Kimball)
  • Ralph Kimball’s Approach (Bus Architecture)
  • Pros and Cons of Kimball’s Approach
  • What is ETL?
  • Things to learn for mapping/Data mapping
Part 3 – Business Intelligence:
  • OLAP
  • Dimensional Modeling
Part 4 – Different types of Fact Tables:
  • Transactional Facts
  • Snapshot or inventory
  • Factless Facts
  • Semi Additive and Non Additive Facts
Part 5 – Dimension Tables:
  • Dimension Types
  • Degenerate Dimensions
  • Denormalized Flattened Dimensions
  • Snowflaked Dimensions
  • Role-Playing Dimensions
  • Junk Dimensions
  • Outrigger Dimensions
Part 6 – Designing Star Schema:
  • Putting Building Blocks Together
  • Dimensional Model
  • Dimensional (Star) Schema
  • Declare the grain of Business Process
  • 4 Steps Dimensional Model Design Process
    • Identify Business Process
    • Identify Grain
    • Identify Dimensions
    • Identify Facts
Part 7 – Slowly Changing Dimension Techniques:
  • Type 0: Retain Original
  • Type 1: Overwrite
  • Type 3: Add New Attribute
  • Type 4: Add Mini-Dimension
  • Type 5: Add Mini-Dimension and Type 1 Outrigger
  • Type 6: Add Type 1 Attributes to Type 2 Dimension
  • Type 7: Dual Type 1 and Type 2 Dimensions
Part 7 – Big Data Data Modeling:
  • Design data model of large volumes of Data (Large Volumes of Data) with RDBMS structure

 

To get more information about this training program, send an email to Training@LearnDataModeling.Com 0r call us @ 91-9080157239.

Oracle DDL Commands – Create Commands

Oracle Database Data Definition Language (DDL Statements) – Create Commands

To execute Oracle database commands, you need Oracle’s username, password and oracle instance name to connect to oracle database. If you haven’t got the username, contact database administrator (DBA) and get the relevant privileges. When you are working with a client, you may be provided a development schema to execute all of your database commands or privileges granted to work on all schemas depending upon your data modelling activity. All commands should be executed from sql> prompt and “;” indicates the end of an oracle command.

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 modeler by relating it with our example data.

Create Table “GENDER_LKP”:

Create table statements are used for creating tables by which data is stored permanently in the database.

CREATE TABLE GENDER_LKP (

GNDR_CD VARCHAR2 (10) NOT NULL,

GNDR_DESC VARCHAR2 (50) NOT NULL,

DTTM_STMP DATE NOT NULL,

CONSTRAINT GENDER_LKP_PK PRIMARY KEY (GNDR_CD)

);

Create Table “DEPARTMENT_LKP”:

CREATE TABLE DEPARTMENT_LKP (

DPTMT_NUM NUMBER(2) NOT NULL,

DPTMT_DESC VARCHAR2(50) NOT NULL,

DTTM_STMP DATE NOT NULL,

CONSTRAINT DEPARTMENT_LKP_PK

PRIMARY KEY (DPTMT_NUM)

);

Create Table “EMPLOYEE_DTL”:

CREATE TABLE EMPLOYEE_DTL (

EMP_DTL_ID NUMBER NOT NULL,

GNDR_CD VARCHAR2(10) NOT NULL,

DPTMT_NUM NUMBER(2) NULL,

FRST_NM VARCHAR2(30) NOT NULL,

LST_NM VARCHAR2(30) NOT NULL,

MDLE_NM VARCHAR2(30) NULL,

BRTH_DT DATE NOT NULL,

SSN VARCHAR2(11) NOT NULL,

SLRY_AMT NUMBER(7,2) NOT NULL,

DTTM_STMP DATE NOT NULL,

CONSTRAINT EMPLOYEE_DTL_PK PRIMARY KEY (EMP_DTL_ID),

CONSTRAINT EMPLOYEE_DTL_FK01 FOREIGN KEY (DPTMT_NUM) REFERENCES DEPARTMENT_LKP,

CONSTRAINT EMPLOYEE_DTL_FK02 FOREIGN KEY (GNDR_CD) REFERENCES GENDER_LKP

); 

 How to copy a table with data?

As of now, table EMPLOYEE_DTL contains no data. As soon as you load the data into EMPLOYEE_DTL, try the following command.

CREATE TABLE EMPLOYEE_DTL_COPY AS SELECT * FROM EMPLOYEE_DTL;

How to copy a table with no data?

CREATE TABLE EMPLOYEE_DTL_COPY AS SELECT * FROM EMPLOYEE_DTL WHERE 1=2; 

How to create a Sequence?

This sequence is used to generate unique numbers for the column ‘EMP_DTL_ID’.

CREATE SEQUENCE SEQ_EMPLOYEE_DTL

INCREMENT BY 1

START WITH 1

NOMAXVALUE

NOMINVALUE

NOCACHE

NOCYCLE

NOORDER

;

How to create 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_DTL_ID”.

In our INSERT STATEMENTS example, we have not provided values for the column “EMP_DTL_ID” and inserting values into “EMP_DTL_ID is taken care by sequence and trigger.

CREATE OR REPLACE TRIGGER TRG_SEQ_EMPLOYEE_DTL

BEFORE INSERT ON EMPLOYEE_DTL

FOR EACH ROW

BEGIN

SELECT SEQ_EMPLOYEE_DTL.NEXTVAL INTO :NEW.EMP_DTL_ID FROM DUAL;

END;

How to create an Index?

CREATE INDEX IND_SSN ON EMPLOYEE_DTL(SSN); 

How to create a View?

CREATE VIEW VIEW_EMPLOYEE_DTL AS SELECT * FROM EMPLOYEE_DTL; 

How to create a Synonym?

CREATE SYNONYM SYN_EMPLOYEE_DTL FOR EMPLOYEE_DTL; 

Database: Sample Data Analysis

Database: Sample Data

With a simple example of designing a data model with ‘Employee related information’, most of the data structures can be easily understood. So we will try to design a data model using the sample data given below and will explain the data modeler’s involvement in the database environment.

Sample Source Data:

First Name Middle Name Last Name SSN Gender Birth Date Salary Dept. No Dept. Desc
Melinda J Schipper 765-43-21 Female 20-APR-1973 5000
Kevin A Schulte 123-45-67 Male 13-OCT-1969 5000 10 IT

Note: If you go through our topics provided under the Data Modelling Section, you will have a brief idea about how to design a data model.

Database: Sample Data Analysis

For the sample data provided in the above 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 3 tables GENDER_LKP, DEPARTMENT_LKP, EMPLOYEE_DTL.
  • Assign correct data types 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 GENDER_LKP, DEPARTMENT_LKP as parent tables and EMPLOYEE_DTL as the child table and connect them.
  • Even though column ‘DTTM_STMP’ has not been present in the sample data, you have to add ‘DTTM_STMP’ to all tables to know the date and time on which a record is inserted or updated.

GENDER_LKP Analysis:

  • Since ‘male’ and ‘female’ values will be repeated for several records in EMPLOYEE_DTL table, you have to design this lookup for saving disk space. Sometimes the detail table may not show the exact business requirements also.
  • E.g. Since the example data contains both genders; you know that there are two genders. What would have happened if all records were male? By seeing the sample data, you might have come to a conclusion that there are only ‘males’ allowed as employees. By discussing with Business Analyst, you would come to know that both genders are allowed. For this purpose, you design a lookup table, which identifies the business requirements also.
  • You have to assign NOT NULL constraint for all columns since lookup tables in general should not have null value.
  • You have to create a column Gender Code, which is not present in sample data and this column should be assigned Primary Key to validate the detailed data in EMPLOYEE_DTL table.

Sample Source Data:

 

Entity Name Table

Name

Att

Name

Col

Name

Data

type

Null Option P Key F Key
Gender Lookup GENDER_LKP Gender Code GNDR_CD VARCHAR2(10) NOT NULL Yes No
Gender Lookup GENDER_LKP Gender Description GNDR_DESC VARCHAR2(50) NOT NULL No No
Gender Lookup GENDER_LKP DateTime Stamp DTTM_STMP DATE NOT NULL No No

Analysis of DEPARTMENT_LKP:

  • Since ‘Dept No’ and ‘Dept Desc’ values will be repeated for several records in EMPLOYEE_DTL table, you have to design this lookup for saving the disk space.
  • You have to assign NOT NULL constraint for all columns. Generally lookups should not have null value.
  • You have to assign ‘Dept No’ as the primary key to validate the detailed data in EMPLOYEE_DTL table.

Sample Source Data:

Entity Name Table

Name

Att

Name

Col

Name

Data

type

Null Optn P Key F Key
Department Lookup DEPART

MENT_LKP

Depart

ment Number

DPTMT_NUM NUMBER(2) NOT NULL Yes No
Department Lookup DEPART

MENT_LKP

Depart

ment Description

DPTMT_DESC VARCHAR2(50) NOT NULL No No
Department Lookup DEPART

MENT_LKP

DateTime Stamp DTTM_STMP DATE NOT NULL No No

Analysis of EMPLOYEE_DTL:

  • As of now, this example entity contains only sample of 2 records. In real time, this entity would store millions of records. In order to retrieve the data in a faster way, you have to create an additional column EMP_DTL_ID in EMPLOYEE_DTL and assign it as primary key.
  • In our example, column EMP_DTL_ID will be populated through sequence initiated by a trigger and you can see the sequence code and trigger code in later sections.
  • Even though SSN can be added as a primary key in EMPLOYEE_DTL table, you have to add a new column EMP_DTL_ID as the primary key to ensure the fastest retrieval of data.
  • Tip: Wherever it is required, you have to create new columns.

Sample Source Data:

Entity Name Table

Name

Att

Name

Col

Name

Data

type

Null Option P Key F Key
Employee Detail EMPLOYEE

_DTL

Employee Detail Identifier EMP_DTL_ID NUMBER NOT NULL Yes No
Employee Detail EMPLOYEE

_DTL

Department Number DPTMT_NUM NUMBER(2) NULL No Yes
Employee Detail EMPLOYEE

_DTL

Gender Code GNDR_CD VARCHAR2(10) NOT NULL No Yes
Employee Detail EMPLOYEE

_DTL

First Name FRST_NM VARCHAR2(30) NOT NULL No No
Employee Detail EMPLOYEE

_DTL

Last Name LST_NM VARCHAR2(30) NOT NULL No No
Employee Detail EMPLOYEE

_DTL

Middle Name MDLE_NM VARCHAR2(30) NULL No No
Employee Detail EMPLOYEE

_DTL

SSN SSN VARCHAR2(11) NOT NULL No No
Employee Detail EMPLOYEE

_DTL

Birth Date BRTH_DT DATE NOT NULL No No
Employee Detail EMPLOYEE

_DTL

Salary Amount SLRY_AMT NUMBER(7,2) NOT NULL No No
Employee Detail EMPLOYEE

_DTL

DateTime Stamp DTTM_STMP DATE NOT NULL No No

 

1 2 3 13