CBSE Class 10 IT – Important SQL Commands using LibreOffice

CBSE Class 10 IT - Important SQL Commands using LibreOffice 2025

In this article we providing information regarding latest CBSE Class 10 IT – All SQL Commands using LibreOffice 2025

CBSE Class 10 IT – Important SQL Commands using LibreOffice 2025

We are Providing CBSE Class 10 Skill Subject – Information Technology (402) Subject Unit – 3 Database Management System (DBMS) – Retrieving Data using SQL (4. Retrieving Data Using Query)

So We discuss all SQL commands Syntax with Example. It will help you in your upcoming Board Examination – 17 March 2025.

So Be Updated with Latest Notes of DBMS using LibreOffice Base.

Structured Query Language (SQL)

  • Note : SQL is case Insensitive. We can write in lowercase as well as in UPPERCASE.

Use Commands Go to Menubar and Select Tools Menu – Select SQL

DDL and DML Commands using in Your LibreOffice Base. (To the Point)

  • DDL stands for Data Definition Language
    • Create Table
    • Drop
    • Alter
  • DML stands for Data Manipulation Language
    • Insert
    • Select
    • Update
    • Delete

Create Table Command

  • This command is used to create a table in a selected database.
Syntax :
  • Create table TableName (ColumnName1 datatype, ColumnName2 datatype);
Example :
  • Create table Class10 (RollNo Integer Primary Key, Name Varchar(20), Marks Integer, Stream Varchar(20));

Insert Into Command

  • The Insert into command is used to insert the rows in a table.
Syntax :
  • Insert Into TableName Values(Value1, Value2,…. Valuen);
  • Above SQL command to insert the Record.

Note : Data values are in the same order as the column names in a table.

Example :
  • Insert Into Class10 Values(1,’Chetan’,80,’Commerce’);

Select Command

  • Select command is used to retrieve a subset of rows or columns from one or more tables.
Syntax:
  • Select column1, column2… <column> from TableName;
Selecting All Columns:
  • If you want to see the entire table, i.e. every column of a table, you need to give a complete list of columns.
  • The asterisk (*) can be substituted to display all columns.
  • Select * From TableName;
Selecting Specific Rows – Where Clause
  • The Where Clause in SELECT statement specifies the criteria for selection of rows to be returned. (Using Relational Operators : =,<,>,<=,>=,<>), Logical Operators (OR ||, AND &&, NOT !)
  • Syntax – Select ColumnName1, ColumnName2 from TableName Where Condition
Example:
  • Select * From Class10;
  • Select Name, Marks from Class10;
  • Select * from Class10 Where Marks>=80;
  • Select * From Class10 Where Stream=’Commerce’; (Write SQL Command to Display records of Commerce Stream Students)
  • Select * from Class10 Where Marks>70 AND Stream=’Commerce’; (Write SQL command to Display records of those students who secured marks more than 70 from Commerce Stream.
  • Select the checkbox : show output of ‘select’ statements. And Execute.
Distinct
  • Distinct command is used to eliminate redundant data.
Syntax:
  • Select Distinct ColumnName from TableName;
Example:
  • Select Distinct Stream from Class10; (Write SQL command to display distinct stream (Repeated values displayed only once.
Condition Based on Range Between Operator
  • This operator defines the range of values that the column values must fall in to make the condition True.
  • The Range includes both the Upper value as well as lower value.
Syntax:
  • Select ColumnName from TableName Where ColumnName Between Start and End;
Example:
  • Select * From Class10 Where Marks Between 60 AND 90;
Condition Based on Pattern Matches (Like Operator)
  • Patterns are described using Two Special Wildcard Characters.
  • Percentage (%) – The % character matches any substring.
  • Underscore (_) – The _ character matches only one character.
Example:
  • Select * from Class10 Where Name Like ‘N%’; (Write SQL Command to display records of students whose Name starts with ‘N”)
  • Select * from Class10 Where Name Like ‘_O%’; (Write SQL command to display records of students whose second alphabet is ‘O’)

Alter Command (Add a Column)

  • Using this command you can add a column.
Syntax:
  • Alter table TableName Add Column ColumnName Datatype Size();
Example:
  • Alter Table Class10 Add Column Gender Char(10); (Write SQL command to Add the Column Gender.)

Update Command

  • Update command is used to update or change the existing values in a table.
Syntax:
  • Update TableName Set ColumnName = NewValue Where Condition;
Example:
  • Update Class10 Set Stream=’Commerce’ Where RollNo=10; (Write SQL command to update the stream of RollNo 10 from Art to Commerce.

Delete Command

  • Delete command is used to delete the rows from a table.
  • It will not delete the structure of a table.
Syntax:
  • Delete from TableName Where Condition;
Example:
  • Delete from Class10 Where RollNo=10; (Write SQL command to delete the record of student having RollNo 10.)

Order By Clause

  • The Oder By Clause allows sorting of query results by one or more column.
Syntax:
  • Select ColumnName from Where Condition Order by ColumnName
Example:
  • Select * From Class10 Oder By Name; (Write SQL command to Display the records in Ascending Order, according to their names, By Default is Asc.) (DESC)

Drop Table Command

  • This command is used to delete the entire table including it’s structure and contents.
Syntax:
  • Drop Table TableName;
Example:
  • Drop Table Class10; (Write SQL Command to Delete Entire Table)

Thanks to Beloved Readers.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *