Todays Sqlnotes
Todays Sqlnotes
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 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
Data Base
Base-2
SQL Commands:
SQL Commands
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
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
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;
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).