Database Testing Using SQL
Database Testing Using SQL
Using SQL
Ahmed Elkholy
01551942560
1|P a g e
Database Testing: this type of testing is very useful if you have an UI
app that modify data and you want to test that UI app.
Select
This query used to show data in the database , and asterisk ( * )
means all in view .
Update
This query used to update data in database (already exist ) , if you
didn’t write WHERE all contact name and address will change into
Elkholy and Alex .
UPADTE Customers
SET ContactName = ‘Elkholy’ , Address =’Alex’
WHERE CustomerID =1 ;
2|P a g e
Insert
This query used to insert data into existing table
INSERT INTO Customers( CustomerName , ContactName , Address ,City ,PostalCode ,Country )
Select Statements
3|P a g e
Order By
This query used to order data during view , DESC means from bigger
to smaller .
Group By
For example if you want to know how many customers from each
country or how many item for each price, Mostly Used with
Aggregate Functions .
Aggregate functions
For example minimum , maximum , average and sum
4|P a g e
Creating a Database
To create a database
CREATE DATABASE Ecommerce ;
To delete a database
DROP DATABASE Ecommerce ;
Creating a Table
To create a table inside a Database, insert data into that table.
5|P a g e
Inner join
6|P a g e