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
 
Introduction to MySQL - Part 2
Introduction to MySQL - Part 2Introduction to MySQL - Part 2
Introduction to MySQL - Part 2
webhostingguy
 
Sql delete, truncate, drop statements
Sql delete, truncate, drop statementsSql delete, truncate, drop statements
Sql delete, truncate, drop statements
Vivek Singh
 

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 fixed assets new features
R12 fixed assets new featuresR12 fixed assets new features
R12 fixed assets new features
Shuaib Kokate
 

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

Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
SANTOSH RATH
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
Reka
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
Vikas Gupta
 

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

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

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