SlideShare a Scribd company logo
1 of 5
Basic SQL Functions

Data Definition Language:

Create

Alter

Drop

Data Manipulation Language:

Insert

Delete

Update

Always COMMIT for data manipulation languages

Delete:

Deletes the data from table, but the memory for the table still remains and the structure of the
table remains and the data can be retrieved by the DBA. Where condition can be used.

Truncate:

Truncates the data from table and also removes the memory for the table from server ,the
structure of the table remains and the data truncated cannot be retrieved again. Where
condition cannot be used.

Drop:

Drops the table, its data, its memory and the structure of the table completely.

V$ parameter:

For Utl directory:

Select * from v$parameter where name like %utl%

For Trace file directory

Select * from v$parameter where name like ‘%user%dump%’
Functions to be known mandatory

= (Equal To):

 This function is used as equal to ,i.e inorder to match the records in the table as a direct
comparision:

Eg: Select * from
    Employees
    Where name =’Shravan’

!= (Not Equal to) :

 This function is used as not equal to, inorder to exclude the records

<>

In

Not in

Like

Not like

Union

Union all

Minus

Distinct

Sum

Avg

Max

Min

Count

Group by

Having
Order by

Length

To_char

To_number

To_date

Trunc

Substr

Instr

Mod

Sign e

Decode

Trim

Ltrim

Rtrim

Lpad

Rpad

Replace

Rowid

Rownum

Nvl

And

Or

Dual

Case
ABS

Translate

Joins

RegExp_Replace

Create Statement:

Create can be used to create :

Table

Index

Sequence

View

PL/SQL (Procedure,package,function,Trigger)

Sequence creation:

Create Sequence<seq name>
  Maxvalue (Optional)
  Minvalue (Optional)
 Start with 1
 Increment by 1
 Cache       (Optional)

Nextval ->next value Currval-current value

Select s1.nextval from dual
Select s1.currval from dual

To alter sequence:

Alter sequence s1
Increment by -3

Index:

Indexes are of different types, mostly used are
UNIQUE

BINARY

HASH

FUNCTION

Create Index <index_name> on table_name(column name)

Views:

Views are nothing but collection of tables, once the tables in the view are updated the view
automatically takes the data from updated tables, by using the select statement every time it
has to join the tables it takes time ,this is avoided using the views.

Create or Replace view as

Select * from table1,table2,table3 where table.col1=table2.col3

More Related Content

What's hot

Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries Prabu Cse
 
Import and Export Excel files using XLConnect in R Studio
Import and Export Excel files using XLConnect in R StudioImport and Export Excel files using XLConnect in R Studio
Import and Export Excel files using XLConnect in R StudioRupak Roy
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statementsMohd Tousif
 
Manipulating data with dates
Manipulating data with datesManipulating data with dates
Manipulating data with datesRupak Roy
 
Database Management - Lecture 2 - SQL select, insert, update and delete
Database Management - Lecture 2 - SQL select, insert, update and deleteDatabase Management - Lecture 2 - SQL select, insert, update and delete
Database Management - Lecture 2 - SQL select, insert, update and deleteAl-Mamun Sarkar
 
Introduction to MySQL - Part 2
Introduction to MySQL - Part 2Introduction to MySQL - Part 2
Introduction to MySQL - Part 2webhostingguy
 
Null values, insert, delete and update in database
Null values, insert, delete and update in databaseNull values, insert, delete and update in database
Null values, insert, delete and update in databaseHemant Suthar
 
Sql delete, truncate, drop statements
Sql delete, truncate, drop statementsSql delete, truncate, drop statements
Sql delete, truncate, drop statementsVivek Singh
 
Introduction To Oracle Sql
Introduction To Oracle SqlIntroduction To Oracle Sql
Introduction To Oracle SqlAhmed Yaseen
 
Handling Missing Values
Handling Missing Values Handling Missing Values
Handling Missing Values Rupak Roy
 

What's hot (19)

Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries
 
ADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASADADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASAD
 
Import and Export Excel files using XLConnect in R Studio
Import and Export Excel files using XLConnect in R StudioImport and Export Excel files using XLConnect in R Studio
Import and Export Excel files using XLConnect in R Studio
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 
Manipulating data with dates
Manipulating data with datesManipulating data with dates
Manipulating data with dates
 
My sql
My sqlMy sql
My sql
 
Database Management - Lecture 2 - SQL select, insert, update and delete
Database Management - Lecture 2 - SQL select, insert, update and deleteDatabase Management - Lecture 2 - SQL select, insert, update and delete
Database Management - Lecture 2 - SQL select, insert, update and delete
 
Introduction to MySQL - Part 2
Introduction to MySQL - Part 2Introduction to MySQL - Part 2
Introduction to MySQL - Part 2
 
Null values, insert, delete and update in database
Null values, insert, delete and update in databaseNull values, insert, delete and update in database
Null values, insert, delete and update in database
 
R brownbag seminar 2.3
R brownbag seminar 2.3R brownbag seminar 2.3
R brownbag seminar 2.3
 
Sql commands
Sql commandsSql commands
Sql commands
 
SQL
SQLSQL
SQL
 
Crash course in sql
Crash course in sqlCrash course in sql
Crash course in sql
 
Sql delete, truncate, drop statements
Sql delete, truncate, drop statementsSql delete, truncate, drop statements
Sql delete, truncate, drop statements
 
1 ddl
1 ddl1 ddl
1 ddl
 
Pandas csv
Pandas csvPandas csv
Pandas csv
 
Introduction To Oracle Sql
Introduction To Oracle SqlIntroduction To Oracle Sql
Introduction To Oracle Sql
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
Handling Missing Values
Handling Missing Values Handling Missing Values
Handling Missing Values
 

Viewers also liked

R12 subinventory transfer and inter org transfers
R12 subinventory transfer and inter org transfersR12 subinventory transfer and inter org transfers
R12 subinventory transfer and inter org transfersshravan kumar chelika
 
Attach a image to the requisition line in iprocurement
Attach a image to the requisition line in iprocurementAttach a image to the requisition line in iprocurement
Attach a image to the requisition line in iprocurementshravan kumar chelika
 
How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Restshravan kumar chelika
 
R12 fixed assets new features
R12 fixed assets new featuresR12 fixed assets new features
R12 fixed assets new featuresShuaib Kokate
 
How to auto create trip in oracle order management
How to auto create trip in oracle order managementHow to auto create trip in oracle order management
How to auto create trip in oracle order managementshravan kumar chelika
 
Create rest webservice for oracle public api using java class via jdeveloper
Create rest webservice for oracle public api using java class via jdeveloperCreate rest webservice for oracle public api using java class via jdeveloper
Create rest webservice for oracle public api using java class via jdevelopershravan kumar chelika
 

Viewers also liked (20)

R12 subinventory transfer and inter org transfers
R12 subinventory transfer and inter org transfersR12 subinventory transfer and inter org transfers
R12 subinventory transfer and inter org transfers
 
Fixed assets-set-up
Fixed assets-set-upFixed assets-set-up
Fixed assets-set-up
 
Expense personalization
Expense personalizationExpense personalization
Expense personalization
 
Oracle glossary
Oracle glossaryOracle glossary
Oracle glossary
 
Oracle fixed assets
Oracle fixed assetsOracle fixed assets
Oracle fixed assets
 
Build Restful Service using ADFBC
Build Restful Service using ADFBCBuild Restful Service using ADFBC
Build Restful Service using ADFBC
 
Get On Hand Quantities Through API
Get On Hand Quantities Through APIGet On Hand Quantities Through API
Get On Hand Quantities Through API
 
Attach a image to the requisition line in iprocurement
Attach a image to the requisition line in iprocurementAttach a image to the requisition line in iprocurement
Attach a image to the requisition line in iprocurement
 
How to create PO with ASN
How to create PO with ASNHow to create PO with ASN
How to create PO with ASN
 
How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Rest
 
iExpenses Setup
iExpenses SetupiExpenses Setup
iExpenses Setup
 
Order Line Sets in Oracle Order Management
Order Line Sets in Oracle Order ManagementOrder Line Sets in Oracle Order Management
Order Line Sets in Oracle Order Management
 
iExpenses Introduction
iExpenses IntroductioniExpenses Introduction
iExpenses Introduction
 
Physical inventory
Physical inventoryPhysical inventory
Physical inventory
 
Basics of oracle service contracts
Basics of oracle service contractsBasics of oracle service contracts
Basics of oracle service contracts
 
Order to cash cycle
Order to cash cycleOrder to cash cycle
Order to cash cycle
 
Procure to pay flow
Procure to pay flowProcure to pay flow
Procure to pay flow
 
R12 fixed assets new features
R12 fixed assets new featuresR12 fixed assets new features
R12 fixed assets new features
 
How to auto create trip in oracle order management
How to auto create trip in oracle order managementHow to auto create trip in oracle order management
How to auto create trip in oracle order management
 
Create rest webservice for oracle public api using java class via jdeveloper
Create rest webservice for oracle public api using java class via jdeveloperCreate rest webservice for oracle public api using java class via jdeveloper
Create rest webservice for oracle public api using java class via jdeveloper
 

Similar to Mandatory sql functions for beginners

Similar to Mandatory sql functions for beginners (20)

DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptx
 
Sql
SqlSql
Sql
 
Mysql1
Mysql1Mysql1
Mysql1
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Sql 
statements , functions & joins
Sql 
statements , functions  &  joinsSql 
statements , functions  &  joins
Sql 
statements , functions & joins
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
 
Dbms
DbmsDbms
Dbms
 
Sql
SqlSql
Sql
 
MySQL-commands.pdf
MySQL-commands.pdfMySQL-commands.pdf
MySQL-commands.pdf
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
Lab
LabLab
Lab
 
Advanced Sql Training
Advanced Sql TrainingAdvanced Sql Training
Advanced Sql Training
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Mandatory sql functions for beginners

  • 1. Basic SQL Functions Data Definition Language: Create Alter Drop Data Manipulation Language: Insert Delete Update Always COMMIT for data manipulation languages Delete: Deletes the data from table, but the memory for the table still remains and the structure of the table remains and the data can be retrieved by the DBA. Where condition can be used. Truncate: Truncates the data from table and also removes the memory for the table from server ,the structure of the table remains and the data truncated cannot be retrieved again. Where condition cannot be used. Drop: Drops the table, its data, its memory and the structure of the table completely. V$ parameter: For Utl directory: Select * from v$parameter where name like %utl% For Trace file directory Select * from v$parameter where name like ‘%user%dump%’
  • 2. Functions to be known mandatory = (Equal To): This function is used as equal to ,i.e inorder to match the records in the table as a direct comparision: Eg: Select * from Employees Where name =’Shravan’ != (Not Equal to) : This function is used as not equal to, inorder to exclude the records <> In Not in Like Not like Union Union all Minus Distinct Sum Avg Max Min Count Group by Having
  • 4. ABS Translate Joins RegExp_Replace Create Statement: Create can be used to create : Table Index Sequence View PL/SQL (Procedure,package,function,Trigger) Sequence creation: Create Sequence<seq name> Maxvalue (Optional) Minvalue (Optional) Start with 1 Increment by 1 Cache (Optional) Nextval ->next value Currval-current value Select s1.nextval from dual Select s1.currval from dual To alter sequence: Alter sequence s1 Increment by -3 Index: Indexes are of different types, mostly used are
  • 5. UNIQUE BINARY HASH FUNCTION Create Index <index_name> on table_name(column name) Views: Views are nothing but collection of tables, once the tables in the view are updated the view automatically takes the data from updated tables, by using the select statement every time it has to join the tables it takes time ,this is avoided using the views. Create or Replace view as Select * from table1,table2,table3 where table.col1=table2.col3