SlideShare a Scribd company logo
1 of 25
Er. Nawaraj Bhandari
Topic 11
Implementation
Types of Constraints
 Referential Integrity Constraints
 Propagation Constraints
 Domain Constraints
 Table Constraints

 Plus...
 Constraint Violation
Referential Integrity Constraint
Create table workers
(emp_no number(5) not null,
first_name varchar(30),
last_name varchar(30),
job_title varchar(30),
age number(3),
dept_no number(5),
primary key emp_no,
foreign key (dept_no) references
Propagation Constraint
 What happens if we delete a Boat from our Boat Hire database?
 There are lots of Rental records that reference it. What happens to
them?
Table with Propagation Constraint
Create Table Rental
(BoatID number NOT NULL,
CustomerID number NOT NULL,
RentalStartDate date NOT NULL,
RentalEndDate date NOT NULL,
Primary Key (BoatID, CustomerID, RentalStartDate)
Foreign Key (CustomerID) REFERENCES Customer(CustomerID),
Foreign Key (BoatID) REFERENCES Boat (BoatID)
On delete no action
On update cascade);
Options for Propagation
 No action
 Cascade
 Set Default
 Set Null
Domain Constraints
 Boat Type could be enforced as...
 a check constraint
 separate domain using Create Domain statement
 as a foreign key to another table
Check Constraint
Create Table Boat
(BoatID number NOT NULL,
BoatName varchar (30) NOT NULL,
BoatType varchar (20),
Primary Key (BoatID)
Check (BoatType in ‘Yacht’,’Cruiser’,’Rower’));
As a Separate Domain
 Create Domain BoatType As varchar(20)
 Default ‘Yacht’
 Check (Value in (‘Yacht’,’Cruiser’,’Rower’));
 The table’Boat’ will set the BoatType attribute as this domain
BoatType.
As a Separate Table
Create Table BoatType
(BoatTypeCode Varchar(3),
BoatTypeDescription Varchar(20)
Primary Key (BoatTypeCode));
With the corresponding Foreign Key in Boat
Create Table Boat
(BoatID number NOT NULL,
BoatName varchar (30) NOT NULL,
BoatTypeCode varchar (3),
Primary Key (BoatID)
Foreign Key (BoatTypeCode) References BoatType;
Table Constraints
Create Table Rental
(BoatID number NOT NULL,
CustomerID number NOT NULL,
RentalStartDate date NOT NULL,
RentalEndDate date NOT NULL
Constraint MaximumRentals
Check(Not Exists(Select BoatID
From Rentals
Group By BoatID
Having Count(*) >10)),
Primary Key (BoatID, CustomerID, RentalStartDate)
Foreign Key (CustomerID) REFERENCES Customer(Custo
Foreign Key (BoatID) REFERENCES Boat (BoatID)
On delete no action
On update cascade);
This constraint is checked if there is any
modification to a row, regardless the value of the
column changed or not.
In column constraint the condition is checked
when the value of the column changed.
Eg Domain Constraints
Inserting Data
 The basic SQL feature for inserting multiple rows:
 INSERT INTO ''TABLE'' (''column-name'', [''column-name', ...])
 VALUES (''1st row value a'',"1st row value b"),
 (''2nd row value a', "2nd row value b"),
 ...
 Example
 Insert into boats (boatID, boatName)
 Values (1,'Esmerelda'),
 (2,'Missy'),
 (3,'Lord George');
Data Loading Tools
 Bulk insert in SQL server
 http://sqlserver2000.databases.aspfaq.com/how-do-i-load-
text-or-csv-file-data-into-sql-server.html
 Oracle SQL loader
 http://oreilly.com/catalog/orsqlloader/chapter/ch01.html
 My-SQL uses something called 'Bulk Insert'
 http://mysql.bigresource.com/Bulk-insert-from-text-files-
dDPRzHYo.html#2t6P0D5I
Server
Database
Network
Internet
Server
Applications
Other systems
http://192.168.2.223:5560/isqlplus
Oracle
 For many years, Oracle was the largest market share AND largest by value.
 It was challenged recently by MySQL.
Support for Languages
 Java Programming – allowing sophisticated manipulation
of data using the logic of a programming language
 XML – allowing development of own tags so capable of
transmitting data in almost any format
Support for...
 Distributed database features
 Advanced security
 Data warehousing
 Internet ready features
Objects
 Tables, indexes, views, domains...
 More complex objects with internal structure
 PL/SQL
 Stored functions
 Stored procedures
 Triggers
Oracle Architecture
 Database
 Database Instance
 Logical and Physical structure
Logical Structure of Oracle
 Tables spaces – logical storage units that contain the other objects,
which have memory divided into blocks, extents, and segments.
 Database schemas contain or own the objects like tables.
 Definition of users
Physical Structure of Oracle
 Datafiles
Database datafiles are physical files stored on disk. These files are used to store data on disk.
Database datafiles are only written to by the DBWR processes
 Redo logs
Like a tape recorder that records every change in the Oracle database. As changes occur, they
are regularly recorded in the online redo logs, just like you might record a movie on your VCR.
 Control files
The Control File of the database is a binary file that contains a great deal of database
information. The control file contains the database name, data about the database log files.
Oracle cannot function without valid control files.
Oracle Instance
 Contains all the processes and memory areas.
 A database instance is a set of memory structures that manage database files
 The instance manages its associated data and serves the users of the database.
 Also contains...
Oracle Instance
- System Global Area: When an instance is started, Oracle Database allocates a
memory area called the SGA.
- Program Global Area: A PGA is a memory region that contains data and control
information for a server process. It is no shared memory created by Oracle
Database when a server process is started
- User Processes: User roles and user management
References
 Benyon-Davis, P. (2003). Database Systems, 3rd edition. Palgrave Macmillan.
Chapter 12.
 Connolly, T. & Begg, C. (2004). Database Systems: A Practical Approach to
Design, Implementation, and Management, 4th Edition. Addison Wesley.
Chapters 8 & 17.
ANY QUESTIONS?

More Related Content

What's hot (19)

Sql server T-sql basics ppt-3
Sql server T-sql basics  ppt-3Sql server T-sql basics  ppt-3
Sql server T-sql basics ppt-3
 
12 SQL
12 SQL12 SQL
12 SQL
 
DBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCLDBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCL
 
Sql 2009
Sql 2009Sql 2009
Sql 2009
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introduction
 
Introduction to mysql part 1
Introduction to mysql part 1Introduction to mysql part 1
Introduction to mysql part 1
 
Sql Basics And Advanced
Sql Basics And AdvancedSql Basics And Advanced
Sql Basics And Advanced
 
SQL for interview
SQL for interviewSQL for interview
SQL for interview
 
Data concepts
Data conceptsData concepts
Data concepts
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
Sql - Structured Query Language
Sql - Structured Query LanguageSql - Structured Query Language
Sql - Structured Query Language
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
Sql commands
Sql commandsSql commands
Sql commands
 
Types of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiTypes of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligeti
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
SQL
SQL SQL
SQL
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
Sql basics
Sql basicsSql basics
Sql basics
 
Intro to T-SQL - 1st session
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st session
 

Similar to Database Architecture

MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 CourseMarcus Davage
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Servicesukdpe
 
Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02Lalit009kumar
 
扩展世界上最大的图片Blog社区
扩展世界上最大的图片Blog社区扩展世界上最大的图片Blog社区
扩展世界上最大的图片Blog社区yiditushe
 
Fotolog: Scaling the World's Largest Photo Blogging Community
Fotolog: Scaling the World's Largest Photo Blogging CommunityFotolog: Scaling the World's Largest Photo Blogging Community
Fotolog: Scaling the World's Largest Photo Blogging Communityfarhan "Frank"​ mashraqi
 
Homework help on oracle
Homework help on oracleHomework help on oracle
Homework help on oracleSteve Nash
 
Roles y Responsabilidades en SQL Azure
Roles y Responsabilidades en SQL AzureRoles y Responsabilidades en SQL Azure
Roles y Responsabilidades en SQL AzureEduardo Castro
 
How to Handle NoSQL with a Relational Database
How to Handle NoSQL with a Relational DatabaseHow to Handle NoSQL with a Relational Database
How to Handle NoSQL with a Relational DatabaseDATAVERSITY
 
IFESFinal58
IFESFinal58IFESFinal58
IFESFinal58anish h
 
Orcale dba training
Orcale dba trainingOrcale dba training
Orcale dba trainingUgs8008
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabadunited global soft
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadUgs8008
 
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdf
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdfDBMS LAB FILE1 task 1 , task 2, task3 and many more.pdf
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdfAbhishekKumarPandit5
 
MongoDB Knowledge share
MongoDB Knowledge shareMongoDB Knowledge share
MongoDB Knowledge shareMr Kyaing
 

Similar to Database Architecture (20)

Implementation
ImplementationImplementation
Implementation
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 Course
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Services
 
Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02
 
User Group3009
User Group3009User Group3009
User Group3009
 
扩展世界上最大的图片Blog社区
扩展世界上最大的图片Blog社区扩展世界上最大的图片Blog社区
扩展世界上最大的图片Blog社区
 
Fotolog: Scaling the World's Largest Photo Blogging Community
Fotolog: Scaling the World's Largest Photo Blogging CommunityFotolog: Scaling the World's Largest Photo Blogging Community
Fotolog: Scaling the World's Largest Photo Blogging Community
 
Homework help on oracle
Homework help on oracleHomework help on oracle
Homework help on oracle
 
Roles y Responsabilidades en SQL Azure
Roles y Responsabilidades en SQL AzureRoles y Responsabilidades en SQL Azure
Roles y Responsabilidades en SQL Azure
 
ch4
ch4ch4
ch4
 
How to Handle NoSQL with a Relational Database
How to Handle NoSQL with a Relational DatabaseHow to Handle NoSQL with a Relational Database
How to Handle NoSQL with a Relational Database
 
Module02
Module02Module02
Module02
 
IFESFinal58
IFESFinal58IFESFinal58
IFESFinal58
 
Triggers and Stored Procedures
Triggers and Stored ProceduresTriggers and Stored Procedures
Triggers and Stored Procedures
 
Orcale dba training
Orcale dba trainingOrcale dba training
Orcale dba training
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabad
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabad
 
ora_sothea
ora_sotheaora_sothea
ora_sothea
 
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdf
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdfDBMS LAB FILE1 task 1 , task 2, task3 and many more.pdf
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdf
 
MongoDB Knowledge share
MongoDB Knowledge shareMongoDB Knowledge share
MongoDB Knowledge share
 

More from Er. Nawaraj Bhandari

Data mining approaches and methods
Data mining approaches and methodsData mining approaches and methods
Data mining approaches and methodsEr. Nawaraj Bhandari
 
Research trends in data warehousing and data mining
Research trends in data warehousing and data miningResearch trends in data warehousing and data mining
Research trends in data warehousing and data miningEr. Nawaraj Bhandari
 
Mining Association Rules in Large Database
Mining Association Rules in Large DatabaseMining Association Rules in Large Database
Mining Association Rules in Large DatabaseEr. Nawaraj Bhandari
 
Introduction to data mining and data warehousing
Introduction to data mining and data warehousingIntroduction to data mining and data warehousing
Introduction to data mining and data warehousingEr. Nawaraj Bhandari
 
Classification and prediction in data mining
Classification and prediction in data miningClassification and prediction in data mining
Classification and prediction in data miningEr. Nawaraj Bhandari
 
Chapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean FunctionChapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean FunctionEr. Nawaraj Bhandari
 
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIEr. Nawaraj Bhandari
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesEr. Nawaraj Bhandari
 
Introduction to Electronic Commerce
Introduction to Electronic CommerceIntroduction to Electronic Commerce
Introduction to Electronic CommerceEr. Nawaraj Bhandari
 
Using macros in microsoft excel part 2
Using macros in microsoft excel   part 2Using macros in microsoft excel   part 2
Using macros in microsoft excel part 2Er. Nawaraj Bhandari
 
Using macros in microsoft excel part 1
Using macros in microsoft excel   part 1Using macros in microsoft excel   part 1
Using macros in microsoft excel part 1Er. Nawaraj Bhandari
 

More from Er. Nawaraj Bhandari (20)

Data mining approaches and methods
Data mining approaches and methodsData mining approaches and methods
Data mining approaches and methods
 
Research trends in data warehousing and data mining
Research trends in data warehousing and data miningResearch trends in data warehousing and data mining
Research trends in data warehousing and data mining
 
Mining Association Rules in Large Database
Mining Association Rules in Large DatabaseMining Association Rules in Large Database
Mining Association Rules in Large Database
 
Introduction to data mining and data warehousing
Introduction to data mining and data warehousingIntroduction to data mining and data warehousing
Introduction to data mining and data warehousing
 
Data warehouse testing
Data warehouse testingData warehouse testing
Data warehouse testing
 
Data warehouse physical design
Data warehouse physical designData warehouse physical design
Data warehouse physical design
 
Data warehouse logical design
Data warehouse logical designData warehouse logical design
Data warehouse logical design
 
Classification and prediction in data mining
Classification and prediction in data miningClassification and prediction in data mining
Classification and prediction in data mining
 
Chapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean FunctionChapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean Function
 
Chapter 6: Sequential Logic
Chapter 6: Sequential LogicChapter 6: Sequential Logic
Chapter 6: Sequential Logic
 
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSI
 
Chapter 4: Combinational Logic
Chapter 4: Combinational LogicChapter 4: Combinational Logic
Chapter 4: Combinational Logic
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
 
Introduction to Electronic Commerce
Introduction to Electronic CommerceIntroduction to Electronic Commerce
Introduction to Electronic Commerce
 
Evaluating software development
Evaluating software developmentEvaluating software development
Evaluating software development
 
Using macros in microsoft excel part 2
Using macros in microsoft excel   part 2Using macros in microsoft excel   part 2
Using macros in microsoft excel part 2
 
Using macros in microsoft excel part 1
Using macros in microsoft excel   part 1Using macros in microsoft excel   part 1
Using macros in microsoft excel part 1
 
Using macros in microsoft access
Using macros in microsoft accessUsing macros in microsoft access
Using macros in microsoft access
 
Testing software development
Testing software developmentTesting software development
Testing software development
 

Recently uploaded

Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad EscortsCall girls in Ahmedabad High profile
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 

Recently uploaded (20)

Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 

Database Architecture

  • 1. Er. Nawaraj Bhandari Topic 11 Implementation
  • 2. Types of Constraints  Referential Integrity Constraints  Propagation Constraints  Domain Constraints  Table Constraints   Plus...  Constraint Violation
  • 3. Referential Integrity Constraint Create table workers (emp_no number(5) not null, first_name varchar(30), last_name varchar(30), job_title varchar(30), age number(3), dept_no number(5), primary key emp_no, foreign key (dept_no) references
  • 4. Propagation Constraint  What happens if we delete a Boat from our Boat Hire database?  There are lots of Rental records that reference it. What happens to them?
  • 5. Table with Propagation Constraint Create Table Rental (BoatID number NOT NULL, CustomerID number NOT NULL, RentalStartDate date NOT NULL, RentalEndDate date NOT NULL, Primary Key (BoatID, CustomerID, RentalStartDate) Foreign Key (CustomerID) REFERENCES Customer(CustomerID), Foreign Key (BoatID) REFERENCES Boat (BoatID) On delete no action On update cascade);
  • 6. Options for Propagation  No action  Cascade  Set Default  Set Null
  • 7. Domain Constraints  Boat Type could be enforced as...  a check constraint  separate domain using Create Domain statement  as a foreign key to another table
  • 8. Check Constraint Create Table Boat (BoatID number NOT NULL, BoatName varchar (30) NOT NULL, BoatType varchar (20), Primary Key (BoatID) Check (BoatType in ‘Yacht’,’Cruiser’,’Rower’));
  • 9. As a Separate Domain  Create Domain BoatType As varchar(20)  Default ‘Yacht’  Check (Value in (‘Yacht’,’Cruiser’,’Rower’));  The table’Boat’ will set the BoatType attribute as this domain BoatType.
  • 10. As a Separate Table Create Table BoatType (BoatTypeCode Varchar(3), BoatTypeDescription Varchar(20) Primary Key (BoatTypeCode)); With the corresponding Foreign Key in Boat Create Table Boat (BoatID number NOT NULL, BoatName varchar (30) NOT NULL, BoatTypeCode varchar (3), Primary Key (BoatID) Foreign Key (BoatTypeCode) References BoatType;
  • 11. Table Constraints Create Table Rental (BoatID number NOT NULL, CustomerID number NOT NULL, RentalStartDate date NOT NULL, RentalEndDate date NOT NULL Constraint MaximumRentals Check(Not Exists(Select BoatID From Rentals Group By BoatID Having Count(*) >10)), Primary Key (BoatID, CustomerID, RentalStartDate) Foreign Key (CustomerID) REFERENCES Customer(Custo Foreign Key (BoatID) REFERENCES Boat (BoatID) On delete no action On update cascade); This constraint is checked if there is any modification to a row, regardless the value of the column changed or not. In column constraint the condition is checked when the value of the column changed. Eg Domain Constraints
  • 12. Inserting Data  The basic SQL feature for inserting multiple rows:  INSERT INTO ''TABLE'' (''column-name'', [''column-name', ...])  VALUES (''1st row value a'',"1st row value b"),  (''2nd row value a', "2nd row value b"),  ...  Example  Insert into boats (boatID, boatName)  Values (1,'Esmerelda'),  (2,'Missy'),  (3,'Lord George');
  • 13. Data Loading Tools  Bulk insert in SQL server  http://sqlserver2000.databases.aspfaq.com/how-do-i-load- text-or-csv-file-data-into-sql-server.html  Oracle SQL loader  http://oreilly.com/catalog/orsqlloader/chapter/ch01.html  My-SQL uses something called 'Bulk Insert'  http://mysql.bigresource.com/Bulk-insert-from-text-files- dDPRzHYo.html#2t6P0D5I
  • 15. Oracle  For many years, Oracle was the largest market share AND largest by value.  It was challenged recently by MySQL.
  • 16. Support for Languages  Java Programming – allowing sophisticated manipulation of data using the logic of a programming language  XML – allowing development of own tags so capable of transmitting data in almost any format
  • 17. Support for...  Distributed database features  Advanced security  Data warehousing  Internet ready features
  • 18. Objects  Tables, indexes, views, domains...  More complex objects with internal structure  PL/SQL  Stored functions  Stored procedures  Triggers
  • 19. Oracle Architecture  Database  Database Instance  Logical and Physical structure
  • 20. Logical Structure of Oracle  Tables spaces – logical storage units that contain the other objects, which have memory divided into blocks, extents, and segments.  Database schemas contain or own the objects like tables.  Definition of users
  • 21. Physical Structure of Oracle  Datafiles Database datafiles are physical files stored on disk. These files are used to store data on disk. Database datafiles are only written to by the DBWR processes  Redo logs Like a tape recorder that records every change in the Oracle database. As changes occur, they are regularly recorded in the online redo logs, just like you might record a movie on your VCR.  Control files The Control File of the database is a binary file that contains a great deal of database information. The control file contains the database name, data about the database log files. Oracle cannot function without valid control files.
  • 22. Oracle Instance  Contains all the processes and memory areas.  A database instance is a set of memory structures that manage database files  The instance manages its associated data and serves the users of the database.  Also contains...
  • 23. Oracle Instance - System Global Area: When an instance is started, Oracle Database allocates a memory area called the SGA. - Program Global Area: A PGA is a memory region that contains data and control information for a server process. It is no shared memory created by Oracle Database when a server process is started - User Processes: User roles and user management
  • 24. References  Benyon-Davis, P. (2003). Database Systems, 3rd edition. Palgrave Macmillan. Chapter 12.  Connolly, T. & Begg, C. (2004). Database Systems: A Practical Approach to Design, Implementation, and Management, 4th Edition. Addison Wesley. Chapters 8 & 17.

Editor's Notes

  1. Try to describe the client/server architecture of oracle. In the Oracle Database environment, the database application and the database are separated into a client/server architecture: The client runs the database application, for example, SQL*Plus or a Visual Basic data entry program, that accesses database information and interacts with a user. Try to follow this link as well https://www.wiziq.com/tutorial/167572-CLIENT-SERVER-ARCHITECTURE-IN-DATABASE
  2. Extensible Markup Language