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

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 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