What is DML (Data Manipulation Language) in SQL?
DML commands
are the most commonly used SQL commands. These are used to manipulate the
existing database. There are main four basic commands:
![]() |
Data Manipulation Language in SQL |
--------------------------------------------------
Other Topic of this Chapter
- Database
- Primary key / Foreign Key
- Create Database in Open Office Base
- Create Table in Open Office Base
- Update Table in Open Office Base
- Create Query in Open Office Base
- Creating Form in Open Office Base
- Report in Open Office Base
- DDL (Data Definition Language)
-
DML (Data Manipulation Language)
-------------------------------------------------
How to use 'Insert' Command in SQL?
We create table
(with create table) to store data into a table Insert command is used.
![]() |
Table - Sport |
Syntax: Insert into <table name> (<column list>)
Values (<list of values>);
1) Omitting column list in Insert clause
When we omit column list in the Insert clause, values listed in the values clause should be according to the order and data type of columns in the table.
Example:
SQL> Insert into Sport
Values (15, 10, ‘Arpit’, ‘Cricket’, ‘A’, 90);
2) using listing column in the Insert clause
You may optionally list the column in Insert clause. This feature is used when we don’t want to supply values for all the columns.
Example:
SQL> Insert into Sport (Roll No, Class, Name, Game)
Values (14, 9, ‘Ravi’, Basketball’);
How to use 'Select' Command in SQL?
The Select
command is used to extract data from the database. It is also called query.
1)Select - - From
- -
This is the
simplest form of Select command. Every
SQL statement starting with keyword Select must include a From clause to specify the source from where data is to be
retrieved.
i) Select All Data from Table
Syntax:
Select
* from <table name>;
Example:
SQL> Select * From
Sport;
(Output: All column will be displayed from table.)
ii) Select Specific column from Table
Syntax:
Select <column list> from <table name>
Example:
SQL> Select Roll No, Name, Marks from Sport;
(Output: Only Roll No, Name, Marks will be displayed from table.)
--------------------------------------------------
Chapter 1 – Digital Documentation
Chapter 2– Electronic Spreadsheet
Chapter 3 – Database Management System
Chapter 4 –Web Application
--------------------------------------------------
How to use 'Order By' phrase in 'Select' command in SQL?
Order by clause is used to display data in ascending or descending order using Select command in SQL
1) Order By ASC:
Syntax: Select
* from <table name> order by <column> ASC;
Example:
SQL> Select * From
Sport order by Name asc;
2) Order By DESC:
Syntax: Select
* from <table name> order by <column> DESC;
Example:
SQL> Select * From
Sport order by Name desc;
How to use 'Distinct' phrase in 'Select' command in SQL?
Distinct clause
is used to avoid getting duplicate data in a table.
Syntax: Select Distinct <column list>
From <table name>;
Example: Select Distinct Game from Sport;
![]() |
Take Reference of Above Table - Sport |
Chapter 1 – Digital Documentation
Chapter 2– Electronic Spreadsheet
Chapter 3 – Database Management System
Chapter 4 –Web Application
How to use 'Where' Clause in 'Select' command in SQL?
‘Where’ clause is the most important clause in SQL commands. It is used to specify a condition when using select command.
Syntax:
Select [Distinct] <column list> from <table name>
Where <condition> ;
Example: SQL> Select * From Sport Where Mark >=75;
How to use Wild Cards in SQL?
Wild Cards are used to specify SELECT
command in SQL. The '_' wild card is used for single character, on the
other hand % wild card for multiple characters.
Example: SQL> Select * From Sport
Where Name like 'A%';
How Math operators are used in 'Select' commands?
![]() |
Table - Shop |
Syntax:
Select <column list>, <column list + column list> from <table name>
Where <condition> ;
Example:
SQL> Select Product ID, Product Name, Price, Quantity, (Price * Quantity) From Shop Where Product ID >=3;
--------------------------------------------------
Sample Paper of Class 10 IT 402
- Sample Paper 2020 - 21
- Sample Paper 2021 - 22
- Sample Paper 2021 - 22
- Sample Paper 2022 - 23
- Sample Paper 2022 - 23
How to use 'Update' command in SQL?
Syntax:
Update <table name>
set <column name> = <value> Where <condition> ;
Example: SQL> Update Shop set Price = 440
Where Product Name = 'Pen';
How to use 'Delete' command in SQL?
Delete command is used to delete a record in a table.
Syntax:
Delete from <table name>
Where <condition> ;
Example: SQL> Delete from Shop
Where Product Name = 'Pen';
What is Function in SQL?
SQL provides inbuilt functions in SQL
Function |
Description |
Count() |
Used to count records |
Avg() |
Used to find Average |
Max() |
Used to find Maximum value |
Min() |
Used to find Minimum value |
Sum() |
Used to find sum in record |
Example: SQL> Select Count(Price) from Sport;
--------------------------------------------------
Sample Paper of Class 10
- English Sample Paper 2022 - 23
- Hindi A Sample Paper 2022 - 23
- Maths (Standard) Sample Paper 2022 - 23
- Maths (Basic) Sample Paper 2022 - 23
- Science Sample Paper 2022 - 23
- Social Science Sample Paper 2022 - 23
No comments:
Post a Comment