Android apps to use in appium android test examples


Sunday, May 20, 2018

SQL Tutorial 6: Data Manipulation Language

SQL Tutorial 6: Data Manipulation Language

Data Manipulation Language (DML) is a ane of the Subset of SQL, others are,

i) Data definition Language
ii) Data Control Language etc...

Database Engine is required to practice/execute SQL Commands...

Database Engine either Oracle or MS SQL Server or mySQL etc...

I installed MS SQL Server Express Edition, It is gratis Software for Small scale
organizations, you lot tin purpose whatever other Database Engine also, anyhow Most of the
SQL Commands are mutual for all RDBMS....

Data Manipulation Language commands are used to store, modify, retrieve, too delete data from database tables. In this category nosotros accept Select, Insert, Update, Delete Commands....
Important Data manipulation linguistic communication Commands are,

1) SELECT – Retrieves information from a table
2) INSERT –  Inserts information into a table
3) UPDATE – Updates existing information into a table
4) DELETE – Deletes all records from a table

In Order to practice/use SQL DML Commands, showtime I do a Database, a Table and these  are SQL DDL Operations (we accept to purpose DDL Commands)...

Next Insert records inwards to the table, It is DML Operation...


---Create a Database, table, too insert records...
Create database gcreddy;

Use gcreddy;
Create tabular array abcd(
Id int,
Name varchar (40),
City varchar (30),

Insert Into abcd 
(Id, Name, City)
values (1, 'G C Reddy', 'Hyderabad');

Insert Into abcd 
(Id, Name, City)
values (2, 'Mahith', 'Nellore');
Data manipulation Commands,

1) Select: The SELECT Statement is used to direct information from a database. The result 
is stored inwards a effect table, called the result-set.

The SELECT ascendance is the close usually used ascendance inwards SQL. It allows database 
users to hollo upward the specific information they wishing from an operational database.

/* Select Syntax

Select colomn1, column2, ...
From Table_Name;

Select * From Table_Name; */

Select Id, Name From abcd;

Select * From abcd;
2) Insert: The INSERT INTO Statement is used to insert novel records inwards a table. We 
can insert information to a tabular array inwards ii ways,

INSERT INTO table_name (column1, column2 ...)
VALUES (value1, value2, ...);

Insert Into abcd (Id, Name, City) 
values(4, 'Vijaya', 'Kavali');
Insert Data Only inwards Specified Columns

Insert Into abcd (Name)
values ('Cinnu');
Note: If you lot insert specified column entirely therefore remaining columns are Null...
3) Update: The UPDATE contention is used to update existing records inwards a table.


UPDATE table_name

SET column1=value, column2=value2,...
WHERE some_column=some_value


Update abcd
Set Name = 'Venkat', City = 'Mumbai'
Where Id = 1;
4) Delete: The SQL DELETE Query is used to delete the existing records from a table. 
You tin purpose WHERE clause amongst DELETE enquiry to delete selected rows, 
otherwise all the records would last deleted.

Syntax: DELETE FROM table_name [WHERE condition];


Delete From abcd
Where Id = 4;

Delete From abcd;


No comments:

Post a Comment