SlideShare a Scribd company logo
1 of 6
Quality Assurance /
Software Testing Training
SQL
Page 2Classification: Restricted
Agenda
• SQL
Page 3Classification: Restricted
SQL
SQL is a database computer language designed for the retrieval and management of data in relational database. SQL stands for
Structured Query Language.
DDL Command
Data Definition Language (DDL) is a standard for commands that define the different structures in a database. DDL
statements create, modify, and remove database objects such as tables, and users. Common DDL statements are CREATE,
ALTER, and DROP.
• CREATE - to create objects in the database
CREATE TABLE table_name
(
column_name1 data_type(size),
column_name2 data_type(size),
column_name3 data_type(size),
);
• ALTER - alters the structure of the database
ALTER TABLE table_name
ADD column_name datatype
• DROP - delete objects from the database
DROP INDEX index_name ON table_name
• TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
TRUNCATE TABLE table_name
• COMMENT - add comments to the data dictionary
--Select all:
SELECT * FROM Customers;
• RENAME - rename an object
Alter table Stu_Table rename to Stu_Table_10
Page 4Classification: Restricted
DML Command
DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert
and update data in database. Examples: SELECT, UPDATE, INSERT statements.
• SELECT - retrieve data from the a database
SELECT * FROM table_name;)
• INSERT - insert data into a table
INSERT INTO table_name VALUES (value1,value2,value3,...);
• UPDATE - updates existing data within a table
UPDATE table_name
SET column1=value1,column2=value2,...
WHERE some_column=some_value;
• DELETE - deletes all records from a table, the space for the records remain
DELETE FROM table_name
WHERE some_column=some_value;
• MERGE - UPSERT operation (insert or update)
Page 5Classification: Restricted
DCL Command
Data Control Language (DCL) statements. Some examples:
• GRANT - gives user's access privileges to database
GRANT privilege_name
ON object_name
TO {user_name |PUBLIC |role_name}
[WITH GRANT OPTION];
• REVOKE - withdraw access privileges given with the GRANT command
REVOKE privilege_name
ON object_name
FROM {user_name |PUBLIC |role_name}
SQL Joins
An SQL JOIN clause is used to combine rows from two or more tables, based on a common field
between them.
The most common type of join is: SQL INNER JOIN (simple join). An SQL INNER JOIN returns all rows
from multiple tables where the join condition is met.
(Refer: http://www.w3schools.com/sql/sql_join.asp)
SELECT Table1.Column1_name, Table2.Columns2_Name, Table1.Column2_name
FROM Table1
INNER JOIN Table2
ON Table2.Column2_name=Table1.Column_name;
Page 6Classification: Restricted
Thank You

More Related Content

What's hot

SQL: Structured Query Language
SQL: Structured Query LanguageSQL: Structured Query Language
SQL: Structured Query Language
Rohit Bisht
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
Tony Wong
 

What's hot (20)

IM02: Database Language
IM02: Database LanguageIM02: Database Language
IM02: Database Language
 
SQL: Structured Query Language
SQL: Structured Query LanguageSQL: Structured Query Language
SQL: Structured Query Language
 
SQL Tutorial - How To Create, Drop, and Truncate Table
SQL Tutorial - How To Create, Drop, and Truncate TableSQL Tutorial - How To Create, Drop, and Truncate Table
SQL Tutorial - How To Create, Drop, and Truncate Table
 
Sql and Sql commands
Sql and Sql commandsSql and Sql commands
Sql and Sql commands
 
8. sql
8. sql8. sql
8. sql
 
Oracle 11g SQL Overview
Oracle 11g SQL OverviewOracle 11g SQL Overview
Oracle 11g SQL Overview
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
Data manipulation language
Data manipulation languageData manipulation language
Data manipulation language
 
Introduction to mysql part 1
Introduction to mysql part 1Introduction to mysql part 1
Introduction to mysql part 1
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
 
PT- Oracle session01
PT- Oracle session01 PT- Oracle session01
PT- Oracle session01
 
An intoduction to sql and its components
An intoduction to sql and its componentsAn intoduction to sql and its components
An intoduction to sql and its components
 
Data Ware Housing through SQL concept
Data Ware Housing through SQL conceptData Ware Housing through SQL concept
Data Ware Housing through SQL concept
 
Group Members
Group MembersGroup Members
Group Members
 
STRUCTURED QUERY LANGUAGE
STRUCTURED QUERY LANGUAGESTRUCTURED QUERY LANGUAGE
STRUCTURED QUERY LANGUAGE
 
Lab2 ddl commands
Lab2 ddl commandsLab2 ddl commands
Lab2 ddl commands
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database Fundamental
 
Database Systems - SQL - DCL Statements (Chapter 3/4)
Database Systems - SQL - DCL Statements (Chapter 3/4)Database Systems - SQL - DCL Statements (Chapter 3/4)
Database Systems - SQL - DCL Statements (Chapter 3/4)
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
Sql – pocket guide
Sql – pocket guideSql – pocket guide
Sql – pocket guide
 

Similar to SQL

hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
EliasPetros
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
EliasPetros
 

Similar to SQL (20)

Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
 
Unit - II.pptx
Unit - II.pptxUnit - II.pptx
Unit - II.pptx
 
ppt.pdf
ppt.pdfppt.pdf
ppt.pdf
 
Himani uppal-221302130 WP ppt.pptx
Himani uppal-221302130  WP ppt.pptxHimani uppal-221302130  WP ppt.pptx
Himani uppal-221302130 WP ppt.pptx
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL
 
COMMANDS PPT(1).pdf
COMMANDS PPT(1).pdfCOMMANDS PPT(1).pdf
COMMANDS PPT(1).pdf
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
Sql
SqlSql
Sql
 
Relational Database Language.pptx
Relational Database Language.pptxRelational Database Language.pptx
Relational Database Language.pptx
 
sql.pptx
sql.pptxsql.pptx
sql.pptx
 
SQL_NOTES.pdf
SQL_NOTES.pdfSQL_NOTES.pdf
SQL_NOTES.pdf
 
SQL-SHORT-NOTES.pptx
SQL-SHORT-NOTES.pptxSQL-SHORT-NOTES.pptx
SQL-SHORT-NOTES.pptx
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
lovely
lovelylovely
lovely
 
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL I
 
Lab
LabLab
Lab
 

More from Rajesh-QA

More from Rajesh-QA (12)

JIRA
JIRAJIRA
JIRA
 
Selenium - Installation
Selenium - InstallationSelenium - Installation
Selenium - Installation
 
Test Case Design & Technique
Test Case Design & TechniqueTest Case Design & Technique
Test Case Design & Technique
 
Tool Evaluation
Tool EvaluationTool Evaluation
Tool Evaluation
 
Test Strategies and Planning
Test Strategies and PlanningTest Strategies and Planning
Test Strategies and Planning
 
SDLC
SDLCSDLC
SDLC
 
Testing Concepts and Manual Testing
Testing Concepts and Manual TestingTesting Concepts and Manual Testing
Testing Concepts and Manual Testing
 
Introduction to Software Testing
Introduction to Software TestingIntroduction to Software Testing
Introduction to Software Testing
 
Agile
AgileAgile
Agile
 
Types of Testing
Types of TestingTypes of Testing
Types of Testing
 
Testing Management
Testing ManagementTesting Management
Testing Management
 
Introduction to Software Testing Part 2
Introduction to Software Testing Part 2Introduction to Software Testing Part 2
Introduction to Software Testing Part 2
 

Recently uploaded

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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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)

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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
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
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
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
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
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
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

SQL

  • 1. Quality Assurance / Software Testing Training SQL
  • 3. Page 3Classification: Restricted SQL SQL is a database computer language designed for the retrieval and management of data in relational database. SQL stands for Structured Query Language. DDL Command Data Definition Language (DDL) is a standard for commands that define the different structures in a database. DDL statements create, modify, and remove database objects such as tables, and users. Common DDL statements are CREATE, ALTER, and DROP. • CREATE - to create objects in the database CREATE TABLE table_name ( column_name1 data_type(size), column_name2 data_type(size), column_name3 data_type(size), ); • ALTER - alters the structure of the database ALTER TABLE table_name ADD column_name datatype • DROP - delete objects from the database DROP INDEX index_name ON table_name • TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed TRUNCATE TABLE table_name • COMMENT - add comments to the data dictionary --Select all: SELECT * FROM Customers; • RENAME - rename an object Alter table Stu_Table rename to Stu_Table_10
  • 4. Page 4Classification: Restricted DML Command DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database. Examples: SELECT, UPDATE, INSERT statements. • SELECT - retrieve data from the a database SELECT * FROM table_name;) • INSERT - insert data into a table INSERT INTO table_name VALUES (value1,value2,value3,...); • UPDATE - updates existing data within a table UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value; • DELETE - deletes all records from a table, the space for the records remain DELETE FROM table_name WHERE some_column=some_value; • MERGE - UPSERT operation (insert or update)
  • 5. Page 5Classification: Restricted DCL Command Data Control Language (DCL) statements. Some examples: • GRANT - gives user's access privileges to database GRANT privilege_name ON object_name TO {user_name |PUBLIC |role_name} [WITH GRANT OPTION]; • REVOKE - withdraw access privileges given with the GRANT command REVOKE privilege_name ON object_name FROM {user_name |PUBLIC |role_name} SQL Joins An SQL JOIN clause is used to combine rows from two or more tables, based on a common field between them. The most common type of join is: SQL INNER JOIN (simple join). An SQL INNER JOIN returns all rows from multiple tables where the join condition is met. (Refer: http://www.w3schools.com/sql/sql_join.asp) SELECT Table1.Column1_name, Table2.Columns2_Name, Table1.Column2_name FROM Table1 INNER JOIN Table2 ON Table2.Column2_name=Table1.Column_name;