SlideShare a Scribd company logo
1 of 68
Download to read offline
MODULE 3: THE RDBMS AND THE
RELATIONAL MODEL
SQL and Scripting
Training
(C) 2020-2021 Highervista, LLC 1
2
TOPICS
RDBMS Concept Preview
Understanding the RDBMS Model
Data Modeling Concepts: Part 1
A Primer to Relational Algebra
Recap: Understanding the RDBMS Model
Types of Data
3
VIDEO: RDBMS
UNDERSTANDING THE RDBMS MODEL SQL and Scripting
Training
5
CHARACTERISTICS OF A RELATIONAL
TABLE
Characteristics of a Relational Table (TutorialsPoint, 2020)
6
KEYS
Consist of one or more attributes that
determine other attributes
Used to
­ Ensure that each row in a table is uniquely
identifiable
­ Establish relationships among tables and ensure data
integrity
Primary key (PK)—Attribute or combination of
attributes that uniquely identifies a row
Source: Microsoft Images
7
RELATIONAL DATABASE KEYS
Relational Database Keys (TutorialsPoint, 2020)
8
EXAMPLE OF A SIMPLE RELATIONAL
DATABASE
Example of a Simple Relational Database (TutorialsPoint, 2020)
9
INTEGRITY RULES
10
INTEGRITY RULES: AN EXAMPLE
Integrity Rules: An Example (TutorialsPoint, 2020)
11
WAYS TO HANDLE NULLS
NOT NULL constraint—Placed on a column to ensure that every
row in the table has a value for that column
UNIQUE constraint—Restriction placed on a column to ensure that
no duplicate values exist for that column
Is a field NOT NULL or UNIQUE in your database model? Be sure
to indicate this in your Data Dictionary.
DATA MODELING CONCEPTS SQL and Scripting
Training
13
DATA MODELING OBJECTIVES
Understand concepts of data modeling and its purpose
Learn how relationships between entities are defined and refined, and how
they are incorporated into the database design process
Learn how ERD components affect database design and implementation
Learn how to interpret the modeling symbols
14
IMPORTANCE OF DATA MODEL
Blueprint—official documentation
­ blueprint of house
Employees w/o DB knowledge can understand
­ a data model diagram vs. a list of tables
­ an effective communication tool
­ improves interaction among managers,
designers, and end users
Independence from a particular DBMS
­ network DB, object-oriented DB, etc.
15
DATA MODEL
Model—an abstraction of a real-world
object or event
­ useful in understanding complexities of the
real-world environment
Data model
­ a diagram that displays a set of tables and
the relationships between them
­ a foundation
­ next slides: Draw.io Entity Relationship
Diagram (ERD) examples
West and Fowler (1999)
16
ENTITY RELATIONSHIP DIAGRAM
(ERD) PROCEDURE
Relatively simple representations of complex real-world data
structures
Data modeling is an iterative process.
A "complete" and "100% error free" data model is impossible!
An "optimized" data model is possible …
17
ERD STYLES
Active link to diagram
Chen ERD Style Notation
18
ERD STYLES
Active link to diagram
Crow’s Foot
ERD Notation Style
19
WHAT IS AN ERD?
ERD is a data modeling technique used in
software engineering to produce a conceptual
data model of an information system.
ERDs illustrate the logical structure of
databases.
ERDs represent 'business' or 'use' cases
20
EXAMPLE DATA MODEL—
ERD (CROW’S FOOT
NOTATION)
21
DATA MODEL—ERD
The data modeling
revolves around
discovering and analyzing
organizational and user's
data requirements (use
cases).
Requirements based on
policies, meetings,
procedures, system
specifications, etc.
• Identify what data is
important
• Identify what data should
be maintained
22
DATA
MODEL—
ERD
The major activity of this phase is
identifying entities, attributes, and
their relationships to construct model
using the Entity Relationship Diagram.
"Logical" (or design) names include:
Entity/Attribute/Relationship
"Physical" implementation names
include: Table, Column, Line
Entity à table
Attribute à column
Relationship à line
23
ERD NOTATION
Digging into the three components in
ERDs
­ Entity
­ Attributes
­ Relationships
24
ENTITY
An Entity is a collection of data, using
a rectangle with attributes listed inside
the entity ‘box.'
For example, an entity STUDENT could
include the attributes StudentID, Name,
Registered, Region, etc.
A second entity following this example
would be COURSE, which would
include the attributes Title, Credit,
Quota.
25
VIDEO: BASICS OF DATA MODELING
26
ENTITY RELATIONSHIP NOTATION
Digging into the three
components in ERDs
­ Entity
­ Attributes
­ Relationships
27
ENTITY
An entity is a collection of data, using a
rectangle with attributes listed inside the
entity "box." For example, STUDENT
could include the attributes student_id,
student_name, student_address, etc.
A second entity following this example
would be COURSE, which would include
the attributes course_name,
course_number, etc.
28
CROW'S FOOT NOTATION
FOR ENTITY
Entity:
­ Represented by a rectangle, with its name on the top. The name is singular (entity)
rather than plural (entities). Entity name can be upper case (ENTITY) or lower case
(entity).
29
HOW TO FIND ENTITIES
Entity—a person, place, object, or event about which you can store
information (e.g. supplier, machine tool, employee, utility pole, airline
seat, etc.).
­ Tangible: CUSTOMER, PRODUCT
­ Intangible: ORDER, ACCOUNTS RECEIVABLE
­ Look for singular nouns (beginner)
­ Some ″standards″ place entity names in UPPER CASE (not required)
­ A proper noun is not a good candidate …
30
ATTRIBUTES
Within the Entity (for example, within the student entity) are
attributes describing the student.
Crow's foot Chen style
31
ATTRIBUTES
Describe details about an
entity
Entity: Employee
Attributes:
­Employee-Name
­Address (composite)
­Phone Extension
­Date-of-Hire
­Job-Skill-Code
­Salary
32
ATTRIBUTES
• The individual bits of data that make up an
entity.
• Attributes are listed within the entity.
• If an attribute is used to identify the entity, it
is the primary key and is underlined or
preceded with an *.
• If it refers to the identifying attribute of
another entity, it is a foreign key and is
commonly italicized (not in this model).
• If you aren't actually storing an attribute, but
calculating it from other attributes, it's a
derived attribute, and has a dashed outline.
33
HOW TO FIND ATTRIBUTES
Attributes are
­ Data objects that either identify or
describe entities (property of an
entity).
­ Descriptors whose values are
associated with individual entities of a
specific entity type.
­ To identify attributes, find and extract the
names that appear to be descriptive noun
phrases.
34
TERMINOLOGY: ENTITY INSTANCE
Entity instance—a single occurrence within the entity.
­ This example contains six entity instances.
Student
ID
Last
Name
First
Name
2144 Arnold Betty
3122 Taylor John
3843 Simmons Lisa
9844 Macy Bill
2837 Leath Heather
2293 Wrench Tim
Entity:
STUDENT
instanc
e
35
TYPES OF ENTITIES
A weak entity is shown as a double rectangle in a
data model, because it doesn't have its own unique
key—it only exists in relation to the entity it belongs
to.
An associative entity (easier to see in the second type
of diagram), is shown with a dashed outline and
connector. This type of entity is needed wherever you
have many-to-many relationships. To create an
associative entity in the first style of diagram, add an
entity shape and a relationship shape, and group the
two shapes together.
36
PREVIEW: CLASSES OF ATTRIBUTES
Simple attribute
Composite attribute
Primary Key attribute
Derived attributes
Single-Valued attribute
Multi-Valued attribute
37
SIMPLE/COMPOSITE ATTRIBUTE
A simple attribute cannot be subdivided.
­ Examples: age, gender, marital status
A composite attribute can be further subdivided to yield
additional attributes.
­ Examples:
­ ADDRESS à Street, City, State, Zip
­ PHONE NUMBER à Area code, Exchange
38
IDENTIFIER (PRIMARY KEY AND
COMPOSITE IDENTIFIER)
Attributes that uniquely identify
entity instances become a
Primary Key (PK) in an RDBMS
39
DERIVED ATTRIBUTE
Not physically stored within the database
Derived by using an algorithm
­ Example 1: Late Charge of 2%
­ MS Access: InvoiceAmt * 0.02
­ Example 2: Age can be derived from the date of birth and the current date.
­ MS Access: int(Date() – Emp_Dob)/365)
40
SINGLE-VALUED ATTRIBUTE
Can have only a single (atomic) value.
­ Examples:
­ A person can have only one social security number.
­ A manufactured part can have only one serial number.
­ A single-valued attribute is not necessarily a simple attribute.
­ Part No: CA-08-02-189935
­ Location: CA, Factory#:08, shift#: 02, part#: 189935
41
MULTI-VALUED ATTRIBUTES
Can have many values.
­Examples:
­ A person may have several college degrees.
­ A household may have several phones with different
numbers.
­ A car can be one or more colors.
42
RELATIONSHIPS Relationships (relationship lines) show
how entities are related to each other.
Relationships occur between each pair of
entities.
Relationship lines are bidirectional
(operate in both directions).
Relationship connectors use Crow's foot
notation to show how many of each
entity are related to another entity.
Example (relationship between student
and enrollment)
oOne student has one or more enrollments
oOne enrollment has only one student
43
HOW TO FIND RELATIONSHIPS
o Relationships are associations between
two or more entities.
o Typically, a relationship is indicated by a
verb connecting two or more entities.
o Relationships should be classified in terms
of cardinality.
§Cardinality: one-to-one, one-to-
many, etc.
44
MORE ABOUT RELATIONSHIP
Business rule of a relationship should be bidirectional.
­A student must be enrolled in many curriculums (student to
curriculum).
­Each curriculum might be studied by many students (curriculum
to student).
45
CROW'S FOOT—1:1, OPTIONAL RELATIONSHIP
(OR) ON ONE SIDE
A person might or might not be a programmer, but a programmer
must be a person.
SUB TYPE
ProgrammerPerson 2
Crow's Foot – 1: 1 (McFarland, 2020)
46
CROW'S FOOT—1:M RELATIONSHIP
Each department hires many employees, and each
employee is hired by one department.
EMPLOYEEDEPARTMT
HIRES
IS_HIRED_BY
Crow's Foot – 1:M (McFarland, 2020)
47
CROW'S FOOT—1:M WITH OR ON
MANY SIDE
A person might be or might not be a member, but could be found multiple
times (if the member entity represents membership in multiple clubs, for
instance). A member must have only a single person.
CHILD
MEMBERPERSON
48
CROW'S FOOT: 1:M WITH OR ON
BOTH SIDE
A person might have no phone, one phone, or lots of
phones, and that phone might be unowned or can only be
owned by a person.
POSSESSION
PHONEPERSON 4
49
CROW'S FOOT—M:N RELATIONSHIP
Each student takes many classes, and a class must be
taken by many students.
Note: Many-to-many relationships cannot be allowed in the data
model because they cannot be represented by the relational
model.
STUDENTCLASS
TAKES
IS_TAKEN_BY
RECAP: UNDERSTANDING THE RDBMS
MODEL
SQL and Scripting
Training
51
REVIEW: KEY TERMS IN THE
RELATIONAL MODEL
What is a
Database?
How is a
Database
different from
a Database
Management
System?
What is a
Schema?
What is
Metadata?
52
TERMINOLOGY OF THE RDBMS
Logical Name Physical
Implementation Name
Tuple Row (or record)
Attribute Field (or column)
Entity Table
53
REVIEW—DATABASE TABLE
54
REVIEW: DATABASE—TABLES—RECORDS
Database, Tables and Records (TutorialsPoint, 2020)
55
REVIEW: PRIMARY KEY AND FOREIGN KEY
Primary key (PK)—A unique identifier for
a record. Each PK must be unique.
Foreign key (FK)—A field within a table
that is a PK in another table.
56
DATABASE SCHEMA OR ENTITY RELATIONSHIP DIAGRAM (ERD)
An Entity Relationship Diagram (ERD)
serves as a 'blueprint' for the database.
An ERD is also known as a Database
Schema.
57
DATABASE SCHEMA OR ENTITY RELATIONSHIP DIAGRAM (ERD)
What is the Primary Key for lab_orders,
patient_info, primary_care_doctors, and
hospitals?
What are the FKs in each Table?
What type of relationship notation is shown
on the ERD? (tough question)
58
ORDERS AND
SHIPPING DATABASE
ERD
Task:
Discuss PK and FK in each
Entity (Table).
Discuss Relationships that exist
between "EACH PAIR OF
ENTITIES (Tables)"
59
1:M (OR M:1) RELATIONSHIP
60
ERD AND TABLES
61
PK AND FK RELATIONSHIP
62
INTERSECTION TABLE AND COMPOSITE KEY (ERD)
A composite key is two or more
fields used to define a primary key
in a table.
63
INTERSECTION TABLE AND COMPOSITE KEY
(TABLE)
A composite key is two or more fields
used to define a primary key in a
table.
64
RDBMS
DML: Data Manipulation Language
DDL: Data Definition Language
Metadata: Data about data
Data Schema: Design of the data
(supported by an ERD)
DBMS vs. Database
65
REFERENCES
Draw.io. (2020). Diagrams.net—free flowchart maker and diagrams online. Retrieved November 23, 2020, from
https://app.diagrams.net/
SQLite Browser. (2020, November 09). DB Browser for SQLite. Retrieved November 23, 2020, from
https://sqlitebrowser.org/
SQLite. (2020). SQLite Main Website. Retrieved November 23, 2020, from https://sqlite.org/index.html
McFarland, R. (2020). Published Articles: Ron McFarland. Retrieved December 03, 2020,
from https://medium.com/@highervista
Tutorialspoint. (2020). SQLite Tutorial. Retrieved November 23, 2020, from
https://www.tutorialspoint.com/sqlite/index.htm
Watt, A. and Eng, W. (2020). Database Design, 2nd edition. Licensed under Creative Commons Attribution 4.0.
Matthew West and Julian Fowler (1999). Developing High Quality Data Models. The European Process Industries
STEP Technical Liaison Executive (EPISTLE).
66
INTRODUCTION
Ron McFarland
Technologist, Educator
Source: Microsoft Images
67
ABOUT THIS COURSE
This course is distributed free. I use several
sources. But importantly, I use the book noted
on the next slide.
If you are using these PowerPoints, please
attribute Highervista, LLC and me (Ron
McFarland). IN ADDITION, please attribute
the author noted on the next slide, as the
author’s textbook provides essential
information for this course.
Source: Microsoft Images
68
INTRODUCTION
This course is offered to you free. HOWEVER, please
purchase the following book, as it is a primary resource for
this course. I do not make any $ from this course or this
book. So, since a handful of good content is derived from the
following text, please support this author!
Title: SQL Quickstart Guide
Author: Walter Shields
Available: Amazon, B&N, and through ClydeBank media
website at:
https://www.clydebankmedia.com/books/programming-
tech/sql-quickstart-guide

More Related Content

What's hot

Summary data modelling
Summary data modellingSummary data modelling
Summary data modellingNovita Sari
 
Dbms important questions and answers
Dbms important questions and answersDbms important questions and answers
Dbms important questions and answersLakshmiSarvani6
 
Database 3 Conceptual Modeling And Er
Database 3   Conceptual Modeling And ErDatabase 3   Conceptual Modeling And Er
Database 3 Conceptual Modeling And ErAshwani Kumar Ramani
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbmsmaryeem
 
OODM-object oriented data model
OODM-object oriented data modelOODM-object oriented data model
OODM-object oriented data modelAnilPokhrel7
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbmsAnjaan Gajendra
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement systemFaisalGhffar
 
Relational Database Fundamentals
Relational Database FundamentalsRelational Database Fundamentals
Relational Database FundamentalsKHALID C
 
Relational database
Relational databaseRelational database
Relational databaseSanthiNivas
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER DiagramsAdri Jovin
 
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapOverview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapVikas Jagtap
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and modelssabah N
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Modeloudesign
 
Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...Mobarok Hossen
 

What's hot (20)

Chapter 3 Entity Relationship Model
Chapter 3 Entity Relationship ModelChapter 3 Entity Relationship Model
Chapter 3 Entity Relationship Model
 
Summary data modelling
Summary data modellingSummary data modelling
Summary data modelling
 
Dbms important questions and answers
Dbms important questions and answersDbms important questions and answers
Dbms important questions and answers
 
Database 3 Conceptual Modeling And Er
Database 3   Conceptual Modeling And ErDatabase 3   Conceptual Modeling And Er
Database 3 Conceptual Modeling And Er
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbms
 
Database Modeling
Database ModelingDatabase Modeling
Database Modeling
 
ADB introduction
ADB introductionADB introduction
ADB introduction
 
OODM-object oriented data model
OODM-object oriented data modelOODM-object oriented data model
OODM-object oriented data model
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbms
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
Relational Database Fundamentals
Relational Database FundamentalsRelational Database Fundamentals
Relational Database Fundamentals
 
Relational database
Relational databaseRelational database
Relational database
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER Diagrams
 
Fundamentals of Data Modeling and Database Design by Dr. Kamal Gulati
Fundamentals of Data Modeling and Database Design by Dr. Kamal GulatiFundamentals of Data Modeling and Database Design by Dr. Kamal Gulati
Fundamentals of Data Modeling and Database Design by Dr. Kamal Gulati
 
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapOverview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
 
Data model
Data modelData model
Data model
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and models
 
Rdbms concepts
Rdbms conceptsRdbms concepts
Rdbms concepts
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Model
 
Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...
 

Similar to Sq lite module3

Similar to Sq lite module3 (20)

Db lec 02_new
Db lec 02_newDb lec 02_new
Db lec 02_new
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Database Management System
Database Management System Database Management System
Database Management System
 
8.pptx
8.pptx8.pptx
8.pptx
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide share
 
ER Modeling.ppt
ER Modeling.pptER Modeling.ppt
ER Modeling.ppt
 
Dbms
DbmsDbms
Dbms
 
Unit 2 DBMS
Unit 2 DBMSUnit 2 DBMS
Unit 2 DBMS
 
Conceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-modelsConceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-models
 
ERmodel (2).pdf
ERmodel (2).pdfERmodel (2).pdf
ERmodel (2).pdf
 
Chap08
Chap08Chap08
Chap08
 
Chapter2
Chapter2Chapter2
Chapter2
 
Db lec 01
Db lec 01Db lec 01
Db lec 01
 
Data Modeling PPT
Data Modeling PPTData Modeling PPT
Data Modeling PPT
 
02er
02er02er
02er
 
RDBMS.ppt What is RDBMS RDBMS stands for Relational Database Management System.
RDBMS.ppt What is RDBMS RDBMS stands for Relational Database Management System.RDBMS.ppt What is RDBMS RDBMS stands for Relational Database Management System.
RDBMS.ppt What is RDBMS RDBMS stands for Relational Database Management System.
 
Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdf
 
SW SEC 1.pptx
SW SEC 1.pptxSW SEC 1.pptx
SW SEC 1.pptx
 
Dbms ii mca-ch3-er-model-2013
Dbms ii mca-ch3-er-model-2013Dbms ii mca-ch3-er-model-2013
Dbms ii mca-ch3-er-model-2013
 

More from Highervista

Cyber security training using virtual labs 3 cs umuc presentation august 2018
Cyber security training using virtual labs 3 cs umuc presentation august 2018Cyber security training using virtual labs 3 cs umuc presentation august 2018
Cyber security training using virtual labs 3 cs umuc presentation august 2018Highervista
 
Cyber security for manufacturers umuc cadf-ron mcfarland
Cyber security for manufacturers umuc cadf-ron mcfarlandCyber security for manufacturers umuc cadf-ron mcfarland
Cyber security for manufacturers umuc cadf-ron mcfarlandHighervista
 
Intro infosec version 2
Intro infosec version 2Intro infosec version 2
Intro infosec version 2Highervista
 
How to create a maker space v2 ebook
How to create a maker space v2 ebookHow to create a maker space v2 ebook
How to create a maker space v2 ebookHighervista
 
Love and silence v3 scribd slide share
Love and silence v3 scribd slide shareLove and silence v3 scribd slide share
Love and silence v3 scribd slide shareHighervista
 

More from Highervista (9)

Sq lite module5
Sq lite module5Sq lite module5
Sq lite module5
 
Sq lite module6
Sq lite module6Sq lite module6
Sq lite module6
 
Sq lite module7
Sq lite module7Sq lite module7
Sq lite module7
 
Sq lite module8
Sq lite module8Sq lite module8
Sq lite module8
 
Cyber security training using virtual labs 3 cs umuc presentation august 2018
Cyber security training using virtual labs 3 cs umuc presentation august 2018Cyber security training using virtual labs 3 cs umuc presentation august 2018
Cyber security training using virtual labs 3 cs umuc presentation august 2018
 
Cyber security for manufacturers umuc cadf-ron mcfarland
Cyber security for manufacturers umuc cadf-ron mcfarlandCyber security for manufacturers umuc cadf-ron mcfarland
Cyber security for manufacturers umuc cadf-ron mcfarland
 
Intro infosec version 2
Intro infosec version 2Intro infosec version 2
Intro infosec version 2
 
How to create a maker space v2 ebook
How to create a maker space v2 ebookHow to create a maker space v2 ebook
How to create a maker space v2 ebook
 
Love and silence v3 scribd slide share
Love and silence v3 scribd slide shareLove and silence v3 scribd slide share
Love and silence v3 scribd slide share
 

Recently uploaded

OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorShane Coughlan
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfBrain Inventory
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?AmeliaSmith90
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxAutus Cyber Tech
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesShyamsundar Das
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdfMeon Technology
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionsNirav Modi
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptkinjal48
 

Recently uploaded (20)

OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS Calculator
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdf
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptx
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security Challenges
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Salesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptxSalesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptx
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdf
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspections
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.ppt
 

Sq lite module3

  • 1. MODULE 3: THE RDBMS AND THE RELATIONAL MODEL SQL and Scripting Training (C) 2020-2021 Highervista, LLC 1
  • 2. 2 TOPICS RDBMS Concept Preview Understanding the RDBMS Model Data Modeling Concepts: Part 1 A Primer to Relational Algebra Recap: Understanding the RDBMS Model Types of Data
  • 4. UNDERSTANDING THE RDBMS MODEL SQL and Scripting Training
  • 5. 5 CHARACTERISTICS OF A RELATIONAL TABLE Characteristics of a Relational Table (TutorialsPoint, 2020)
  • 6. 6 KEYS Consist of one or more attributes that determine other attributes Used to ­ Ensure that each row in a table is uniquely identifiable ­ Establish relationships among tables and ensure data integrity Primary key (PK)—Attribute or combination of attributes that uniquely identifies a row Source: Microsoft Images
  • 7. 7 RELATIONAL DATABASE KEYS Relational Database Keys (TutorialsPoint, 2020)
  • 8. 8 EXAMPLE OF A SIMPLE RELATIONAL DATABASE Example of a Simple Relational Database (TutorialsPoint, 2020)
  • 10. 10 INTEGRITY RULES: AN EXAMPLE Integrity Rules: An Example (TutorialsPoint, 2020)
  • 11. 11 WAYS TO HANDLE NULLS NOT NULL constraint—Placed on a column to ensure that every row in the table has a value for that column UNIQUE constraint—Restriction placed on a column to ensure that no duplicate values exist for that column Is a field NOT NULL or UNIQUE in your database model? Be sure to indicate this in your Data Dictionary.
  • 12. DATA MODELING CONCEPTS SQL and Scripting Training
  • 13. 13 DATA MODELING OBJECTIVES Understand concepts of data modeling and its purpose Learn how relationships between entities are defined and refined, and how they are incorporated into the database design process Learn how ERD components affect database design and implementation Learn how to interpret the modeling symbols
  • 14. 14 IMPORTANCE OF DATA MODEL Blueprint—official documentation ­ blueprint of house Employees w/o DB knowledge can understand ­ a data model diagram vs. a list of tables ­ an effective communication tool ­ improves interaction among managers, designers, and end users Independence from a particular DBMS ­ network DB, object-oriented DB, etc.
  • 15. 15 DATA MODEL Model—an abstraction of a real-world object or event ­ useful in understanding complexities of the real-world environment Data model ­ a diagram that displays a set of tables and the relationships between them ­ a foundation ­ next slides: Draw.io Entity Relationship Diagram (ERD) examples West and Fowler (1999)
  • 16. 16 ENTITY RELATIONSHIP DIAGRAM (ERD) PROCEDURE Relatively simple representations of complex real-world data structures Data modeling is an iterative process. A "complete" and "100% error free" data model is impossible! An "optimized" data model is possible …
  • 17. 17 ERD STYLES Active link to diagram Chen ERD Style Notation
  • 18. 18 ERD STYLES Active link to diagram Crow’s Foot ERD Notation Style
  • 19. 19 WHAT IS AN ERD? ERD is a data modeling technique used in software engineering to produce a conceptual data model of an information system. ERDs illustrate the logical structure of databases. ERDs represent 'business' or 'use' cases
  • 20. 20 EXAMPLE DATA MODEL— ERD (CROW’S FOOT NOTATION)
  • 21. 21 DATA MODEL—ERD The data modeling revolves around discovering and analyzing organizational and user's data requirements (use cases). Requirements based on policies, meetings, procedures, system specifications, etc. • Identify what data is important • Identify what data should be maintained
  • 22. 22 DATA MODEL— ERD The major activity of this phase is identifying entities, attributes, and their relationships to construct model using the Entity Relationship Diagram. "Logical" (or design) names include: Entity/Attribute/Relationship "Physical" implementation names include: Table, Column, Line Entity à table Attribute à column Relationship à line
  • 23. 23 ERD NOTATION Digging into the three components in ERDs ­ Entity ­ Attributes ­ Relationships
  • 24. 24 ENTITY An Entity is a collection of data, using a rectangle with attributes listed inside the entity ‘box.' For example, an entity STUDENT could include the attributes StudentID, Name, Registered, Region, etc. A second entity following this example would be COURSE, which would include the attributes Title, Credit, Quota.
  • 25. 25 VIDEO: BASICS OF DATA MODELING
  • 26. 26 ENTITY RELATIONSHIP NOTATION Digging into the three components in ERDs ­ Entity ­ Attributes ­ Relationships
  • 27. 27 ENTITY An entity is a collection of data, using a rectangle with attributes listed inside the entity "box." For example, STUDENT could include the attributes student_id, student_name, student_address, etc. A second entity following this example would be COURSE, which would include the attributes course_name, course_number, etc.
  • 28. 28 CROW'S FOOT NOTATION FOR ENTITY Entity: ­ Represented by a rectangle, with its name on the top. The name is singular (entity) rather than plural (entities). Entity name can be upper case (ENTITY) or lower case (entity).
  • 29. 29 HOW TO FIND ENTITIES Entity—a person, place, object, or event about which you can store information (e.g. supplier, machine tool, employee, utility pole, airline seat, etc.). ­ Tangible: CUSTOMER, PRODUCT ­ Intangible: ORDER, ACCOUNTS RECEIVABLE ­ Look for singular nouns (beginner) ­ Some ″standards″ place entity names in UPPER CASE (not required) ­ A proper noun is not a good candidate …
  • 30. 30 ATTRIBUTES Within the Entity (for example, within the student entity) are attributes describing the student. Crow's foot Chen style
  • 31. 31 ATTRIBUTES Describe details about an entity Entity: Employee Attributes: ­Employee-Name ­Address (composite) ­Phone Extension ­Date-of-Hire ­Job-Skill-Code ­Salary
  • 32. 32 ATTRIBUTES • The individual bits of data that make up an entity. • Attributes are listed within the entity. • If an attribute is used to identify the entity, it is the primary key and is underlined or preceded with an *. • If it refers to the identifying attribute of another entity, it is a foreign key and is commonly italicized (not in this model). • If you aren't actually storing an attribute, but calculating it from other attributes, it's a derived attribute, and has a dashed outline.
  • 33. 33 HOW TO FIND ATTRIBUTES Attributes are ­ Data objects that either identify or describe entities (property of an entity). ­ Descriptors whose values are associated with individual entities of a specific entity type. ­ To identify attributes, find and extract the names that appear to be descriptive noun phrases.
  • 34. 34 TERMINOLOGY: ENTITY INSTANCE Entity instance—a single occurrence within the entity. ­ This example contains six entity instances. Student ID Last Name First Name 2144 Arnold Betty 3122 Taylor John 3843 Simmons Lisa 9844 Macy Bill 2837 Leath Heather 2293 Wrench Tim Entity: STUDENT instanc e
  • 35. 35 TYPES OF ENTITIES A weak entity is shown as a double rectangle in a data model, because it doesn't have its own unique key—it only exists in relation to the entity it belongs to. An associative entity (easier to see in the second type of diagram), is shown with a dashed outline and connector. This type of entity is needed wherever you have many-to-many relationships. To create an associative entity in the first style of diagram, add an entity shape and a relationship shape, and group the two shapes together.
  • 36. 36 PREVIEW: CLASSES OF ATTRIBUTES Simple attribute Composite attribute Primary Key attribute Derived attributes Single-Valued attribute Multi-Valued attribute
  • 37. 37 SIMPLE/COMPOSITE ATTRIBUTE A simple attribute cannot be subdivided. ­ Examples: age, gender, marital status A composite attribute can be further subdivided to yield additional attributes. ­ Examples: ­ ADDRESS à Street, City, State, Zip ­ PHONE NUMBER à Area code, Exchange
  • 38. 38 IDENTIFIER (PRIMARY KEY AND COMPOSITE IDENTIFIER) Attributes that uniquely identify entity instances become a Primary Key (PK) in an RDBMS
  • 39. 39 DERIVED ATTRIBUTE Not physically stored within the database Derived by using an algorithm ­ Example 1: Late Charge of 2% ­ MS Access: InvoiceAmt * 0.02 ­ Example 2: Age can be derived from the date of birth and the current date. ­ MS Access: int(Date() – Emp_Dob)/365)
  • 40. 40 SINGLE-VALUED ATTRIBUTE Can have only a single (atomic) value. ­ Examples: ­ A person can have only one social security number. ­ A manufactured part can have only one serial number. ­ A single-valued attribute is not necessarily a simple attribute. ­ Part No: CA-08-02-189935 ­ Location: CA, Factory#:08, shift#: 02, part#: 189935
  • 41. 41 MULTI-VALUED ATTRIBUTES Can have many values. ­Examples: ­ A person may have several college degrees. ­ A household may have several phones with different numbers. ­ A car can be one or more colors.
  • 42. 42 RELATIONSHIPS Relationships (relationship lines) show how entities are related to each other. Relationships occur between each pair of entities. Relationship lines are bidirectional (operate in both directions). Relationship connectors use Crow's foot notation to show how many of each entity are related to another entity. Example (relationship between student and enrollment) oOne student has one or more enrollments oOne enrollment has only one student
  • 43. 43 HOW TO FIND RELATIONSHIPS o Relationships are associations between two or more entities. o Typically, a relationship is indicated by a verb connecting two or more entities. o Relationships should be classified in terms of cardinality. §Cardinality: one-to-one, one-to- many, etc.
  • 44. 44 MORE ABOUT RELATIONSHIP Business rule of a relationship should be bidirectional. ­A student must be enrolled in many curriculums (student to curriculum). ­Each curriculum might be studied by many students (curriculum to student).
  • 45. 45 CROW'S FOOT—1:1, OPTIONAL RELATIONSHIP (OR) ON ONE SIDE A person might or might not be a programmer, but a programmer must be a person. SUB TYPE ProgrammerPerson 2 Crow's Foot – 1: 1 (McFarland, 2020)
  • 46. 46 CROW'S FOOT—1:M RELATIONSHIP Each department hires many employees, and each employee is hired by one department. EMPLOYEEDEPARTMT HIRES IS_HIRED_BY Crow's Foot – 1:M (McFarland, 2020)
  • 47. 47 CROW'S FOOT—1:M WITH OR ON MANY SIDE A person might be or might not be a member, but could be found multiple times (if the member entity represents membership in multiple clubs, for instance). A member must have only a single person. CHILD MEMBERPERSON
  • 48. 48 CROW'S FOOT: 1:M WITH OR ON BOTH SIDE A person might have no phone, one phone, or lots of phones, and that phone might be unowned or can only be owned by a person. POSSESSION PHONEPERSON 4
  • 49. 49 CROW'S FOOT—M:N RELATIONSHIP Each student takes many classes, and a class must be taken by many students. Note: Many-to-many relationships cannot be allowed in the data model because they cannot be represented by the relational model. STUDENTCLASS TAKES IS_TAKEN_BY
  • 50. RECAP: UNDERSTANDING THE RDBMS MODEL SQL and Scripting Training
  • 51. 51 REVIEW: KEY TERMS IN THE RELATIONAL MODEL What is a Database? How is a Database different from a Database Management System? What is a Schema? What is Metadata?
  • 52. 52 TERMINOLOGY OF THE RDBMS Logical Name Physical Implementation Name Tuple Row (or record) Attribute Field (or column) Entity Table
  • 54. 54 REVIEW: DATABASE—TABLES—RECORDS Database, Tables and Records (TutorialsPoint, 2020)
  • 55. 55 REVIEW: PRIMARY KEY AND FOREIGN KEY Primary key (PK)—A unique identifier for a record. Each PK must be unique. Foreign key (FK)—A field within a table that is a PK in another table.
  • 56. 56 DATABASE SCHEMA OR ENTITY RELATIONSHIP DIAGRAM (ERD) An Entity Relationship Diagram (ERD) serves as a 'blueprint' for the database. An ERD is also known as a Database Schema.
  • 57. 57 DATABASE SCHEMA OR ENTITY RELATIONSHIP DIAGRAM (ERD) What is the Primary Key for lab_orders, patient_info, primary_care_doctors, and hospitals? What are the FKs in each Table? What type of relationship notation is shown on the ERD? (tough question)
  • 58. 58 ORDERS AND SHIPPING DATABASE ERD Task: Discuss PK and FK in each Entity (Table). Discuss Relationships that exist between "EACH PAIR OF ENTITIES (Tables)"
  • 59. 59 1:M (OR M:1) RELATIONSHIP
  • 61. 61 PK AND FK RELATIONSHIP
  • 62. 62 INTERSECTION TABLE AND COMPOSITE KEY (ERD) A composite key is two or more fields used to define a primary key in a table.
  • 63. 63 INTERSECTION TABLE AND COMPOSITE KEY (TABLE) A composite key is two or more fields used to define a primary key in a table.
  • 64. 64 RDBMS DML: Data Manipulation Language DDL: Data Definition Language Metadata: Data about data Data Schema: Design of the data (supported by an ERD) DBMS vs. Database
  • 65. 65 REFERENCES Draw.io. (2020). Diagrams.net—free flowchart maker and diagrams online. Retrieved November 23, 2020, from https://app.diagrams.net/ SQLite Browser. (2020, November 09). DB Browser for SQLite. Retrieved November 23, 2020, from https://sqlitebrowser.org/ SQLite. (2020). SQLite Main Website. Retrieved November 23, 2020, from https://sqlite.org/index.html McFarland, R. (2020). Published Articles: Ron McFarland. Retrieved December 03, 2020, from https://medium.com/@highervista Tutorialspoint. (2020). SQLite Tutorial. Retrieved November 23, 2020, from https://www.tutorialspoint.com/sqlite/index.htm Watt, A. and Eng, W. (2020). Database Design, 2nd edition. Licensed under Creative Commons Attribution 4.0. Matthew West and Julian Fowler (1999). Developing High Quality Data Models. The European Process Industries STEP Technical Liaison Executive (EPISTLE).
  • 67. 67 ABOUT THIS COURSE This course is distributed free. I use several sources. But importantly, I use the book noted on the next slide. If you are using these PowerPoints, please attribute Highervista, LLC and me (Ron McFarland). IN ADDITION, please attribute the author noted on the next slide, as the author’s textbook provides essential information for this course. Source: Microsoft Images
  • 68. 68 INTRODUCTION This course is offered to you free. HOWEVER, please purchase the following book, as it is a primary resource for this course. I do not make any $ from this course or this book. So, since a handful of good content is derived from the following text, please support this author! Title: SQL Quickstart Guide Author: Walter Shields Available: Amazon, B&N, and through ClydeBank media website at: https://www.clydebankmedia.com/books/programming- tech/sql-quickstart-guide