You are on page 1of 24

LearnDataModeling.

com

Tutorial on Data Modeling, Data Warehouse & Business Intelligence!

MENU

SIDEBAR

HOME
Business Process & Business Modeling:
Modeling Types

Business Process Modeling Tools

Modeling Methods

Business Process Modeling Example

Business Process

Process Flow Modeling

Business Process Tools

Data Flow Modeling

Business Process Management (BPM)

Workflows

Advantages of BPM

Business Activity Monitoring

Business Process Re-engineering

Business Process Outsourcing

Business Process Modeling

Procurement BPO

Data Modeling Modeling:


Data Modeling Overview
Data Modeling Overview

Data Modeling Objects

Data Modeling Development Cycle

Domains, Defaults & Check Constraints

Steps to Create a Data Model

Data Model Repository

Data Modeler Role

Data Model Versioning

Data Modeling Standards

Data Modeling Reports

Data Modeling Tools


Data Modeling Tools

Creating a Data Model in Visio

DM Tools: What to Learn?

Create Logical Data Model in ER Studio

DM Tools Erwin

Identifying & Non-Identifying ER Studio

DM Tools Xcase

Naming Standards ER Studio

Visio & Data Modeling

Create Physical Model in ER Studio

Creating Objects & Data Modeling Relationships


DM Relationships

Identifying Relationship

Create Objects in Data Model

Supertype & Subtype

Cardinality & Non-Identifying

Data Modeling Types


Conceptual Data Modeling

Physical Data Modeling

Enterprise Data Modeling

Relational (OLTP) Data Modeling

Logical Data Modeling

Dimensional Data Modeling

Comparison

Logical vs Physical Data Modeling

Compare Data Models & create DDL scripts

Relational (OLTP) vs Dimensional

Physical Data Modeling


DDL Scripts from Data Model

Reverse Engineering a Data Model

Modeling Data Warehouse and Data Mart


Data Warehouse and Data Mart

Star Schema

Dimensions

Snowflake Schema

Slowly Changing Dimensions

Fact Table

Interview Questions
DM Interview Questions

DM Interview Q/A Part 2

DM Interview Q/A Part 1

Data Warehouse Interview Q/A

Database & Data Modeling:


Database Overview

Alter Object Commands

Database Objects

DML Statements

Database Sample Data

Drop Object Commands

Sample Data Analysis

Other Important Commands

Create Object Commands

Data Dictionary Commands

Data Warehouse & ETL:


Data Warehouse Concepts

Informatica Interview Q/A

Database RDBMS

Learn Informatica Tutorial

ETL Tools

Informatica Transformations

ETL Tools: What to Learn?

ETL Tools Transformation Manager

ETL Concepts

ETL Testing

ETL Tools Informatica

Software Testing & Mobile Apps Testing:


Software & Mobile Apps Testing

Software Testing Tools List

Software Testing Tutorial

Open Source Software Testing Tools

Software Testing Life Cycle

Software Testing Job Titles

Software Testing Documentation

Career Path of a Software Tester

Functional Software Testing

Mobile Applications Introduction

Manual and Automated Testing

What is Mobile Ecosystem?

Software Testing Methods & Types

Mobile Native Apps vs Mobile Web Apps

What is Bug Life Cycle?

Metadata & Business Intelligence:


Metadata Tools

Business Intelligence Overview

Business Metadata

Business Intelligence Tools

Technical Metadata

OLAP & its Hybrids

Metadata & ETL

OLAP Analysis

Metadata Reports

OLAP Database Multidimensional

BI Dashboards

Key Performance Indicators

BI Scorecards

What is Data Mining?

LearnDataModeling.com

Tutorial on Data Modeling, Data Warehouse & Business Intelligence!

MENU

SIDEBAR

IDENTIFYING AND NON-IDENTIFYING RELATIONSHIPS


June 19, 2015
learndmdwbi
Leave a comment

Analysis of Data and creating Tables & Relationships:


Usually in a data model, Tables (Entities) looks like rectangular or square type boxes, which contains columns(attributes)
and these tables are connected by lines (relationships). Identifying relationship and Non-Identifying relationship are two
types of relationships. Based on cardinality, relationship are broadly classified into one to one relationship, one to many
relationship and many to many relationship. Occasionally, there may arise a situation where you need to create a foreign
key column by connecting a relationship to primary key column of the same table, which is called as self-referential or
recursive relationship.
With the following example, we will explain you about how you can learn and practice different types of relationships with
Quests TOAD Software tool.

Primary Key:
If the attribute (column) has to be unique and should contain NON-NULL values, data modelers create primary key
constraint on that particular attribute and it is called the primary key attribute of that entity.

Foreign Key:
Attributes within same entity or attributes from different entities will be connected by a connector (foreign key) to the
primary key attribute.

Composite Primary key:


If more than one column is present as a primary key, then it is called as primary key.
Let us consider a software company, which is involved in implementing projects. Assume that the client has sent the
following information to the software company and software company has to create logical and physical data models and
implement that in a database.

Sample Data:

Data Modeler analyzes data, talks to business analysts or smart management experts in the client and understands the
requirements.
Following section describes business requirements.

Business Requirements:
One employee has only one manager and CEO doesnt have any manager.
Manager Numbers are also Employee Numbers.
One employee can work in only one department and one or more employees can work in the same department.
One or more employees can have the same title.
One employee can work in one or more projects and one project can have one or more employees.
Following sections, how business requirements are transformed to a data model.

Analysis:

How many tables should be present in the data model?


1. We have to create EMPLOYEE table and Employee_No should be the primary key of the table and later other stand
alone columns and foreign key columns have to be added based on the relationship.
2. Employee_No has one to many relationship with Department_No because one or more employees can work in the
same department. So DEPARTMENT table should be created and Dept_No should be the primary key of the
DEPARTMENT table. Dept_No has to be connected to EMPLOYEE table and Dept_No in EMPLOYEE table is a foreign key
to DEPARTMENT table.
3. Employee_No has one to many relationship with Title_Code because one or more employees can have the same
title. So TITLE table should be created as a separate table and Title_Code should be the primary key of the TITLE table.
Title_Code has to be connected to EMPLOYEE table and Title_Code in EMPLOYEE table is a foreign key to TITLE table.
4. One or more employees can work in one or more projects. So a separate table PROJECT should be created first and
Project_Code should be the primary key of the table. Since the relationship between EMPLOYEE and PROJECT table
depicts a many-to-many relationship and this relationship cannot be resolved using these two tables alone. So you
need to create one more table EMPLOYEE_PROJECT to resolve this.
5. Employee_No has many to many relationship with Project_Code because one or more employees can work in one or
more projects and one project can have one or more employees. So a separate table EMPLOYEE_PROJECT should be
created which shows many to many relationship with employees and project. It should be connected to Employee
table and Project Table. Here Employee_No and Project_Code are the composite primary key of this table.
6. Since Employee_No and Manager_No are same, we should create a self referential or recursive relationship within
the same EMPLOYEE table. So a separate foreign key column should be created by connecting with Employee_no and
should be named as Manager_No.
Next section, explains how to create entities, attributes, primary keys, foreign keys, and how to implement these in a
database by using TOAD SOFTWARE DATA MODELING TOOL.

Related Posts
Identifying Relationship
Non Identifying Relationship
Create Data Modeling Objects in Toad
Supertype and SubType
Data Modeling Tools: What to Learn?
Data Flow Modeling
(Visited 765 times, 1 visits today)
tagged with business requirements, Detailed analysis of data, Identifying and Non-Identifying Relationships, identifying
relationships, non-identifying relationships, relationships in data model, Self Referential Integrity
Data Modeling Relationships

LEAVE A REPLY
Your email address will not be published. Required fields are marked *
Comment

Name *

Email *

Website

Post Comment

Powered by WordPress and Dynamic News.

LearnDataModeling.com

Tutorial on Data Modeling, Data Warehouse & Business Intelligence!

MENU

SIDEBAR

CREATE DATA MODELING OBJECTS IN TOAD


July 16, 2015
learndmdwbi
Leave a comment

How to create Data Modeling Objects in Toad?


Here in this section, we will create a physical data model instead of starting from logical data model, since we can cover
most of the features of a data modeling tool in the physical data model. Please refer our sections listed under Data
Modeling Topic Logical Data Modeling and Data Modeling Tool Erwin for creating a logical data model.

Table Structures:
Employee

Title

Department

Project

Employee_Project

Employee_No (PK)

Title_Code (PK)

Department_No (PK)

Project_Code (PK)

Employee_No (FPK)

Employee_Name

Title_Description

Department_Name

Software_Used

Project_Code (FPK)

Manager_No (FK)
Title_Code (FK)
Department_No (FK)

Working with Toad:


Open Toad Data Modeler Software
Click Menu File New Model
A new window will appear which asks you to select the database on which you will be generating the physical model
Since we are doing it in Oracle, select Oracle 11g release 2. Click OK.
A new screen appears. On the left hands side top, you can see the database name (Oracle 11g release 2). Below that
you can see Physical Model Explorer, which contain different objects. Physical Model looks similar to a windows
explorer.
On the middle and right hand side, you can see work-space (work area), where we will be creating objects.
On the tool bar, you can see a list box which displays Captions (Logical Data Model, Names (Physical Data Model) and Full
Names. Select Names.

How to create table DEPARTMENT?


Click entity icon displayed on the tool bar and drop it on the work area. A new entity is created. By default some
name is provided by the tool.
Highlight the entity, right click and click edit from the sub menu.
A new window, which contains different tabs, is opened.
Under General Tab, change the name and captions to DEPARTMENT.
Click Apply and OKAY. Now in the work area, you can see the DEPARTMENT table.
NOTE: Give proper names to TABLES, COLUMNS, PRIMARY KEYS, FOREIGN KEYS, INDEXES etc. and all other database
objects as per the standard maintained by the data modeling team and database team.

How to create columns, primary keys, data type to table?


1. DEPARTMENT Table:
Column Name

Constraint Name

DataType

Department_No

Primary Key

Integer

Department_Name

NOT NULL

VARCHAR2 (30)

Highlight table DEPARTMENT, right click edit from the sub menu.
Click Tab Attributes. Click Add. By default, an attribute is created. Click edit and from the new window
Change name and caption to Department_No.
Change the data type to Integer.
Department_No is the primary key of the table. So double click the space under the key column and you can see
the key symbol. Click apply and OK. Go to the keys tab and change the primary key name to Department_PK.
On the work area, you can see table DEPARTMENT with a column Department_No as the primary key.
Similarly create column Department_Name with data type as VARCHAR2 (30). It should not be the primary key and
it should be a column in the table. When you create, you can see a check box under NOT NULL. Check that check box
so that this column will be NOT NULL. Assign data type as VARCHAR2 (30).
Similarly create tables TITLE and PROJECT and add columns to those tables.

2. TITLE Table:
Column Name

Constraint Name

DataType

Title_Code (PK)

Primary Key

Integer

Title_Description

NOT NULL

VARCHAR2 (30)

3. PROJECT Table:
Column Name

Constraint Name

DataType

Project_Code (PK)

Primary Key

Integer

Software_Used

NOT NULL

VARCHAR2 (30)

Similarly create table EMPLOYEE with Employee_No as the primary key and Employee_Name as the column. Later we will
add other columns.

4. EMPLOYEE Table:
Column Name

Constraint Name

DataType

Employee_No (PK)
Column Name

Primary Key
Constraint Name

Integer
DataType

Employee_Name

NOT NULL

VARCHAR2 (30)

Related Posts
Comparison of Logical and Physical Data Modeling
Data Modeling Subject Area, Default, Domain, Rules & Constraints
Identifying and Non-Identifying Relationships
Identifying Relationship
Non Identifying Relationship
Supertype and SubType
(Visited 904 times, 2 visits today)
tagged with Create Data Modeling Objects in Toad, Data Model using Toad, How to create columns, Logical and Physical
Data Model using Toad, primary keys and assign NOT NULL constraint in a data model, table, Toad Data Model, Toad Data
Modeler, Toad Data Modeling Tool
Data Modeling Relationships

LEAVE A REPLY
Your email address will not be published. Required fields are marked *
Comment

Name *

Email *

Website

Post Comment

Powered by WordPress and Dynamic News.

LearnDataModeling.com

Tutorial on Data Modeling, Data Warehouse & Business Intelligence!

MENU

SIDEBAR

NON IDENTIFYING RELATIONSHIP


July 16, 2015
learndmdwbi
Leave a comment

What is Non-Identifying relationship?


If a column (foreign key) / multiple columns (foreign key columns) referencing some table becomes a column in a table as
a NON-PRIMARY KEY, and then it is non-identifying relationship.

How to create non-identifying relationship with cardinality of 1 to many relationship in


Employee Table?
Example 1: Employee Table with Department Table:
Since the relationship is one to many with Department_No (Department Table) and Department_No (Employee table), we
go with Non-Identifying Relationship. In Non-Identifying relationship, primary key migrates from the Department table
to Employee table and it is not a part of the primary key in Employee table. Here Department_No becomes the foreign key
column and generally Foreign Key relationship is represented by a dotted line.
Click Non-Identifying relationship in the toolbar.
Click first on Department table; you can see a dotted line and then click on Employee table. Now you can see a
relationship(dotted line) created between the Department Table and Employee Table.
Double Click the relationship. Change the relationship name as required (EMPLOYEE_FK01).
Under section CARDINALITY, check Mandatory Parent and Mandatory Child, since NULL values are not allowed in
both the primary key and foreign key columns. Now the cardinality is 1..1 to 1..n.
Cardinality describes the relationship between a parent table and a child table. When you edit properties of the
relationship line, you will be requested check(enable) the check boxes for mandatory parent column, and mandatory
child. We have explained various permutations and combinations below.
Parent Table

Child Table

Mandatory

Mandatory

Cardinality

Parent

Child

Relationship

Department.Department_No

Employee.Department_No

Yes

Yes

1..1 to 1..n

Department.Department_No

Employee.Department_No

Yes

No

1..1 to 0..n

Department.Department_No

Employee.Department_No

No

Yes

0..1 to 1..n

Department.Department_No

Employee.Department_No

No

No

0..1 to 0..n

If you want to change the default foreign key index name, then change the name (EMPLOYEE_IDX01) in Index to
Foreign Key tab. You have to double click the relationship line and there is a tab named Index to Foreign Key.
Click apply and ok. You can see how tables are connected and a new column Department_No is included in the
Employee table.

Example 2: Employee Table with Title Table:


Repeat the above same procedure and you can see how Title table and Employee table are connected. You can see a new
column Title_Code is included in the Employee Table.

How to create SELF REFERENTIAL OR RECURSIVE RELATIONSHIP in Employee Table:


When a Foreign key references the parent key(Primary key) of the same table, then it is called a SELF REFERENTIAL OR
RECURSIVE RELATIONSHIP. The column Manager_No in the Employee table is a Foreign key which takes its values from the
column Employee_No of the same Employee table.
This relationship is created by non-identifying relationship with cardinality 1 to many relationship in Employee Table:
Click Non-Identifying relationship in the tool bar.
Click the employee table twice. You can see the relationship created and a new column FK_EMPLOYEE_NAME
appearing within the table. Go to the properties of that column and change the name to MANAGER_NO. So this
column Manager_No will reference the values from its primary key column Employee_No.

Related Posts
Identifying Relationship
Supertype and SubType
Identifying and Non-Identifying Relationships
Data Modeling Frequently Asked Interview Questions And Answers Part 1
Create Data Modeling Objects in Toad
Fact Table
(Visited 1,189 times, 3 visits today)
tagged with Cardinality, Foreign key relationships in a data model, Non-Identifying relationship, One to Many relationship
examples, Self Referential or Recursive Relationship
Data Modeling Relationships

LEAVE A REPLY
Your email address will not be published. Required fields are marked *
Comment

Name *

Email *

Website

Post Comment

Powered by WordPress and Dynamic News.

LearnDataModeling.com

Tutorial on Data Modeling, Data Warehouse & Business Intelligence!

MENU

SIDEBAR

IDENTIFYING RELATIONSHIP
July 16, 2015
learndmdwbi
Leave a comment

How to create Identifying Relationship with Cardinality of many to many


relationship:
Identifying relationship:
If a foreign key column/multiple foreign key columns referencing some table, becomes a part of the primary key, and then
it is an identifying relationship.

Employee and PROJECTS Table association:


Since the relationship is many to many with Employee_No (Employee Table) and Project_Code (Project table), we go with
Identifying Relationship. In Identifying relationship, primary key migrates from the parent table to child table and it is a
part of the primary key in Child table. Foreign Key relationship is a thicker line.
Create table EMPLOYEE_PROJECT with no column.
Click identifying relationship in the tool bar.
Click Employee table first and then EMPLOYEE_PROJECT table. The line is not dotted and thicker. Employee_No
column is created in EMPLOYEE_PROJECT table.
Similarly click identifying relationship in the tool bar. Click Project table first and then EMPLOYEE_PROJECT table. The
line is not dotted and thicker. Project_Code column is created as primary key in EMPLOYEE_PROJECT table.
The example above talks about many to many relationships and it involves two tables Employee and Projects to form a
third table Employee_Projects.

In some scenarios, if a primary key of the table is not able to identify uniqueness of a record in a table, then they add one
more column from another table as a primary key with identifying relationship.
Save the data model with a meaningful name and save it either in your local directory or in a shared directory.
This data model is stored as Data_Modeling_Relationship.txl. On the tool bar, you can see the save menu.
Finally an image of the completed data model Data_Modeling_Relationship looks like this.

Related Posts
Non Identifying Relationship
Supertype and SubType
Identifying and Non-Identifying Relationships
Create Data Modeling Objects in Toad
Data Modeling Frequently Asked Interview Questions And Answers Part 1
Fact Table
(Visited 793 times, 1 visits today)
tagged with creating objects in a database schema, creating or generating scripts from a data model using Quest's TOAD
DATA MODELER, Forward engineering a data model, validating a data model, verifying a data model
Data Modeling Relationships

LEAVE A REPLY
Your email address will not be published. Required fields are marked *
Comment

Name *

Email *

Website

Post Comment

Powered by WordPress and Dynamic News.

LearnDataModeling.com

Tutorial on Data Modeling, Data Warehouse & Business Intelligence!

MENU

SIDEBAR

SUPERTYPE AND SUBTYPE


June 18, 2015
learndmdwbi
Leave a comment

At times, few entities in a data model may share some common properties (attributes) within themselves apart from
having one or more distinct attributes. Based on the attributes, these entities are categorized as Supertype and Subtype
entities.
Supertype is an entity type that has got relationship (parent to child relationship) with one or more subtypes and it
contains attributes that are common to its subtypes.
Subtypes are subgroups of the supertype entity and have unique attributes, but they will be different from each subtype.
Supertypes and Subtypes are parent and child entities respectively and the primary keys of supertype and subtype are
always identical.
E.g. People, Bank Account, Insurance, Asset, Liability, Credit Card.
When designing a data model for PEOPLE, you can have a supertype entity of PEOPLE and its subtype entities can be
vendor, customer, and employee. People entity will have attributes like Name, Address, and Telephone number, which are
common to its subtypes and you can design entities employee, vendor, and consumer with their own unique attributes.
Based on this scenario, employee entity can be further classified under different subtype entities like HR employee, IT
employee etc. Here employee will be the superset for the entities HR Employee and IT employee, but again it is a subtype
for the PEOPLE entity.

A person can open a savings account or a certificate deposit (fixed deposit) in a bank. These accounts have attributes like
account number, account opening date, account expiry date, principal amount, maturity amount, account balance, interest
rate, checks issued, pre-cancellation fee etc. While designing a data model, you can create supertype parent entity as
Account and subtype entities as Savings Account and Certificate Deposit. Account entity will store attributes like account
number, interest rate that are common to savings account and certificate deposit entity. Savings account entity will have
attributes like account balance and checks issued. While fixed deposit entity will have attributes like account opening,
account expiry date, principal amount, maturity amount, pre-cancellation fee etc. When you design a logical data model in
this manner, it provides more meaning to the business and the attributes are not cluttered in one table.

More Examples:
Insurance entity can act as supertype and entities like health insurance, life insurance, auto insurance, liability insurance,

malpractice insurance etc., can be subtype entities.


Asset entity can be the supertype and entities like bank, real estate, auto, retirement fund, stocks, and life insurance etc.,
can be subtype entities.
Liability entity may be the supertype and entities like real estate, auto loan, alimony, other debts etc., may be subtype
entities.
Credit card entity may be the supertype and entities like balance transfer cards, cash back credit cards, business credit
card, student credit card, secured credit card etc., may be the subtype entities.

Related Posts
Identifying Relationship
Non Identifying Relationship
Business Process Reengineering
Identifying and Non-Identifying Relationships
Relational Data Modeling Example
Create Data Modeling Objects in Toad
(Visited 14,850 times, 21 visits today)
tagged with data modelling and subtype, data modelling and supertype, subtype, subtype entity, supertype, supertype
entity
Data Modeling Relationships

LEAVE A REPLY
Your email address will not be published. Required fields are marked *
Comment

Name *

Email *

Website

Post Comment

Powered by WordPress and Dynamic News.

LearnDataModeling.com

Tutorial on Data Modeling, Data Warehouse & Business Intelligence!

MENU

SIDEBAR

CREATING A LOGICAL DATA MODEL USING ERWIN


July 16, 2015
learndmdwbi
Leave a comment

How to create a Logical Data Model using Erwin 4.1.4 version?


In the following section, a simple example with a step by step procedure to create a logical data model with two entities
and their relationship are explained in detail.
1: Open All Fusion Erwin Data Modeler software.
2: Select the view as Logical from the drop-down list. By default, logical will be your workplace.
3: Click New from File menu. Select the option Logical/Physical from the displayed wizard. Click Ok.
4: To create an Entity, click the icon Entity and drop it on the workplace. By default E/1 will be displayed as the entity
name. Change it to Country.
5: To create an Attribute, Place the cursor on the entity Country and right click it. From the displayed menu, click
attributes which will take you to the attribute wizard. Click New button on the wizard and type attribute name as
Country Code. Select the data type as String and click OK. Select the option Primary Key to identify attribute Country
Code as the primary key. Follow the same approach and create another attribute Country Name without selecting the
primary key option. Click ok, and now you will be having 2 attributes Country Code, and Country Name under the entity
Country in the current logical workplace.

6: Create another entity Bank with two attributes namely Bank Code and Bank Name by following steps 4 and 5.
7: In order to relate these two tables country, bank, a Foreign Key relationship must be created. To create a Foreign Key
relationship, follow these steps.
(a) Click the symbol Non Identifying Relationship.
(b) Place the cursor on the entity Country.
(c) Place the cursor on the entity Bank. Now you can see the relationship(a line drawn from Bank to Country)
between Country and Bank. Double click on that relationship line to open Relationships wizard and change the
option from Nulls Allowed to No Nulls since bank should have a country code.
The Logical Data Model created by following the above steps looks similar to the following diagram.

Next Creating a Physical Data Model using Erwin

Related Posts
Erwin Tutorial
Creating a Physical Data Model using Erwin
How to add identifying, non-identifying, self-recursive relationship in ER Studio Data Architect?
How to create a physical data model from a logical data model using Embarcaderos Data Architect?
How To Create A Logical Data Model In ER Studio Data Architect?
Data Modeling Tools
(Visited 3,192 times, 3 visits today)
tagged with erwin logical data model, erwin logical data model example diagram, Erwin Logical data Modeling, How to
create a Logical Data Model using Erwin 4.1.4 version?, Logical Data Model using Erwin
Data Modeling Tools

LEAVE A REPLY
Your email address will not be published. Required fields are marked *
Comment

Name *

Email *

Website

Post Comment

Powered by WordPress and Dynamic News.

5/11/2016

Identifyingandnonidentifyingrelationships

PRODUCTS

DOWNLOADS

PURCHASE

SUPPORT

COMPANY

CONTACTUS

Support
Supportoverview
Contactsupport

IdentifyingandNonIdentifyingRelationships

Submitanincident

Anidentifyingrelationshipmeansthatthechildtablecannotbeuniquelyidentifiedwithouttheparent.Forexample,

Articlesandtutorials

youhavethissituationintheintersectiontableusedtoresolveamanytomanyrelationshipwheretheintersecting
table'sPrimaryKeyisacompositeoftheleftandright(parents)table'sPrimaryKeys.

Updates(LicensedUsers)
Videos
Knowledgebase
ProductInfo

Example...

DeZignforDatabases

Account(AccountID,AccountNum,AccountTypeID)

DatanamicDataDiff

PersonAccount(AccountID,PersonID,Balance)

DatanamicSchemaDiff

Person(PersonID,Name)

DatanamicDataGenerator
DatanamicMultiRun

TheAccounttoPersonAccountrelationshipandthePersontoPersonAccountrelationshipareidentifyingbecause
thechildrow(PersonAccount)cannotexistwithouthavingbeendefinedintheparent(AccountorPerson).Inother
words:thereisnopersonaccountwhenthereisnoPersonorwhenthereisnoAccount.
Anonidentifyingrelationshipisonewherethechildcanbeidentifiedindependentlyoftheparent(Account
AccountType)
Example...
Account(AccountID,AccountNum,AccountTypeID)
AccountType(AccountTypeID,Code,Name,Description)
TherelationshipbetweenAccountandAccountTypeisnonidentifyingbecauseeachAccountTypecanbeidentified
withouthavingtoexistintheparenttable.
Youcandefinetherelationshiptype(identifying/nonidentifying)intheDeZignforDatabasesintherelationship
dialog.Doubleclickontherelationshiplineinthediagramwindowtodisplaytherelationshipdialog.

http://www.datanamic.com/support/relationshiptypes.html

1/2

5/11/2016

databaseWhat'sthedifferencebetweenidentifyingandnonidentifyingrelationships?StackOverflow

signup

StackOverflowisacommunityof4.7
millionprogrammers,justlikeyou,
helpingeachother.

login

tour

help

JointheStackOverflowcommunityto:

Jointhemitonlytakesaminute:
Ask
programming
questions

Signup

Answerandhelp
yourpeers

Getrecognizedforyour
expertise

What'sthedifferencebetweenidentifyingandnonidentifyingrelationships?
Ihaven'tbeenabletofullygraspthedifferences.Canyoudescribebothconceptsanduserealworld
examples?
database databasedesign datamodeling
editedSep25'13at20:29

askedApr18'09at5:04

RobertHarvey
125k

27

213

LocNguyen
339

2,952

14

24

23 Thankyouforasking,hadthesamedoubttoo.AlixAxelOct11'11at19:08
33 Thanks.I'musingMySQLworkbenchandIhavethisquestionalso.marknt15Mar21'13at3:03

11Answers

Anidentifyingrelationshipiswhentheexistenceofarowinachildtabledependsona
rowinaparenttable.Thismaybeconfusingbecauseit'scommonpracticethesedaysto
createapseudokeyforachildtable,butnotmaketheforeignkeytotheparentpartofthe
child'sprimarykey.Formally,the"right"waytodothisistomaketheforeignkeypartof
thechild'sprimarykey.Butthelogicalrelationshipisthatthechildcannotexistwithoutthe
parent.
Example:A Person hasoneormorephonenumbers.Iftheyhadjustonephonenumber,
wecouldsimplystoreitinacolumnof Person .Sincewewanttosupportmultiplephone
numbers,wemakeasecondtable PhoneNumbers ,whoseprimarykeyincludesthe
person_id referencingthe Person table.
Wemaythinkofthephonenumber(s)asbelongingtoaperson,eventhoughtheyare
modeledasattributesofaseparatetable.Thisisastrongcluethatthisisanidentifying
relationship(evenifwedon'tliterallyinclude person_id intheprimarykeyof
PhoneNumbers ).
Anonidentifyingrelationshipiswhentheprimarykeyattributesoftheparentmustnot
becomeprimarykeyattributesofthechild.Agoodexampleofthisisalookuptable,such
asaforeignkeyon Person.state referencingtheprimarykeyof States.state . Person is
achildtablewithrespectto States .Butarowin Person isnotidentifiedbyits state
attribute.I.e. state isnotpartoftheprimarykeyof Person .
Anonidentifyingrelationshipcanbeoptionalormandatory,whichmeanstheforeign
keycolumnallowsNULLordisallowsNULL,respectively.

SeealsomyanswertoStillConfusedAboutIdentifyingvs.NonIdentifyingRelationships
editedJul5'13at20:11

answeredApr18'09at5:59

BillKarwin
267k

49

370

545

33 +1Greatexplanation,Bill.CesarGonMar6'10at13:34
4

+1:Bill,"it'scommonpracticethesedaystocreateapseudokeyforachildtable,butnotmaketheforeign
keytotheparentpartofthechild'sprimarykey"anylinksastowhythisis?Googleisfailingme.
hobodaveMar10'10at21:41

Itseemslike"properly"constructingidentifyingrelationshipswouldleadtoobnoxiouslyhugeprimarykeys.
e.g.BuildinghasFloorhasRoomhasBed.ThePKforBedwouldbe(bed_id,floor_id,room_id,

http://stackoverflow.com/questions/762937/whatsthedifferencebetweenidentifyingandnonidentifyingrelationships

1/5

5/11/2016

databaseWhat'sthedifferencebetweenidentifyingandnonidentifyingrelationships?StackOverflow

building_id).Itseem'sstrangethatI'veneverseenthisinpractice,norhearditsuggestedasawaytodo
anything.That'salotofredundantdatainthePK.hobodaveMar10'10at23:34
13 @hobodave:Ihaveseenmulticolumnprimarykeysthatareevenlarger.ButItakeyourpoint.Consider
thatmulticolumnprimarykeysconveymoreinformationyoucanquerythe Beds tableforallbedsina
specificbuildingwithoutdoinganyjoins.BillKarwinMar11'10at1:00
1

@Eugene,yesIwouldexpectthattobeanonidentifyingrelationship. user_id shouldbetheprimarykey


byitself,and updated_by isnotpartofamulticolumnprimarykey.BillKarwinJul29'11at14:18

Thereisanotherexplanationfromtherealworld:
Abookbelongstoanowner,andanownercanownmultiplebooks.Butthebookcanexist
alsowithouttheowneranditcanchangetheowner.Therelationshipbetweenabookandan
ownerisanonidentifyingrelationship.
Abookhoweveriswrittenbyanauthor,andtheauthorcouldhavewrittenmultiplebooks.But
thebookneedstobewrittenbyanauthoritcannotexistwithoutanauthor.Thereforethe
relationshipbetweenthebookandtheauthorisanidentifyingrelationship.
editedSep6'13at9:40

answeredMar6'10at12:54

pixelistik
3,842

user287724
15

32

120 +1verysimpleandclearHernnEcheDec2'10at19:57
3

Thiswasaverygoodexplanation,thankyouverymuch!jraraMay22'11at10:02

Thishelpedalot.Thanks!JamesNov30'11at18:39

Plainandsimpleexample.Excellentandthanks!:)marknt15Mar21'13at3:11

11

Whathappensifthebookwaswrittenbymorethan1author?It'snotidentifyingrelationshipanymoreas
M:Ntype,why?NGixNov26'13at21:49

AnIdentifyingrelationshipspecifiesthatachildobjectcannotexistwithouttheparentobject
Nonidentifyingrelationshipsspecifiesaregularassociationbetweenobjects,1:1or1:n
cardinality.
Nonidentifyingrelationshipscanbespecifiedasoptionalwhereaparentisnotrequiredor
mandatorywhereaparentisrequiredbysettingtheparenttablecardinality...
answeredApr18'09at5:45

CMS
427k

118

730

746

4 Thissoundsmorelikeadescriptionoftotalparticipationinarelationship,thanofanidentifyingrelationship.
ThomasPadronMcCarthyApr18'09at6:03
You'reliterallycompetingwithaguywhohas218kreputation.Justthrowingthatouttherebecauseyouboth

definitelyknowmorethanIdo.MarcDiMilloFeb3'13at8:23
Idisagreewiththeabovedefinitions.Youmayhaveanobjectthatdependsonitsparentandyouwantthat
objecttobeconstrainedtobelinkedonlywith1parentrow.A House has Wall s.Youremovehouseand

youdon'thavewalls.Butawallbelongsonlytoahouse.Sodoingstrongrelationshipwon'twork:
PK(Wall.id,House.id) willallowyoutoinsertintothemodelthesamewalltoanotherhouse.Sebastian
Apr6'15at1:08

Here'sagooddescription:
Relationshipsbetweentwoentitiesmaybeclassifiedasbeingeither"identifying"or"non
identifying".Identifyingrelationshipsexistwhentheprimarykeyoftheparententityisincluded
intheprimarykeyofthechildentity.Ontheotherhand,anonidentifyingrelationshipexists
whentheprimarykeyoftheparententityisincludedinthechildentitybutnotaspartofthe
childentity'sprimarykey.Inaddition,nonidentifyingrelationshipsmaybefurtherclassifiedas
beingeither"mandatory"or"nonmandatory".Amandatorynonidentifyingrelationshipexists
whenthevalueinthechildtablecannotbenull.Ontheotherhand,anonmandatorynon
identifyingrelationshipexistswhenthevalueinthechildtablecanbenull.
http://www.sqlteam.com/article/databasedesignandmodelingfundamentals
Here'sasimpleexampleofanidentifyingrelationship:
Parent

http://stackoverflow.com/questions/762937/whatsthedifferencebetweenidentifyingandnonidentifyingrelationships

2/5

5/11/2016

databaseWhat'sthedifferencebetweenidentifyingandnonidentifyingrelationships?StackOverflow

ID(PK)
Name
Child

ID(PK)
ParentID(PK,FKtoParent.ID)noticePK
Name

Here'sacorrespondingnonidentifyingrelationship:
Parent

ID(PK)
Name
Child

ID(PK)
ParentID(FKtoParent.ID)noticenoPK
Name
answeredApr18'09at5:51

AndyWhite
45.9k

38

140

184

1 YouranswerconflictswiththatgivenbyBillKarwin,inthedifferencebetweenwhethertheForeignKey"is
not"or"mustnot"bepartofthePrimaryKeyintheChildrow.NickCAug1'09at15:47
@AndyWhiteButcouldtheprimarykeyoftheparentinanidentifyingrelationshipbenonmandatory,i.e.,

null,whenitispartofathreecolumncompositeprimarykey?FrederikKrautwaldApr29'15at21:21

Nonidentifyingrelationship
Anonidentifyingrelationshipmeansthatachildisrelatedtoparentbutitcanbeidentifiedby
itsown.
PERSONACCOUNT
=============
pk(id)pk(id)
namefk(person_id)
balance

TherelationshipbetweenACCOUNTandPERSONisnonidentifying.
Identifyingrelationship
Anidentifyingrelationshipmeansthattheparentisneededtogiveidentitytochild.Thechild
solelyexistsbecauseofparent.
Thismeansthatforeignkeyisaprimarykeytoo.
ITEMLANGUAGEITEM_LANG
=====================
pk(id)pk(id)pk(fk(item_id))
namenamepk(fk(lang_id))
name

TherelationshipbetweenITEM_LANGandITEMisidentifying.AndbetweenITEM_LANGand
LANGUAGEtoo.
answeredMay22'14at14:31

Skarllot
439

Theidentifingrelaionshipmeansthechildentityistotallydependontheexistanceofthe
parententity.Exampleaccounttablepersontableandpersonaccount.Thepersonaccount
tableisidentifiedbytheexistanceofaccountandpersontableonly.
Thenonidentifingrelationshipmeansthechildtabledoesnotidentifiedbytheexistanceofthe
parenttableexamplethereistableasaccounttypeandaccount.accounttypetableisnot
identifiedwiththeexistanceofaccounttable.
answeredApr1'11at18:47

chanchaldixit
31

http://stackoverflow.com/questions/762937/whatsthedifferencebetweenidentifyingandnonidentifyingrelationships

3/5

You might also like