Er. Nawaraj Bhandari
Topic 11
Implementation
Aspects of Implementation
 Creating...
 Tables
 Domains
 Indexes
 Views
Create Table
 The various ‘create table’ statements will be run as part of a script.
 Any domains referred to, if they are created as separate objects in the database,
will need to be created first.
Create Domain
 Explicitly create a domain:
 Create domain Allowable_Colours as Char
 Default ‘Red’
 Check (Value in (‘Red’,’Blue’,’Green’));
Types of Constraints
 Referential integrity
 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. Create Table Boat
(BoatID number NOT NULL,
BoatName varchar (30) NOT NULL,
BoatTypeCode BoatType,
Primary Key (BoatID));
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(CustomerID),
Foreign Key (BoatID) REFERENCES Boat (BoatID)
On delete no action
On update cascade);
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

PPTX
Supporting Transactions
PPTX
Database Architecture
PPSX
IM02: Database Language
PPTX
DBMS Notes: DDL DML DCL
PPTX
Physical Design and Development
PPT
Chapter24
PPT
Chapter16
Supporting Transactions
Database Architecture
IM02: Database Language
DBMS Notes: DDL DML DCL
Physical Design and Development
Chapter24
Chapter16

What's hot (20)

PPTX
DDL And DML
PPTX
Data Definition and Data Manipulation Language-DDL & DML
PDF
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
PDF
Discover Database
PPTX
Group Members
PDF
DDL logging Parameter in Oracle 11g & 12c
PPTX
Database Basics and MySQL
PDF
Datamigration
PPTX
Chapter 1 introduction to sql server
PPTX
intro for sql
PDF
Sql commands
PPTX
PPTX
PPTX
Sql – pocket guide
PPTX
Introduction to database & sql
PPTX
PPTX
Database basics
PDF
Discover database
PDF
Database Architecture and Basic Concepts
DDL And DML
Data Definition and Data Manipulation Language-DDL & DML
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Discover Database
Group Members
DDL logging Parameter in Oracle 11g & 12c
Database Basics and MySQL
Datamigration
Chapter 1 introduction to sql server
intro for sql
Sql commands
Sql – pocket guide
Introduction to database & sql
Database basics
Discover database
Database Architecture and Basic Concepts
Ad

Similar to Implementation (20)

PPT
扩展世界上最大的图片Blog社区
PPT
Fotolog: Scaling the World's Largest Photo Blogging Community
PPT
MDI Training DB2 Course
PDF
[db tech showcase Tokyo 2017] C23: Lessons from SQLite4 by SQLite.org - Richa...
PPT
SQL Reports in Koha
PPTX
User Group3009
PPT
Introduction to sql
PPT
Less08 Schema
PDF
Lecture05sql 110406195130-phpapp02
PPTX
Data Warehouse and Business Intelligence - Recipe 2
PDF
Introduction to Apache Tajo: Data Warehouse for Big Data
PPT
ora_sothea
PDF
Complete SQL in one video by shradha.pdf
PPT
Windows Azure and a little SQL Data Services
PDF
AWS SSA Webinar 20 - Getting Started with Data Warehouses on AWS
PDF
Practicas oracle10g
PPT
GHC Participant Training
PPTX
vFabric SQLFire Introduction
PPTX
Introduction to SQL
扩展世界上最大的图片Blog社区
Fotolog: Scaling the World's Largest Photo Blogging Community
MDI Training DB2 Course
[db tech showcase Tokyo 2017] C23: Lessons from SQLite4 by SQLite.org - Richa...
SQL Reports in Koha
User Group3009
Introduction to sql
Less08 Schema
Lecture05sql 110406195130-phpapp02
Data Warehouse and Business Intelligence - Recipe 2
Introduction to Apache Tajo: Data Warehouse for Big Data
ora_sothea
Complete SQL in one video by shradha.pdf
Windows Azure and a little SQL Data Services
AWS SSA Webinar 20 - Getting Started with Data Warehouses on AWS
Practicas oracle10g
GHC Participant Training
vFabric SQLFire Introduction
Introduction to SQL
Ad

Recently uploaded (20)

PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PPTX
20th Century Theater, Methods, History.pptx
PDF
HVAC Specification 2024 according to central public works department
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
My India Quiz Book_20210205121199924.pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
Virtual and Augmented Reality in Current Scenario
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
TNA_Presentation-1-Final(SAVE)) (1).pptx
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
LDMMIA Reiki Yoga Finals Review Spring Summer
Cambridge-Practice-Tests-for-IELTS-12.docx
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
20th Century Theater, Methods, History.pptx
HVAC Specification 2024 according to central public works department
FORM 1 BIOLOGY MIND MAPS and their schemes
My India Quiz Book_20210205121199924.pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
What if we spent less time fighting change, and more time building what’s rig...
Virtual and Augmented Reality in Current Scenario
Unit 4 Computer Architecture Multicore Processor.pptx
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
AI-driven educational solutions for real-life interventions in the Philippine...

Implementation

  • 1. Er. Nawaraj Bhandari Topic 11 Implementation
  • 2. Aspects of Implementation  Creating...  Tables  Domains  Indexes  Views
  • 3. Create Table  The various ‘create table’ statements will be run as part of a script.  Any domains referred to, if they are created as separate objects in the database, will need to be created first.
  • 4. Create Domain  Explicitly create a domain:  Create domain Allowable_Colours as Char  Default ‘Red’  Check (Value in (‘Red’,’Blue’,’Green’));
  • 5. Types of Constraints  Referential integrity  Propagation constraints  Domain constraints  Table constraints  Plus...  Constraint Violation
  • 6. 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
  • 7. 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?
  • 8. 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);
  • 9. Options for Propagation  No action  Cascade  Set Default  Set Null
  • 10. Domain Constraints  Boat Type could be enforced as...  a check constraint  separate domain using Create Domain statement  as a foreign key to another table
  • 11. 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’));
  • 12. 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. Create Table Boat (BoatID number NOT NULL, BoatName varchar (30) NOT NULL, BoatTypeCode BoatType, Primary Key (BoatID));
  • 13. 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;
  • 14. 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(CustomerID), Foreign Key (BoatID) REFERENCES Boat (BoatID) On delete no action On update cascade);
  • 15. 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');
  • 16. 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
  • 18. Oracle  For many years, Oracle was the largest market share AND largest by value.  It was challenged recently by MySQL.
  • 19. 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
  • 20. Support for...  Distributed database features  Advanced security  Data warehousing  Internet ready features
  • 21. Objects  Tables, indexes, views, domains...  More complex objects with internal structure  PL/SQL  Stored functions  Stored procedures  Triggers
  • 22. Oracle Architecture  Database  Database Instance  Logical and Physical structure
  • 23. 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
  • 24. 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.
  • 25. 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...
  • 26. 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
  • 27. 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

  • #18: 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
  • #20: Extensible Markup Language