0% found this document useful (0 votes)
34 views

Todays Sqlnotes

This document discusses database testing and SQL queries. It provides an overview of how data entered in the frontend is stored in a database. It then covers key concepts about databases including how they organize data and SQL is used to access and manipulate the data. The main SQL commands are described as DDL for structure changes, DML for data changes, DCL for user authorization, and DQL for data retrieval. Example SQL queries are provided for creating tables, inserting data, describing tables and selecting data with optional WHERE clauses.

Uploaded by

Amol
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Todays Sqlnotes

This document discusses database testing and SQL queries. It provides an overview of how data entered in the frontend is stored in a database. It then covers key concepts about databases including how they organize data and SQL is used to access and manipulate the data. The main SQL commands are described as DDL for structure changes, DML for data changes, DCL for user authorization, and DQL for data retrieval. Example SQL queries are provided for creating tables, inserting data, describing tables and selecting data with optional WHERE clauses.

Uploaded by

Amol
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Database Testing/ Backend Testing

Till now we have seen how to test the application from the Front-End
nd side(UI
side side) in
that we have covered Functional and Non Functional part.

Now will see how to test the data which were entered from UI side and that will be
stored in the Data Base.

Data loading into Database-

Data Base-1
Base

Server

Software/Application

Data Base-2

Database:
 A database is an organized collection of data
data,, so that it can be easily accessed and
managed.
 The main purpose of the database is to operate a large amount of information by
storing, retrieving, and managing data.
 We can organize data into tables, rows, columns, and index it to make it easier to
find relevant information. While manipulating the data.
 So for accessing the data we need to understand special language which is known
as SQL that can be easily manipulate the data with the predefine set of syntax.

SQL:
 SQL stands for Structured Query Language
Language.
 It is a database computer language designed for the retrieval
val and management of
data from the database. Also it is not a Case Sensitive Language.
 SQL is the standard language for Relational Database System.. All the Relational
Database Management Systems (RDMS) like MySQL, MS Access, Oracle, Oracle Sybase,
Informix, Postgres and SQL Server use SQL as their standard database language.
language
Data Base-1
SQL Server

Language that can retrieve


and manage the data from
Software/Application the database

Data Base
Base-2

SQL Commands:

 SQL commands are instructions


instructions.. It is used to communicate with the database. It is
also used to perform specific tasks, functions, and queries of data.
 SQL can perform various tasks like create a table, add data to tables, drop the
table, modify the table etc.

Types of SQL Commands-

SQL Commands

DDL (Data Definition Language)):

DDL changes the structure of the table like creating a table, deleting a table, altering a
table, etc.
All the command of DDL are auto-committed that means it permanently save all the
changes in the database.
Some commands that come under DDL:
 CREATE
 ALTER
 DROP
 TRUNCATE

DML(Data Manipulation Language):


DML commands are used to modify the database. It is responsible for all form of
changes in the database.

The command of DML is not auto-committed that means it can't permanently save all
the changes in the database. They can be rollback.
Some commands that come under DML:
 INSERT
 UPDATE
 DELETE

DCL(Data Control Language):


DCL commands are used to grant and take back authority from any database user.
Some commands that come under DCL:
 Grant
 Revoke

TCL(Transaction Control Language)


TCL commands can only use with DML commands like INSERT, DELETE and UPDATE
only.
These operations are automatically committed in the database that's why they
cannot be used while creating tables or dropping them.
Some commands that come under TCL:
 COMMIT
 ROLLBACK
 SAVEPOINT

DQL(Data Query Language):

DQL is used to fetch the data from the database.


It uses only one command:
 SELECT
SQL Queries
1. CREATE- It is a SQL statement used to create new table in database.
SYNTAX-
CREATE TABLE <TABLE NAME> (COLUMN1 DATATYPE (DATASIZE)......);

Ex- If you want to crate a table for the Students Record.


Table Name= Student
Column in Student tables = ID, FirstName, LastName, MobileNumber.

Syntax- CREATE TABLE Student (ID int, FirstName varchar2(10), LastName


varchar2(10), MobileNumber int );

2. INSERT INTO - It is a SQL statement used to insert records in the table.


SYNTAX-
INSERT INTO <TABLE NAME> VALUES (‘VALUE 1’, ‘VALUE 2’, ‘VALUE 3’, ‘VALUE4’);
Or
INSERT INTO <TABLE NAME> < COLOUMN NAME> (COL-1, COL-2, COL-3, COL-4 )
VALUES (‘VALUE 1’, ‘VALUE 2’, ‘VALUE 3’, ‘VALUE4’);

Ex- If you want to crate a table for the Students Record.


Table Name= Student
Column in Student tables = ID, FirstName, LastName, MobileNumber.
Values = 1, Ashish, Tayade, 1234567890

INSERT INTO Student VALUES (‘1’, ‘Ashish’, ‘Tayade’, ‘1234567890’);


Or
INSERT INTO Student (ID, FirstName, LastName, MobileNumber ) VALUES (‘1’,
‘Ashish’, ‘Tayade’, ‘1234567890’);

Note: If we don’t provide the column name with its value then the value for that
column is set to NULL.

Task : Create your own database which consist of all the student information
from 12Feb 2022 morning batch.
3. DESCRIBE– it is a SQL statement used to describe the structure of the table.
SYNTAX- DESC <TABLE NAME>;
EX- DESC student;

4. SELECT- It is a SQL statement used to fetch a data, columns data/whole table data
from database/table.
SELECT * = Select all data from the table.
SYNTAX- SELECT *FROM <TABLE NAME>;
EX- SELECT * FROM Student;

5. SELECT COLUMN – It is a SQL statement used to fetch data of particular column


data from the table.
SYNTAX-
SELECT <COLUMN NAME> FROM <TABLE NAME>;
Ex- SELECT FirstName FROM Student; SELECT ID, FirstName FROM Student;

6. SELECT WITH (WHERE CLAUSE) – It is a SQL statement used to select particular


record from table using where clause.
WHERE CLAUSE- It is SQL statement used to extract those records which fulfil the
condition.
SYNTAX-
SELECT *FROM <TABLE NAME> WHERE <COLUMN NAME>= ‘DATA VALUE’;
Ex- SELECT * FROM STUDENT WHERE FirstName = ‘Ashish’;

7. SELECT COLUMN WITH (WHERE CLAUSE)- It is a SQL statement used to fetch data
of particular column data from the table along with it extract those records which
fulfil the desired condition.
SYNTAX-
SELECT <Column>FROM <TABLE NAME> WHERE <COLUMN NAME>= ‘DATA
VALUE’;
Ex- SELECT ID, FirstName FROM STUDENT WHERE FirstName = ‘Ashish’;

8. SELECT WITH (WHERE CLAUSE + AND)- It is a SQL statement used to fetch data of
particular data from the table along with it extract those records which fulfil the
desired condition (i.e AND Condition).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy