SlideShare a Scribd company logo
1 of 15
SQL
  Structured Query Language
SQL is language use for creating, accessing and
manipulating database systems. SQL statements are used
to retrieve and update data in a database. SQL works with
database programs like MS Access, DB2, Informix, MS SQL
Server, Oracle, Sybase, etc.

Database is collection of data Stored in table format.
Each table is identified by a name . Tables contain records
(rows) and columns.
Below is an example of a table called “employee":
     Id              Name            Sal
     1               Aditya          25000
     2               Vaidehi         17000
For Performing Operations on the data stored in
tables different commands are available in sql.
SQL commands are categorized in different groups

DDL : Data Definition Language
DML: Data Manipulation Language
TCL : Transaction Control Language
DATA DEFINITION LANGUAGE(DDL)
DDL include three commands

•CREATE - Creates a new database table or object.
• ALTER - Alters (changes) a database table or Object
          We can Add ,Modify and Drop column
• DROP - Deletes a database table or Object
Create
Syntax:
Create table table_name( column1 datatype(size),
                         column2 datatype(size),
                          .
                          .
                        columnn datatype(size));

Example:
Create table Employee(id number(3),
                       name varchar2(10),
                       salary number(10));
EFFECT OF CREATE COMMAND
     Id        Name        salary
Alter
Syntax:
          Alter table table_name
          ADD/MODIFY/DROP (column specification);



Example
 Alter table employee Add (Address varchar2(10));
 Alter table employee modify(Address varchar2(12));
 Alter table employee Drop(Adress );
EFFECT OF ALTER COMMAND
      ID                NAME             SALARY




   Alter table employee Add (Address varchar2(10));
     ID          NAME          SALARY      ADDRESS



   Alter table employee Drop(Address );

     ID              NAME               SALARY
Drop
Syntax:
Drop table table_name;

Example:
Drop table employee;
DATA MANIPULATION LANGUAGE (DML)

 Data Manipulation Language (DML) include
select,update,delete,insert:

   •SELECT - Use for retrieving data from a database table
   •UPDATE – Use for updating data in a database table
   •DELETE – Use for deletes data from a database table
   •INSERT - Use for inserts new data into a database table
SELECT STATMENT

Syntax

Select * or column1,column2..column n from table_name
[where condition];


Example
Select * from employee;

Select name from employee;
INSERT STATMENT
Syntax
INSERT INTO table_name[(column1,column2,…)]
                       VALUES (value1, value2,....) ;


Example;
Insert into emp(id,name,salary)values(101,’Aditya’,100000);

           Id             Name            Sal
           1              Aditya          100000
           2              Vaidehi         17000
UPDATE STATMENT
Syntax
         UPDATE table_name
         SET column_name = new_value
         WHERE column_name = some_value;
Example:
  update emp
   set salary=50000
  where id=101;
     Id               Name        Sal
     101              Aditya      50000
     102              Vaidehi     17000
DELETE STATMENT


Syntax
         DELETE FROM table_name
         [WHERE column_name = some_value ]
Example:
  delete from employee
 where id=101;

     Id              Name          Sal
     102             Vaidehi       17000
Thank you!

More Related Content

What's hot

Basic sql(oracle) queries
Basic sql(oracle) queriesBasic sql(oracle) queries
Basic sql(oracle) queriesHarish Gyanani
 
Lecture 3 sql {basics ddl commands}
Lecture 3 sql {basics  ddl commands}Lecture 3 sql {basics  ddl commands}
Lecture 3 sql {basics ddl commands}Shubham Shukla
 
Exploring collections with example
Exploring collections with exampleExploring collections with example
Exploring collections with examplepranav kumar verma
 
Sqlcusesprac
SqlcusespracSqlcusesprac
Sqlcusespraclololo85
 
Lecture 4 sql {basics keys and constraints}
Lecture 4 sql {basics  keys and constraints}Lecture 4 sql {basics  keys and constraints}
Lecture 4 sql {basics keys and constraints}Shubham Shukla
 
Pemrograman SQL - CRUD Query
Pemrograman SQL - CRUD QueryPemrograman SQL - CRUD Query
Pemrograman SQL - CRUD QueryKuliahKita
 
Appendix A Tables
Appendix A   TablesAppendix A   Tables
Appendix A TablesLiquidHub
 
Linguagem sql
Linguagem sqlLinguagem sql
Linguagem sqlTic Eslc
 
Si0302 20140320131934
Si0302 20140320131934Si0302 20140320131934
Si0302 20140320131934Dex Winadha
 

What's hot (18)

Ddl commands
Ddl commandsDdl commands
Ddl commands
 
Basic sql(oracle) queries
Basic sql(oracle) queriesBasic sql(oracle) queries
Basic sql(oracle) queries
 
SQL
SQLSQL
SQL
 
Db1 lecture4
Db1 lecture4Db1 lecture4
Db1 lecture4
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
Lecture 3 sql {basics ddl commands}
Lecture 3 sql {basics  ddl commands}Lecture 3 sql {basics  ddl commands}
Lecture 3 sql {basics ddl commands}
 
Exploring collections with example
Exploring collections with exampleExploring collections with example
Exploring collections with example
 
Oracle: Basic SQL
Oracle: Basic SQLOracle: Basic SQL
Oracle: Basic SQL
 
Sqlcusesprac
SqlcusespracSqlcusesprac
Sqlcusesprac
 
Oracle: PLSQL Commands
Oracle: PLSQL CommandsOracle: PLSQL Commands
Oracle: PLSQL Commands
 
Lecture 4 sql {basics keys and constraints}
Lecture 4 sql {basics  keys and constraints}Lecture 4 sql {basics  keys and constraints}
Lecture 4 sql {basics keys and constraints}
 
Pemrograman SQL - CRUD Query
Pemrograman SQL - CRUD QueryPemrograman SQL - CRUD Query
Pemrograman SQL - CRUD Query
 
Appendix A Tables
Appendix A   TablesAppendix A   Tables
Appendix A Tables
 
Bibashsql
BibashsqlBibashsql
Bibashsql
 
Linguagem sql
Linguagem sqlLinguagem sql
Linguagem sql
 
Si0302 20140320131934
Si0302 20140320131934Si0302 20140320131934
Si0302 20140320131934
 
Oracle
OracleOracle
Oracle
 
MY SQL
MY SQLMY SQL
MY SQL
 

Viewers also liked

Viewers also liked (7)

Animaker refresh
Animaker refreshAnimaker refresh
Animaker refresh
 
Getting Started with SQLite
Getting Started with SQLiteGetting Started with SQLite
Getting Started with SQLite
 
Sqlite
SqliteSqlite
Sqlite
 
Oracle sql & plsql
Oracle sql & plsqlOracle sql & plsql
Oracle sql & plsql
 
Dbms lab questions
Dbms lab questionsDbms lab questions
Dbms lab questions
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
 

Similar to Sqlbysandeep

SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL CommandsShrija Madhu
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorialamitabros
 
Ddl & dml commands
Ddl & dml commandsDdl & dml commands
Ddl & dml commandsAnjaliJain167
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptDrRShaliniVISTAS
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...SakkaravarthiS1
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxEliasPetros
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL Rc Os
 
SQL : Structured Query Language
SQL : Structured Query LanguageSQL : Structured Query Language
SQL : Structured Query LanguageAbhishek Gautam
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxEliasPetros
 

Similar to Sqlbysandeep (20)

SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Sql
SqlSql
Sql
 
Lab
LabLab
Lab
 
Ddl & dml commands
Ddl & dml commandsDdl & dml commands
Ddl & dml commands
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
 
Commands
CommandsCommands
Commands
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL
 
SQL Query
SQL QuerySQL Query
SQL Query
 
SQL : Structured Query Language
SQL : Structured Query LanguageSQL : Structured Query Language
SQL : Structured Query Language
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
 
Data manipulation language
Data manipulation languageData manipulation language
Data manipulation language
 
Les08
Les08Les08
Les08
 
SQL.ppt
SQL.pptSQL.ppt
SQL.ppt
 
Sql
SqlSql
Sql
 
sql language
sql languagesql language
sql language
 
Les09
Les09Les09
Les09
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
 

Recently uploaded

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
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
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
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
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
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
 

Sqlbysandeep

  • 1. SQL Structured Query Language
  • 2. SQL is language use for creating, accessing and manipulating database systems. SQL statements are used to retrieve and update data in a database. SQL works with database programs like MS Access, DB2, Informix, MS SQL Server, Oracle, Sybase, etc. Database is collection of data Stored in table format. Each table is identified by a name . Tables contain records (rows) and columns. Below is an example of a table called “employee": Id Name Sal 1 Aditya 25000 2 Vaidehi 17000
  • 3. For Performing Operations on the data stored in tables different commands are available in sql. SQL commands are categorized in different groups DDL : Data Definition Language DML: Data Manipulation Language TCL : Transaction Control Language
  • 4. DATA DEFINITION LANGUAGE(DDL) DDL include three commands •CREATE - Creates a new database table or object. • ALTER - Alters (changes) a database table or Object We can Add ,Modify and Drop column • DROP - Deletes a database table or Object
  • 5. Create Syntax: Create table table_name( column1 datatype(size), column2 datatype(size), . . columnn datatype(size)); Example: Create table Employee(id number(3), name varchar2(10), salary number(10));
  • 6. EFFECT OF CREATE COMMAND Id Name salary
  • 7. Alter Syntax: Alter table table_name ADD/MODIFY/DROP (column specification); Example Alter table employee Add (Address varchar2(10)); Alter table employee modify(Address varchar2(12)); Alter table employee Drop(Adress );
  • 8. EFFECT OF ALTER COMMAND ID NAME SALARY Alter table employee Add (Address varchar2(10)); ID NAME SALARY ADDRESS Alter table employee Drop(Address ); ID NAME SALARY
  • 10. DATA MANIPULATION LANGUAGE (DML) Data Manipulation Language (DML) include select,update,delete,insert: •SELECT - Use for retrieving data from a database table •UPDATE – Use for updating data in a database table •DELETE – Use for deletes data from a database table •INSERT - Use for inserts new data into a database table
  • 11. SELECT STATMENT Syntax Select * or column1,column2..column n from table_name [where condition]; Example Select * from employee; Select name from employee;
  • 12. INSERT STATMENT Syntax INSERT INTO table_name[(column1,column2,…)] VALUES (value1, value2,....) ; Example; Insert into emp(id,name,salary)values(101,’Aditya’,100000); Id Name Sal 1 Aditya 100000 2 Vaidehi 17000
  • 13. UPDATE STATMENT Syntax UPDATE table_name SET column_name = new_value WHERE column_name = some_value; Example: update emp set salary=50000 where id=101; Id Name Sal 101 Aditya 50000 102 Vaidehi 17000
  • 14. DELETE STATMENT Syntax DELETE FROM table_name [WHERE column_name = some_value ] Example: delete from employee where id=101; Id Name Sal 102 Vaidehi 17000