SlideShare a Scribd company logo
Well come,,,,,,,,,Chandan Pawar
SQL Server
MS SQL Server is a database
server
Product of Microsoft
Enables user to write queries and
other SQL statements and
execute them
Overview,,,,,
Introduction
DDL Commands
DML Commands
SQL Statements, Operators, Clauses
The ANSI standard language for the definition
and manipulation of relational database.
Includes data definition language (DDL),
statements that specify and modify database
schemas.
Includes a data manipulation language (DML),
statements that manipulate database content.
Structured Query Language (SQL)
SQL: DDL Commands
CREATE TABLE: used to create a table.
ALTER TABLE: modifies a table after it was created.
DROP TABLE: removes a table from a database.
SQL: CREATE TABLE Statement
Things to consider before you create your table are:
The type of data
the table name
what column(s) will make up the primary key
the names of the columns
CREATE TABLE statement syntax:
CREATE TABLE <table name>
( field1 datatype ( NOT NULL ),
field2 datatype ( NOT NULL )
);
SQL: Attributes Types
Table 7.6 pg.164
SQL: ALTER TABLE Statement
To add or drop columns on existing tables.
ALTER TABLE statement syntax:
ALTER TABLE <table name>
ADD attr datatype;
or
DROP COLUMN attr;
SQL: DML Commands
INSERT: adds new rows to a table.
UPDATE: modifies one or more attributes.
DELETE: deletes one or more rows from a table.
SQL: INSERT Statement
To insert a row into a table, it is necessary to
have a value for each attribute, and order matters.
INSERT statement syntax:
INSERT into <table name>
VALUES ('value1', 'value2', NULL);
Example: INSERT into FoodCart
VALUES (’02/26/08', ‘pizza', 70 );
FoodCart
70pizza02/26/08
500hotdog02/26/08
350pizza02/25/08
soldfooddate
500hotdog02/26/08
350pizza02/25/08
soldfooddate
SQL: UPDATE Statement
To update the content of the table:
UPDATE statement syntax:
UPDATE <table name> SET <attr> = <value>
WHERE <selection condition>;
Example: UPDATE FoodCart SET sold = 349
WHERE date = ’02/25/08’ AND food = ‘pizza’;
FoodCart
70pizza02/26/08
500hotdog02/26/08
350pizza02/25/08
soldfooddate
70pizza02/26/08
500hotdog02/26/08
349pizza02/25/08
soldfooddate
SQL: DELETE Statement
To delete rows from the table:
DELETE statement syntax:
DELETE FROM <table name>
WHERE <condition>;
Example: DELETE FROM FoodCart
WHERE food = ‘hotdog’;
FoodCart
Note: If the WHERE clause is omitted all rows of data are deleted from the table.
70pizza02/26/08
500hotdog02/26/08
349pizza02/25/08
soldfooddate
70pizza02/26/08
349pizza02/25/08
soldfooddate
SQL Statements, Operations, Clauses
SQL Statements:
Select
SQL Operations:
Join
Left Join
Right Join
Like
SQL Clauses:
Order By
Group By
Having
SQL: SELECT
StatementA basic SELECT statement includes 3 clauses
SELECT <attribute name> FROM <tables> WHERE <condition>
SELECT
Specifies the
attributes that are
part of the
resulting relation
FROM
Specifies the
tables that serve
as the input to the
statement
WHERE
Specifies the
selection condition,
including the join
condition.
Using a “*” in a select statement indicates that
every attribute of the input table is to be
selected.
Example: SELECT * FROM … WHERE …;
SQL: SELECT Statement (cont.)
Example:
Person
8034Peter
5454Helena
7029George
6428Sally
8034Harry
WeightAgeName
8034Peter
5454Helena
8034Harry
WeightAgeName
80
54
80
Weight
1) SELECT *
FROM person
WHERE age > 30;
2) SELECT weight
FROM person
WHERE age > 30;
3) SELECT distinct
weight
FROM person
WHERE age > 30;
54
80
Weight
SQL: Join operation
A join can be specified in the FROM clause
which list the two input relations and the
WHERE clause which lists the join condition.
Example:
Biotech1003
Sales1002
IT1001
DivisionID
TN1002
MA1001
CA1000
StateID
Emp Dept
SQL: Join operation (cont.)
Sales1002
IT1001
Dept.DivisionDept.ID
TN1002
MA1001
Emp.StateEmp.ID
inner join = join
SELECT *
FROM emp join dept (or FROM emp, dept)
on emp.id = dept.id;
SQL: Join operation (cont.)
IT1001
Sales1002
nullnull
Dept.DivisionDept.ID
CA1000
TN1002
MA1001
Emp.StateEmp.ID
left outer join = left join
SELECT *
FROM emp left join dept
on emp.id = dept.id;
SQL: Join operation (cont.)
Sales1002
Biotech1003
IT1001
Dept.DivisionDept.ID
MA1001
nullnull
TN1002
Emp.StateEmp.ID
right outer join = right join
SELECT *
FROM emp right join dept
on emp.id = dept.id;
SQL: The ORDER BY Clause
Ordered result selection
desc (descending order)
SELECT *
FROM emp
order by state desc
asc (ascending order)
SELECT *
FROM emp
order by id asc
SQL: The GROUP BY Clause
The function to divide the tuples into groups and
returns an aggregate for each group.
Usually, it is an aggregate function’s companion
SELECT food, sum(sold) as totalSold
FROM FoodCart
group by food;
FoodCart
419pizza
500hotdog
totalSoldfood
70pizza02/26/08
500hotdog02/26/08
349pizza02/25/08
soldfooddate
Thank You
Created By :
Chandan
Pawar

More Related Content

What's hot

Database Systems - SQL - DDL Statements (Chapter 3/2)
Database Systems - SQL - DDL Statements (Chapter 3/2)Database Systems - SQL - DDL Statements (Chapter 3/2)
Database Systems - SQL - DDL Statements (Chapter 3/2)
Vidyasagar Mundroy
 
Sql basic best-course-in-mumbai
Sql basic best-course-in-mumbaiSql basic best-course-in-mumbai
Sql basic best-course-in-mumbai
vibrantuser
 
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
Dan D'Urso
 
Chapter 07 ddl_sql
Chapter 07 ddl_sqlChapter 07 ddl_sql
Chapter 07 ddl_sql
Nazir Ahmed
 
SQL Tutorial for BCA-2
SQL Tutorial for BCA-2SQL Tutorial for BCA-2
SQL Tutorial for BCA-2
Raj vardhan
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
DataminingTools Inc
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
Ehsan Hamzei
 
DDL,DML,SQL Functions and Joins
DDL,DML,SQL Functions and JoinsDDL,DML,SQL Functions and Joins
DDL,DML,SQL Functions and JoinsAshwin Dinoriya
 
Sql ch 13 - sql-views
Sql ch 13 - sql-viewsSql ch 13 - sql-views
Sql ch 13 - sql-views
Mukesh Tekwani
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
Rumman Ansari
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
Sabana Maharjan
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
Hammad Rasheed
 
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
Vibrant Technologies & Computers
 
Oracle: Basic SQL
Oracle: Basic SQLOracle: Basic SQL
Oracle: Basic SQL
DataminingTools Inc
 

What's hot (19)

Database Systems - SQL - DDL Statements (Chapter 3/2)
Database Systems - SQL - DDL Statements (Chapter 3/2)Database Systems - SQL - DDL Statements (Chapter 3/2)
Database Systems - SQL - DDL Statements (Chapter 3/2)
 
Sql basic best-course-in-mumbai
Sql basic best-course-in-mumbaiSql basic best-course-in-mumbai
Sql basic best-course-in-mumbai
 
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
 
Chapter 07 ddl_sql
Chapter 07 ddl_sqlChapter 07 ddl_sql
Chapter 07 ddl_sql
 
Ddl commands
Ddl commandsDdl commands
Ddl commands
 
SQL Tutorial for BCA-2
SQL Tutorial for BCA-2SQL Tutorial for BCA-2
SQL Tutorial for BCA-2
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Sql basics
Sql  basicsSql  basics
Sql basics
 
DDL,DML,SQL Functions and Joins
DDL,DML,SQL Functions and JoinsDDL,DML,SQL Functions and Joins
DDL,DML,SQL Functions and Joins
 
Sql ch 13 - sql-views
Sql ch 13 - sql-viewsSql ch 13 - sql-views
Sql ch 13 - sql-views
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
SQL Server Views
SQL Server ViewsSQL Server Views
SQL Server Views
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
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
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
Oracle: Basic SQL
Oracle: Basic SQLOracle: Basic SQL
Oracle: Basic SQL
 

Viewers also liked

MySql Triggers Tutorial - The Webs Academy
MySql Triggers Tutorial - The Webs AcademyMySql Triggers Tutorial - The Webs Academy
MySql Triggers Tutorial - The Webs Academy
thewebsacademy
 
My sql presentation
My sql presentationMy sql presentation
My sql presentationNikhil Jain
 
Spring presentation By Chandan Sharma
Spring presentation By Chandan Sharma Spring presentation By Chandan Sharma
Spring presentation By Chandan Sharma
Navin Agarwal
 
working with database using mysql
working with database using mysql working with database using mysql
working with database using mysql
Subhasis Nayak
 
Stakeholder engagement by chandan
Stakeholder engagement by chandanStakeholder engagement by chandan
Stakeholder engagement by chandan
Chandan Shirbhayye
 
Soil pollution presentation
Soil pollution presentationSoil pollution presentation
Soil pollution presentationjumans alkiyumi
 
ISAS On SQL Features like Trigger, Transaction,Batches, Stored Procedure
ISAS On SQL Features like Trigger, Transaction,Batches, Stored ProcedureISAS On SQL Features like Trigger, Transaction,Batches, Stored Procedure
ISAS On SQL Features like Trigger, Transaction,Batches, Stored Procedure
Shubham Choudahry
 
User Defined Functions
User Defined FunctionsUser Defined Functions
User Defined Functions
Praveen M Jigajinni
 
Chandan singh seminar report pdf.......router
Chandan singh seminar report pdf.......routerChandan singh seminar report pdf.......router
Chandan singh seminar report pdf.......router
Chandan Singh
 
PL/SQL User-Defined Functions in the Read World
PL/SQL User-Defined Functions in the Read WorldPL/SQL User-Defined Functions in the Read World
PL/SQL User-Defined Functions in the Read World
Michael Rosenblum
 
user defined function
user defined functionuser defined function
user defined function
King Kavin Patel
 
Part 15 triggerr
Part 15  triggerrPart 15  triggerr
Part 15 triggerr
Denny Yahya
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in C
Harendra Singh
 
MySQL
MySQLMySQL
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQL
Giuseppe Maxia
 

Viewers also liked (20)

MySql Triggers Tutorial - The Webs Academy
MySql Triggers Tutorial - The Webs AcademyMySql Triggers Tutorial - The Webs Academy
MySql Triggers Tutorial - The Webs Academy
 
My sql presentation
My sql presentationMy sql presentation
My sql presentation
 
Spring presentation By Chandan Sharma
Spring presentation By Chandan Sharma Spring presentation By Chandan Sharma
Spring presentation By Chandan Sharma
 
working with database using mysql
working with database using mysql working with database using mysql
working with database using mysql
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
Stakeholder engagement by chandan
Stakeholder engagement by chandanStakeholder engagement by chandan
Stakeholder engagement by chandan
 
Soil pollution presentation
Soil pollution presentationSoil pollution presentation
Soil pollution presentation
 
ISAS On SQL Features like Trigger, Transaction,Batches, Stored Procedure
ISAS On SQL Features like Trigger, Transaction,Batches, Stored ProcedureISAS On SQL Features like Trigger, Transaction,Batches, Stored Procedure
ISAS On SQL Features like Trigger, Transaction,Batches, Stored Procedure
 
User defined functions
User defined functionsUser defined functions
User defined functions
 
User Defined Functions
User Defined FunctionsUser Defined Functions
User Defined Functions
 
SPRING SEASON
SPRING SEASONSPRING SEASON
SPRING SEASON
 
My sql.ppt
My sql.pptMy sql.ppt
My sql.ppt
 
Chandan singh seminar report pdf.......router
Chandan singh seminar report pdf.......routerChandan singh seminar report pdf.......router
Chandan singh seminar report pdf.......router
 
PL/SQL User-Defined Functions in the Read World
PL/SQL User-Defined Functions in the Read WorldPL/SQL User-Defined Functions in the Read World
PL/SQL User-Defined Functions in the Read World
 
user defined function
user defined functionuser defined function
user defined function
 
Part 15 triggerr
Part 15  triggerrPart 15  triggerr
Part 15 triggerr
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in C
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
MySQL
MySQLMySQL
MySQL
 
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQL
 

Similar to Sql presentation 1 by chandan

SQL.ppt
SQL.pptSQL.ppt
SQL.ppt
Ranjit273515
 
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
 
Sql basic things
Sql basic thingsSql basic things
Sql basic things
Nishil Jain
 
SQL Query
SQL QuerySQL Query
SQL Query
Imam340267
 
Lab
LabLab
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
HudaRaghibKadhim
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
VENNILAV6
 
Sql overview-1232931296681161-1
Sql overview-1232931296681161-1Sql overview-1232931296681161-1
Sql overview-1232931296681161-1sagaroceanic11
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
Tony Wong
 
Structured Query Language (SQL).pptx
Structured Query Language (SQL).pptxStructured Query Language (SQL).pptx
Structured Query Language (SQL).pptx
EllenGracePorras
 
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
jainendraKUMAR55
 
chapter 8 SQL.ppt
chapter 8 SQL.pptchapter 8 SQL.ppt
chapter 8 SQL.ppt
YitbarekMurche
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
PavithSingh
 
Oraclesql
OraclesqlOraclesql
Oraclesql
Priya Goyal
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql newSANTOSH RATH
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
TamiratDejene1
 
SQL-SHORT-NOTES.pptx
SQL-SHORT-NOTES.pptxSQL-SHORT-NOTES.pptx
SQL-SHORT-NOTES.pptx
PratheeshKumarN
 

Similar to Sql presentation 1 by chandan (20)

SQL.ppt
SQL.pptSQL.ppt
SQL.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...
 
Sql basic things
Sql basic thingsSql basic things
Sql basic things
 
SQL Query
SQL QuerySQL Query
SQL Query
 
Lab
LabLab
Lab
 
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
 
Sql overview-1232931296681161-1
Sql overview-1232931296681161-1Sql overview-1232931296681161-1
Sql overview-1232931296681161-1
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
 
Query
QueryQuery
Query
 
Structured Query Language (SQL).pptx
Structured Query Language (SQL).pptxStructured Query Language (SQL).pptx
Structured Query Language (SQL).pptx
 
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
 
chapter 8 SQL.ppt
chapter 8 SQL.pptchapter 8 SQL.ppt
chapter 8 SQL.ppt
 
Hira
HiraHira
Hira
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
lovely
lovelylovely
lovely
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
 
SQL-SHORT-NOTES.pptx
SQL-SHORT-NOTES.pptxSQL-SHORT-NOTES.pptx
SQL-SHORT-NOTES.pptx
 

Recently uploaded

Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 

Recently uploaded (20)

Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 

Sql presentation 1 by chandan

  • 1. Well come,,,,,,,,,Chandan Pawar SQL Server MS SQL Server is a database server Product of Microsoft Enables user to write queries and other SQL statements and execute them
  • 3. The ANSI standard language for the definition and manipulation of relational database. Includes data definition language (DDL), statements that specify and modify database schemas. Includes a data manipulation language (DML), statements that manipulate database content. Structured Query Language (SQL)
  • 4. SQL: DDL Commands CREATE TABLE: used to create a table. ALTER TABLE: modifies a table after it was created. DROP TABLE: removes a table from a database.
  • 5. SQL: CREATE TABLE Statement Things to consider before you create your table are: The type of data the table name what column(s) will make up the primary key the names of the columns CREATE TABLE statement syntax: CREATE TABLE <table name> ( field1 datatype ( NOT NULL ), field2 datatype ( NOT NULL ) );
  • 7. SQL: ALTER TABLE Statement To add or drop columns on existing tables. ALTER TABLE statement syntax: ALTER TABLE <table name> ADD attr datatype; or DROP COLUMN attr;
  • 8. SQL: DML Commands INSERT: adds new rows to a table. UPDATE: modifies one or more attributes. DELETE: deletes one or more rows from a table.
  • 9. SQL: INSERT Statement To insert a row into a table, it is necessary to have a value for each attribute, and order matters. INSERT statement syntax: INSERT into <table name> VALUES ('value1', 'value2', NULL); Example: INSERT into FoodCart VALUES (’02/26/08', ‘pizza', 70 ); FoodCart 70pizza02/26/08 500hotdog02/26/08 350pizza02/25/08 soldfooddate 500hotdog02/26/08 350pizza02/25/08 soldfooddate
  • 10. SQL: UPDATE Statement To update the content of the table: UPDATE statement syntax: UPDATE <table name> SET <attr> = <value> WHERE <selection condition>; Example: UPDATE FoodCart SET sold = 349 WHERE date = ’02/25/08’ AND food = ‘pizza’; FoodCart 70pizza02/26/08 500hotdog02/26/08 350pizza02/25/08 soldfooddate 70pizza02/26/08 500hotdog02/26/08 349pizza02/25/08 soldfooddate
  • 11. SQL: DELETE Statement To delete rows from the table: DELETE statement syntax: DELETE FROM <table name> WHERE <condition>; Example: DELETE FROM FoodCart WHERE food = ‘hotdog’; FoodCart Note: If the WHERE clause is omitted all rows of data are deleted from the table. 70pizza02/26/08 500hotdog02/26/08 349pizza02/25/08 soldfooddate 70pizza02/26/08 349pizza02/25/08 soldfooddate
  • 12. SQL Statements, Operations, Clauses SQL Statements: Select SQL Operations: Join Left Join Right Join Like SQL Clauses: Order By Group By Having
  • 13. SQL: SELECT StatementA basic SELECT statement includes 3 clauses SELECT <attribute name> FROM <tables> WHERE <condition> SELECT Specifies the attributes that are part of the resulting relation FROM Specifies the tables that serve as the input to the statement WHERE Specifies the selection condition, including the join condition.
  • 14. Using a “*” in a select statement indicates that every attribute of the input table is to be selected. Example: SELECT * FROM … WHERE …; SQL: SELECT Statement (cont.)
  • 15. Example: Person 8034Peter 5454Helena 7029George 6428Sally 8034Harry WeightAgeName 8034Peter 5454Helena 8034Harry WeightAgeName 80 54 80 Weight 1) SELECT * FROM person WHERE age > 30; 2) SELECT weight FROM person WHERE age > 30; 3) SELECT distinct weight FROM person WHERE age > 30; 54 80 Weight
  • 16. SQL: Join operation A join can be specified in the FROM clause which list the two input relations and the WHERE clause which lists the join condition. Example: Biotech1003 Sales1002 IT1001 DivisionID TN1002 MA1001 CA1000 StateID Emp Dept
  • 17. SQL: Join operation (cont.) Sales1002 IT1001 Dept.DivisionDept.ID TN1002 MA1001 Emp.StateEmp.ID inner join = join SELECT * FROM emp join dept (or FROM emp, dept) on emp.id = dept.id;
  • 18. SQL: Join operation (cont.) IT1001 Sales1002 nullnull Dept.DivisionDept.ID CA1000 TN1002 MA1001 Emp.StateEmp.ID left outer join = left join SELECT * FROM emp left join dept on emp.id = dept.id;
  • 19. SQL: Join operation (cont.) Sales1002 Biotech1003 IT1001 Dept.DivisionDept.ID MA1001 nullnull TN1002 Emp.StateEmp.ID right outer join = right join SELECT * FROM emp right join dept on emp.id = dept.id;
  • 20. SQL: The ORDER BY Clause Ordered result selection desc (descending order) SELECT * FROM emp order by state desc asc (ascending order) SELECT * FROM emp order by id asc
  • 21. SQL: The GROUP BY Clause The function to divide the tuples into groups and returns an aggregate for each group. Usually, it is an aggregate function’s companion SELECT food, sum(sold) as totalSold FROM FoodCart group by food; FoodCart 419pizza 500hotdog totalSoldfood 70pizza02/26/08 500hotdog02/26/08 349pizza02/25/08 soldfooddate
  • 22. Thank You Created By : Chandan Pawar

Editor's Notes

  1. DDL includes statements like: CREATE TABLE ALTER TABLE DROP TABLE CREATE INDEX DML includes statements like: INSERT UPDATE DELETE
  2. Blob- binary long object clob – character long object
  3. The default ordering of the ORDER BY clause is by ascending order A-Z.