SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
Introduction to Oracle Structured Query Language
BN1037 – Demo PPT
Demo Oracle SQL
http://www.conlinetraining.com/courses/sql-online-training/
Oracle SQL Course Details
• Basic SQL Statement
• Restricting and Sorting Data
• Single Row Functions
• Displaying Data from Multiple Tables
• Aggregating Data by Using Group Functions
• Writing Sub queries
• Sqlplus, isqlplus
• Manipulating Data
• Managing Tables, Constraints
• Views
• Other Database Objects
• Controlling User Access
• Using Set Operators
• Oracle Extensions to DML and DDL Statements
http://www.conlinetraining.com/courses/sql-online-training/
Oracle Constraints types
Constraints: -- Constraints apply specific rules to data, ensuring the data conforms
to the requirements defined. There are a number of different kinds of constraints.
There are two ways to apply constraint into Database.
1)Column level Constraint.
2)Table Level Constraint.
http://www.conlinetraining.com/courses/sql-online-training/
Types Of Constraints
• Not NULL
• Primary key
• Unique
• Foreign Key
• Check
• Let's look at each of these in a little more detail.
http://www.conlinetraining.com/courses/sql-online-training/
NOT NULL Constraints
• NOT NULL constraints are in-line constraints that indicate that a column can not contain NULL
values. For example, the PERSON_ID column is defined as NOT NULL in that example.
• If you need to add a NOT NULL constraint to a table after the fact, simply use the alter table
command as in this example:
• Syntax:-
• create table
customer
(status char(3) not null,
val number not null);
• Alter Table Table Name Modify( person_id NOT NULL);
• When copying tables, beware that NULL values many not copy properly.
http://www.conlinetraining.com/courses/sql-online-training/
Primary Key Constraints
• Primary key constraints define a column or series of columns that uniquely identify a given
row in a table. Defining a primary key on a table is optional and you can only define a single
primary key on a table. A primary key constraint can consist of one or many columns (up to 32
). Any column that is defined as a primary key column is automatically set with a NOT NULL
status.
• Syntax:-create table
customer
(status_id Number CONSTRAINT CONSTRAINT _NAME
);
• If you need to primary key constraint to a table after the fact, simply use the alter table
command.
• ALTER TABLE customer ADD CONSTRAINT pk_my_status
PRIMARY KEY (status_id);
http://www.conlinetraining.com/courses/sql-online-training/
Unique Constraints
• Unique constraints are like alternative primary key constraints.
• A unique constraint defines a column, or series of columns, that must be unique in value.
• You can have a number of unique constraints defined and the columns can have NULL values
in them, unlike a column that belongs to a primary key constraint.
• If you need to add unique key constraints to a table after the fact, simply use the alter table
command.
• ALTER TABLE
my_status
ADD CONSTRAINT
uk_my_status
UNIQUE
(status_id,
person_id);
http://www.conlinetraining.com/courses/sql-online-training/
Foreign Key Constraints
• A foreign key constraint is used to enforce a relationship between two tables. As an example, take the case of
two tables, ITEM and PART. These tables have a relationship (an item can have none, one or many parts).
Foreign key constraints help to enforce that relationship
• Well, foreign key constraints help to enforce the types of relationships between tables we have just
demonstrated. In this example we will create the ITEM and PART table. In the process of doing so, we will
create a foreign key relationship between the two:
– CREATE TABLE part
– ( Part_no NUMBER PRIMARY KEY,
– Part_desc VARCHAR2(200) NOT NULL );
http://www.conlinetraining.com/courses/sql-online-training/
Create Table
• CREATE TABLE item (Item_no NUMBER,Part_no NUMBER,Item_desc varchar2(200) NOT
NULL, CONSTRAINT fk_item_part FOREIGN KEY (part_no) REFERENCES PART (part_no), CON
STRAINT pk_item PRIMARY KEY (item_no, part_no) );
• In this example, what we are really interested in is the creation of the ITEM table. First, note that
we defined the primary key as an out of line primary key. This is because it is a composite
primary key and composite primary keys have to be defined out of line.
• Now, we are interested in the foreign key definition. You must define foreign key constraints as
out of line constraints, as we have done in our example. Here is a snippet of the command that
we used:
• CONSTRAINT fk_item_part FOREIGN KEY (part_no) REFERENCES part (part_no);
http://www.conlinetraining.com/courses/sql-online-training/
Alter Table
• If you need to add foreign key constraints to a table after the fact, simply
use the alter table command as seen here:
• ALTER TABLE my_status ADD CONSTRAINT fk_my_status
FOREIGN KEY (part_no) REFERENCES part (part_no);
http://www.conlinetraining.com/courses/sql-online-training/
Check Constraints
• Check constraints validate that values in a given column meet a specific criteria.
• For example, you could create a check constraint on a varchar2 column so it
only can contain the values T or F as in this example:
• Create table my_status
( status_id NUMBER PRIMARY KEY,
person_id NUMBER NOT NULL,
active_record VARCHAR2(1) NOT NULL
CHECK (UPPER(active_record)='T' or
UPPER(active_record)='F'),
person_ssn VARCHAR2(20) CONSTRAINT un_person_ssn UNIQUE
);
http://www.conlinetraining.com/courses/sql-online-training/
Questions ???
http://www.conlinetraining.com/courses/sql-online-training/
Email us : info@conlineTraining.com
Visit : www.conlinetraining.com

Más contenido relacionado

La actualidad más candente (19)

Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionIntro to T-SQL – 2nd session
Intro to T-SQL – 2nd session
 
Basic SQL and History
 Basic SQL and History Basic SQL and History
Basic SQL and History
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Sql basics
Sql  basicsSql  basics
Sql basics
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
SQL select clause
SQL select clauseSQL select clause
SQL select clause
 
MySQL Pro
MySQL ProMySQL Pro
MySQL Pro
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commands
 
PostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | EdurekaPostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | Edureka
 
Sql commands
Sql commandsSql commands
Sql commands
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
 
Lab2 ddl commands
Lab2 ddl commandsLab2 ddl commands
Lab2 ddl commands
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
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
 
Introduction to mysql part 1
Introduction to mysql part 1Introduction to mysql part 1
Introduction to mysql part 1
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 

Destacado (20)

management skills improvement for engineers
management skills improvement for engineersmanagement skills improvement for engineers
management skills improvement for engineers
 
Alejita
AlejitaAlejita
Alejita
 
Cableado estructurado
Cableado estructuradoCableado estructurado
Cableado estructurado
 
12
1212
12
 
№ 8 (32), декабрь 2012
№ 8 (32), декабрь 2012№ 8 (32), декабрь 2012
№ 8 (32), декабрь 2012
 
Comunicatodiffida
ComunicatodiffidaComunicatodiffida
Comunicatodiffida
 
My linked in_video
My linked in_videoMy linked in_video
My linked in_video
 
Corpo formas
Corpo formasCorpo formas
Corpo formas
 
Rwanda omni scire ltd exec_summary
Rwanda omni scire ltd exec_summaryRwanda omni scire ltd exec_summary
Rwanda omni scire ltd exec_summary
 
Shaik Nizamuddin Profile - Financial Research
Shaik Nizamuddin Profile - Financial ResearchShaik Nizamuddin Profile - Financial Research
Shaik Nizamuddin Profile - Financial Research
 
ETA 1991 Super committee person Certificate
ETA 1991 Super committee person CertificateETA 1991 Super committee person Certificate
ETA 1991 Super committee person Certificate
 
Masterprojekt - Mennesket og maskinen - uden Netdansk!.docx - Google Docs
Masterprojekt - Mennesket og maskinen - uden Netdansk!.docx - Google DocsMasterprojekt - Mennesket og maskinen - uden Netdansk!.docx - Google Docs
Masterprojekt - Mennesket og maskinen - uden Netdansk!.docx - Google Docs
 
ISO27001LA
ISO27001LAISO27001LA
ISO27001LA
 
Juan david blandon
Juan david blandonJuan david blandon
Juan david blandon
 
CV Purnama Rudiarto
CV Purnama RudiartoCV Purnama Rudiarto
CV Purnama Rudiarto
 
Cuadro comparativo entre monitor crt y monitor plasma
Cuadro comparativo entre monitor crt y monitor plasmaCuadro comparativo entre monitor crt y monitor plasma
Cuadro comparativo entre monitor crt y monitor plasma
 
lebenslauf
lebenslauflebenslauf
lebenslauf
 
Viguetas
ViguetasViguetas
Viguetas
 
La Organizacion
La OrganizacionLa Organizacion
La Organizacion
 
tik Bab 2
tik Bab 2tik Bab 2
tik Bab 2
 

Similar a Bn1037 demo oracle sql

Constraints constraints of oracle data base management systems
Constraints  constraints of oracle data base management systemsConstraints  constraints of oracle data base management systems
Constraints constraints of oracle data base management systemsSHAKIR325211
 
Dms 22319 micro project
Dms 22319 micro projectDms 22319 micro project
Dms 22319 micro projectARVIND SARDAR
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraintsVivek Singh
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developerAhsan Kabir
 
Oracle SQL Fundamentals - Lecture 3
Oracle SQL Fundamentals - Lecture 3Oracle SQL Fundamentals - Lecture 3
Oracle SQL Fundamentals - Lecture 3MuhammadWaheed44
 
Database constraints
Database constraintsDatabase constraints
Database constraintsFraboni Ec
 
Database constraints
Database constraintsDatabase constraints
Database constraintsLuis Goldster
 
Database constraints
Database constraintsDatabase constraints
Database constraintsDavid Hoen
 
Database constraints
Database constraintsDatabase constraints
Database constraintsTony Nguyen
 
Database constraints
Database constraintsDatabase constraints
Database constraintsHarry Potter
 
Database constraints
Database constraintsDatabase constraints
Database constraintsJames Wong
 
Database constraints
Database constraintsDatabase constraints
Database constraintsYoung Alista
 
SQL200.3 Module 3
SQL200.3 Module 3SQL200.3 Module 3
SQL200.3 Module 3Dan D'Urso
 
ms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptxms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptxYashaswiniSrinivasan1
 

Similar a Bn1037 demo oracle sql (20)

Constraints constraints of oracle data base management systems
Constraints  constraints of oracle data base management systemsConstraints  constraints of oracle data base management systems
Constraints constraints of oracle data base management systems
 
Dms 22319 micro project
Dms 22319 micro projectDms 22319 micro project
Dms 22319 micro project
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraints
 
MS SQL Server
MS SQL ServerMS SQL Server
MS SQL Server
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developer
 
Oracle SQL Fundamentals - Lecture 3
Oracle SQL Fundamentals - Lecture 3Oracle SQL Fundamentals - Lecture 3
Oracle SQL Fundamentals - Lecture 3
 
Database constraints
Database constraintsDatabase constraints
Database constraints
 
Database constraints
Database constraintsDatabase constraints
Database constraints
 
Database constraints
Database constraintsDatabase constraints
Database constraints
 
Database constraints
Database constraintsDatabase constraints
Database constraints
 
Database constraints
Database constraintsDatabase constraints
Database constraints
 
Database constraints
Database constraintsDatabase constraints
Database constraints
 
Database constraints
Database constraintsDatabase constraints
Database constraints
 
SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data   SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data
 
SQL200.3 Module 3
SQL200.3 Module 3SQL200.3 Module 3
SQL200.3 Module 3
 
SQL
SQLSQL
SQL
 
UNIT2.ppt
UNIT2.pptUNIT2.ppt
UNIT2.ppt
 
ms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptxms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptx
 
Unit - II.pptx
Unit - II.pptxUnit - II.pptx
Unit - II.pptx
 
chapter 8 SQL.ppt
chapter 8 SQL.pptchapter 8 SQL.ppt
chapter 8 SQL.ppt
 

Más de conline training

Más de conline training (20)

Bn 1024 demo ccnp
Bn 1024 demo  ccnpBn 1024 demo  ccnp
Bn 1024 demo ccnp
 
Bn 1023 demo network security
Bn 1023 demo  network securityBn 1023 demo  network security
Bn 1023 demo network security
 
Bn 1023 demo ccna
Bn 1023 demo  ccnaBn 1023 demo  ccna
Bn 1023 demo ccna
 
Bn 1022 demo mcse 2012
Bn 1022 demo  mcse 2012Bn 1022 demo  mcse 2012
Bn 1022 demo mcse 2012
 
Bn 1021 demo digital marketing
Bn 1021 demo  digital marketingBn 1021 demo  digital marketing
Bn 1021 demo digital marketing
 
Bn 1019 demo sql server 2012
Bn 1019 demo  sql server 2012Bn 1019 demo  sql server 2012
Bn 1019 demo sql server 2012
 
Bn 1018 demo pl sql
Bn 1018 demo  pl sqlBn 1018 demo  pl sql
Bn 1018 demo pl sql
 
Bn 1016 demo postgre sql-online-training
Bn 1016 demo  postgre sql-online-trainingBn 1016 demo  postgre sql-online-training
Bn 1016 demo postgre sql-online-training
 
B10014 ppt for msbi
B10014 ppt for msbiB10014 ppt for msbi
B10014 ppt for msbi
 
B1015 demo on selenium testing tools
B1015 demo on selenium testing toolsB1015 demo on selenium testing tools
B1015 demo on selenium testing tools
 
Bn1038 demo pega
Bn1038 demo  pegaBn1038 demo  pega
Bn1038 demo pega
 
Bn1033 demo sap basis
Bn1033 demo  sap basisBn1033 demo  sap basis
Bn1033 demo sap basis
 
Bn1032 demo sap bo
Bn1032 demo  sap boBn1032 demo  sap bo
Bn1032 demo sap bo
 
Bn1031 demo sap ehs
Bn1031 demo sap ehsBn1031 demo sap ehs
Bn1031 demo sap ehs
 
Bn1030 oracle dba
Bn1030 oracle dbaBn1030 oracle dba
Bn1030 oracle dba
 
Bn1029 demo sap sd
Bn1029 demo  sap sdBn1029 demo  sap sd
Bn1029 demo sap sd
 
Bn1028 demo hadoop administration and development
Bn1028 demo  hadoop administration and developmentBn1028 demo  hadoop administration and development
Bn1028 demo hadoop administration and development
 
Bn1025 demo basic unix
Bn1025 demo  basic unixBn1025 demo  basic unix
Bn1025 demo basic unix
 
Bn1013 demo sap success factors
Bn1013 demo  sap success factorsBn1013 demo  sap success factors
Bn1013 demo sap success factors
 
Bn1012 demo ppt sap pm
Bn1012 demo ppt sap pmBn1012 demo ppt sap pm
Bn1012 demo ppt sap pm
 

Último

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 

Último (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 

Bn1037 demo oracle sql

  • 1. Introduction to Oracle Structured Query Language BN1037 – Demo PPT Demo Oracle SQL
  • 2. http://www.conlinetraining.com/courses/sql-online-training/ Oracle SQL Course Details • Basic SQL Statement • Restricting and Sorting Data • Single Row Functions • Displaying Data from Multiple Tables • Aggregating Data by Using Group Functions • Writing Sub queries • Sqlplus, isqlplus • Manipulating Data • Managing Tables, Constraints • Views • Other Database Objects • Controlling User Access • Using Set Operators • Oracle Extensions to DML and DDL Statements
  • 3. http://www.conlinetraining.com/courses/sql-online-training/ Oracle Constraints types Constraints: -- Constraints apply specific rules to data, ensuring the data conforms to the requirements defined. There are a number of different kinds of constraints. There are two ways to apply constraint into Database. 1)Column level Constraint. 2)Table Level Constraint.
  • 4. http://www.conlinetraining.com/courses/sql-online-training/ Types Of Constraints • Not NULL • Primary key • Unique • Foreign Key • Check • Let's look at each of these in a little more detail.
  • 5. http://www.conlinetraining.com/courses/sql-online-training/ NOT NULL Constraints • NOT NULL constraints are in-line constraints that indicate that a column can not contain NULL values. For example, the PERSON_ID column is defined as NOT NULL in that example. • If you need to add a NOT NULL constraint to a table after the fact, simply use the alter table command as in this example: • Syntax:- • create table customer (status char(3) not null, val number not null); • Alter Table Table Name Modify( person_id NOT NULL); • When copying tables, beware that NULL values many not copy properly.
  • 6. http://www.conlinetraining.com/courses/sql-online-training/ Primary Key Constraints • Primary key constraints define a column or series of columns that uniquely identify a given row in a table. Defining a primary key on a table is optional and you can only define a single primary key on a table. A primary key constraint can consist of one or many columns (up to 32 ). Any column that is defined as a primary key column is automatically set with a NOT NULL status. • Syntax:-create table customer (status_id Number CONSTRAINT CONSTRAINT _NAME ); • If you need to primary key constraint to a table after the fact, simply use the alter table command. • ALTER TABLE customer ADD CONSTRAINT pk_my_status PRIMARY KEY (status_id);
  • 7. http://www.conlinetraining.com/courses/sql-online-training/ Unique Constraints • Unique constraints are like alternative primary key constraints. • A unique constraint defines a column, or series of columns, that must be unique in value. • You can have a number of unique constraints defined and the columns can have NULL values in them, unlike a column that belongs to a primary key constraint. • If you need to add unique key constraints to a table after the fact, simply use the alter table command. • ALTER TABLE my_status ADD CONSTRAINT uk_my_status UNIQUE (status_id, person_id);
  • 8. http://www.conlinetraining.com/courses/sql-online-training/ Foreign Key Constraints • A foreign key constraint is used to enforce a relationship between two tables. As an example, take the case of two tables, ITEM and PART. These tables have a relationship (an item can have none, one or many parts). Foreign key constraints help to enforce that relationship • Well, foreign key constraints help to enforce the types of relationships between tables we have just demonstrated. In this example we will create the ITEM and PART table. In the process of doing so, we will create a foreign key relationship between the two: – CREATE TABLE part – ( Part_no NUMBER PRIMARY KEY, – Part_desc VARCHAR2(200) NOT NULL );
  • 9. http://www.conlinetraining.com/courses/sql-online-training/ Create Table • CREATE TABLE item (Item_no NUMBER,Part_no NUMBER,Item_desc varchar2(200) NOT NULL, CONSTRAINT fk_item_part FOREIGN KEY (part_no) REFERENCES PART (part_no), CON STRAINT pk_item PRIMARY KEY (item_no, part_no) ); • In this example, what we are really interested in is the creation of the ITEM table. First, note that we defined the primary key as an out of line primary key. This is because it is a composite primary key and composite primary keys have to be defined out of line. • Now, we are interested in the foreign key definition. You must define foreign key constraints as out of line constraints, as we have done in our example. Here is a snippet of the command that we used: • CONSTRAINT fk_item_part FOREIGN KEY (part_no) REFERENCES part (part_no);
  • 10. http://www.conlinetraining.com/courses/sql-online-training/ Alter Table • If you need to add foreign key constraints to a table after the fact, simply use the alter table command as seen here: • ALTER TABLE my_status ADD CONSTRAINT fk_my_status FOREIGN KEY (part_no) REFERENCES part (part_no);
  • 11. http://www.conlinetraining.com/courses/sql-online-training/ Check Constraints • Check constraints validate that values in a given column meet a specific criteria. • For example, you could create a check constraint on a varchar2 column so it only can contain the values T or F as in this example: • Create table my_status ( status_id NUMBER PRIMARY KEY, person_id NUMBER NOT NULL, active_record VARCHAR2(1) NOT NULL CHECK (UPPER(active_record)='T' or UPPER(active_record)='F'), person_ssn VARCHAR2(20) CONSTRAINT un_person_ssn UNIQUE );
  • 13. http://www.conlinetraining.com/courses/sql-online-training/ Email us : info@conlineTraining.com Visit : www.conlinetraining.com