Class 10 IT Chapter- Database Management Topic- What is DML in SQL - Arvindzeclass - NCERT Solutions

Post Top Ad

Saturday, June 19, 2021

Class 10 IT Chapter- Database Management Topic- What is DML in SQL


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

-------------------------------------------------

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.)


--------------------------------------------------
 Chapters of Class 10 IT (402) 

Part - A

 
Part - B 

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

--------------------------------------------------
MCQs of All Chapters Class 10 IT (402) 

Part - A

Chapter 4 - Entrepreneurship
Chapter 5 –Green Skills
 
Part - B 

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

-------------------------------------------------


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

-------------------------------------------------

No comments:

Post a Comment

Post Top Ad