Professional Documents
Culture Documents
Data Management and Database Design: INFO 6210 Week #3
Data Management and Database Design: INFO 6210 Week #3
and
Database Design
INFO 6210
Week #3
Northeastern University
What have we learnt last week?
2
Before we start....
3
So, This week....
4
E. F. Codd Rules
5
12 Rules
High level
Guaranteed The Distribution
update, Insert,
Access Rule
Delete
Systematic
treatment of View updating Non-Subversion
NULL values
Comprehensive
Database
data sub Integrity Rule
description rule
language
6
12 Rules
• Information Rule
• All information including metadata stored in table.
• Guaranteed Access
• Every value of data must be logically addressable using combination of –
• TABLE Name [ENTITY]
• COLUMN Name [ATTRIBUTE]
• Primary Key
7
12 Rules
8
12 Rules
• View Updatable
• All views that are updatable in theory should be updatable by the system
9
12 Rules
• Distribution Rule
• RDBMS must have distribution independence
• Geographically distributed database with data stored in pieces is transparent to users.
10
12 Rules
• Non-Subversion
• Row level access to modify should not bypass integrity constraints
• RDBMS must be governed by relational rules as its primary laws
• Integrity Rule
• Database should be able to enforce its own integrity
• Integrity constraints defined in relation data and storable in catalog
• Should not depend on application programs
11
12 Rules
• Non-Subversion
• Row level access to modify should not bypass integrity constraints
• RDBMS must be governed by relational rules as its primary laws
• Integrity Rule
• Database should be able to enforce its own integrity
• Integrity constraints defined in relation data and storable in catalog
• Should not depend on application programs
12
Non-Relational Databases – NoSQL
• When it comes to choosing a database, one of the biggest decisions is picking SQL vs NoSQL
• Any businesses that have rapid growth or databases with no clear schema
definitions
• Applications that cannot define a schema for database, if you find yourself de-
normalizing data schemas, or if your schema continues to change
• Very high performance
• Eventually consistency
Terminology
Cardinality
Relation
• Cardinality of a relation is the number of tuples
Degree
Relation / Table characteristics
20
Keys
• Natural keys is –
• An Identifier which can be used to uniquely identify data
• Example: Invoice number, Registration number, Part number, etc.,
• If an entity has Natural identifier –
• We can use it as Primary key
• Most of the natural keys are acceptable as primary key identifiers
22
Natural Key
• Natural keys is –
• An Identifier which can be used to uniquely identify data
• Example: Invoice number, Registration number, Part number, etc.,
• If an entity has Natural identifier –
• We can use it as Primary key for the respective entity
• Most of the natural keys are acceptable as primary key identifiers
23
Super Key
24
Candidate key
25
Primary key
• Characteristics
• Unique values
• No change over a period of time
• Non intelligent
• Minimum number of Attributes (Recommended One attribute)
• Numeric Datatype
• Not part of any PII data
26
From the below table which column is best fit for a Primary Key?
27
Composite Primary key
28
Surrogate key
29
Exercise
• Requirement
• Basketball league has many divisions
• Division has many players
• Division has many teams
30
Questions?
31