SlideShare una empresa de Scribd logo
1 de 42
DARI BAB :  PHYSICAL ELEMENTS OF DATA Dimara Kusuma Hakim, ST. STRUKTUR DAN PENYIMPANAN BASISDATA
[object Object],Physical Storage
Physical Storage tables, views, and data types. ,[object Object],[object Object],[object Object],[object Object]
cont… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Views ,[object Object],[object Object],[object Object]
cont… ,[object Object],[object Object]
cont… ,[object Object]
[object Object]
several reasons to use views : ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data Types ,[object Object],[object Object],[object Object]
[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
User   -   De   fined Data Types ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],Referential Integrity
Referential Integrity ,[object Object],[object Object]
Referential Integrity  - Example ,[object Object],[object Object]
Primary Keys ,[object Object],[object Object]
Choosing PK from Candidate Keys - RULES ,[object Object],[object Object],[object Object]
Where is the Candidate Key ? ,[object Object]
Recommended for PK    SKU ,[object Object]
CREATE TABLE Products( sku  int  NOT NULL  PRIMARY KEY, modelnumber  varchar(25) NOT NULL, name  varchar(100) NOT NULL, manufacturer  varchar(25) NOT NULL, description  varchar(255) NOT NULL, warrantydetails  varchar(500) NOT NULL, price  money NOT NULL, weight  decimal(5, 2) NOT NULL, shippingweight  decimal(5, 2) NOT NULL, height  decimal(4, 2) NOT NULL, width  decimal(4, 2) NOT NULL, depth  decimal(4, 2) NOT NULL, isserialized  bit NOT NULL, status  tinyint NOT NULL )
a different column name in each table that holds the primary key ? ,[object Object]
[object Object]
Autonumber ? Identity / Sequence / etc.. ,[object Object]
GUID ? ,[object Object],[object Object]
Foreign Key ,[object Object],[object Object]
Data from the employee and vehicle tables showing the relationship between the tables
CREATE TABLE dbo.vehicle( objid int IDENTITY(1,1) NOT NULL, make varchar(50) NOT NULL, model varchar(50)NOT NULL, year char(4) NOT NULL, employee_objid int NOT NULL, CONSTRAINT PK_vehicle PRIMARY KEY (objid), CONSTRAINT FK_vehicle_employee FOREIGN KEY(employee_objid) REFERENCES employee (objid) )
what to do if an update or delete is issued on the parent  table  ? ,[object Object],[object Object],[object Object]
Another solution     CASCADE ,[object Object],[object Object]
Cascade ,[object Object],[object Object]
Constraints ,[object Object],[object Object]
Implementing Referential Integrity ,[object Object],[object Object],[object Object]
One-to-Many Relationships ,[object Object]
One-to-One Relationships ,[object Object],[object Object]
Many-to-Many Relationships ,[object Object],[object Object],[object Object]
Many-to-many relationship between a Student and a Class table
[object Object],[object Object],[object Object],Programming

Más contenido relacionado

La actualidad más candente

La actualidad más candente (18)

Sql basics
Sql basicsSql basics
Sql basics
 
SQL : introduction
SQL : introductionSQL : introduction
SQL : introduction
 
SQL for interview
SQL for interviewSQL for interview
SQL for interview
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
Lession 6.introduction to records
Lession 6.introduction to recordsLession 6.introduction to records
Lession 6.introduction to records
 
SQL_Part1
SQL_Part1SQL_Part1
SQL_Part1
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)
 
12 SQL
12 SQL12 SQL
12 SQL
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
 

Destacado

Chapter 3 data model
Chapter 3 data modelChapter 3 data model
Chapter 3 data modelUra Euro
 
Database Management System Tutorial
Database Management System TutorialDatabase Management System Tutorial
Database Management System TutorialYeonYuRae
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Userssontumax
 
Dbms tutorial
Dbms tutorialDbms tutorial
Dbms tutorialankindian
 
Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Eddyzulham Mahluzydde
 
Database system-DBMS
Database system-DBMSDatabase system-DBMS
Database system-DBMSikjsamuel
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architectureKumar
 
Architecture of-dbms-and-data-independence
Architecture of-dbms-and-data-independenceArchitecture of-dbms-and-data-independence
Architecture of-dbms-and-data-independenceAnuj Modi
 
Database Management Systems (DBMS)
Database Management Systems (DBMS)Database Management Systems (DBMS)
Database Management Systems (DBMS)Dimara Hakim
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic ConceptsTony Wong
 

Destacado (14)

Relational Model
Relational ModelRelational Model
Relational Model
 
Chapter 3 data model
Chapter 3 data modelChapter 3 data model
Chapter 3 data model
 
Database Management System Tutorial
Database Management System TutorialDatabase Management System Tutorial
Database Management System Tutorial
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Users
 
Dbms tutorial
Dbms tutorialDbms tutorial
Dbms tutorial
 
Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3
 
Database system-DBMS
Database system-DBMSDatabase system-DBMS
Database system-DBMS
 
Multimedia Database
Multimedia DatabaseMultimedia Database
Multimedia Database
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architecture
 
Architecture of-dbms-and-data-independence
Architecture of-dbms-and-data-independenceArchitecture of-dbms-and-data-independence
Architecture of-dbms-and-data-independence
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
 
Database Management Systems (DBMS)
Database Management Systems (DBMS)Database Management Systems (DBMS)
Database Management Systems (DBMS)
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
 
ER Diagram
ER DiagramER Diagram
ER Diagram
 

Similar a Physical elements of data

Similar a Physical elements of data (20)

unit 1 ppt.pptx
unit 1 ppt.pptxunit 1 ppt.pptx
unit 1 ppt.pptx
 
12 SQL
12 SQL12 SQL
12 SQL
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
05 Create and Maintain Databases and Tables.pptx
05 Create and Maintain Databases and Tables.pptx05 Create and Maintain Databases and Tables.pptx
05 Create and Maintain Databases and Tables.pptx
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developer
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
 
BIS06 Physical Database Models
BIS06 Physical Database ModelsBIS06 Physical Database Models
BIS06 Physical Database Models
 
BIS06 Physical Database Models
BIS06 Physical Database ModelsBIS06 Physical Database Models
BIS06 Physical Database Models
 
DBMS Part-3.pptx
DBMS Part-3.pptxDBMS Part-3.pptx
DBMS Part-3.pptx
 
Fg d
Fg dFg d
Fg d
 
SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdf
 
DATABASE-1.pptx
DATABASE-1.pptxDATABASE-1.pptx
DATABASE-1.pptx
 
18 database features
18 database features18 database features
18 database features
 
Module02
Module02Module02
Module02
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
01 Microsoft Access
01 Microsoft Access01 Microsoft Access
01 Microsoft Access
 
SQL cheat sheet.pdf
SQL cheat sheet.pdfSQL cheat sheet.pdf
SQL cheat sheet.pdf
 
Oracle
OracleOracle
Oracle
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
PO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - SqlPO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - Sql
 

Más de Dimara Hakim

Más de Dimara Hakim (20)

Simulasi - Pertemuan IV
Simulasi - Pertemuan IVSimulasi - Pertemuan IV
Simulasi - Pertemuan IV
 
Simulasi - Pertemuan II
Simulasi - Pertemuan IISimulasi - Pertemuan II
Simulasi - Pertemuan II
 
Simulasi - Pertemuan III
Simulasi - Pertemuan IIISimulasi - Pertemuan III
Simulasi - Pertemuan III
 
Simulasi - Pertemuan I
Simulasi - Pertemuan ISimulasi - Pertemuan I
Simulasi - Pertemuan I
 
Transaction
TransactionTransaction
Transaction
 
modul6
modul6modul6
modul6
 
JENI Slides-Intro1-Bab06-Struktur kontrol
JENI Slides-Intro1-Bab06-Struktur kontrolJENI Slides-Intro1-Bab06-Struktur kontrol
JENI Slides-Intro1-Bab06-Struktur kontrol
 
Desain Top Down
Desain Top DownDesain Top Down
Desain Top Down
 
Pemrograman Modular
Pemrograman ModularPemrograman Modular
Pemrograman Modular
 
Struktur Level Program
Struktur Level ProgramStruktur Level Program
Struktur Level Program
 
Struktur Level Data
Struktur Level DataStruktur Level Data
Struktur Level Data
 
Denormalisasi
DenormalisasiDenormalisasi
Denormalisasi
 
query optimization
query optimizationquery optimization
query optimization
 
ELS
ELSELS
ELS
 
ASC
ASCASC
ASC
 
PENDAHULUAN. SISTEM, MODEL, DAN SIMULASI
PENDAHULUAN. SISTEM, MODEL, DAN SIMULASIPENDAHULUAN. SISTEM, MODEL, DAN SIMULASI
PENDAHULUAN. SISTEM, MODEL, DAN SIMULASI
 
Tugas 1
Tugas 1Tugas 1
Tugas 1
 
Disk-based storage
Disk-based storageDisk-based storage
Disk-based storage
 
Index
IndexIndex
Index
 
Normalisasi
NormalisasiNormalisasi
Normalisasi
 

Último

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Último (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Physical elements of data

  • 1. DARI BAB : PHYSICAL ELEMENTS OF DATA Dimara Kusuma Hakim, ST. STRUKTUR DAN PENYIMPANAN BASISDATA
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. CREATE TABLE Products( sku int NOT NULL PRIMARY KEY, modelnumber varchar(25) NOT NULL, name varchar(100) NOT NULL, manufacturer varchar(25) NOT NULL, description varchar(255) NOT NULL, warrantydetails varchar(500) NOT NULL, price money NOT NULL, weight decimal(5, 2) NOT NULL, shippingweight decimal(5, 2) NOT NULL, height decimal(4, 2) NOT NULL, width decimal(4, 2) NOT NULL, depth decimal(4, 2) NOT NULL, isserialized bit NOT NULL, status tinyint NOT NULL )
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31. Data from the employee and vehicle tables showing the relationship between the tables
  • 32. CREATE TABLE dbo.vehicle( objid int IDENTITY(1,1) NOT NULL, make varchar(50) NOT NULL, model varchar(50)NOT NULL, year char(4) NOT NULL, employee_objid int NOT NULL, CONSTRAINT PK_vehicle PRIMARY KEY (objid), CONSTRAINT FK_vehicle_employee FOREIGN KEY(employee_objid) REFERENCES employee (objid) )
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. Many-to-many relationship between a Student and a Class table
  • 42.