SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à Physical elements of data

Similaire à 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
 

Plus de Dimara Hakim

Plus 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
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 

Dernier (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

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.