Simple Machines – Class 5 Free MCQ Test -1

Decimal Quiz - Class 5
Simple Machines – Class 5 Science MCQs

Simple Machines – Class 5 Free MCQ Test

Decimal Quiz - Class 5
Simple Machines – Class 5 Science MCQs

Seeds and Germination – Class 5 Free MCQ Test-1

Decimal Quiz - Class 5
Seeds and Germination – Class 5 Science MCQs

Seeds and Germination – Class 5 Free MCQ Test

Decimal Quiz - Class 5
Seeds and Germination – Class 5 Science MCQs

Food and Health – Class 5 Free MCQ Test -3

Decimal Quiz - Class 5
Food and Health – Class 5 Science MCQs

Food and Health – Class 5 Free MCQ Test -2

Decimal Quiz - Class 5
Food and Health – Class 5 Science MCQs

Food and Health – Class 5 Free MCQ Test

Decimal Quiz - Class 5
Food and Health – Class 5 Science MCQs

Important SQL Commands

Important SQL Commands

 

 

1. CREATE DATABASE

Purpose

Used to create a new database.

Syntax

CREATE DATABASE database_name;

Example

CREATE DATABASE SchoolDB;

Exam Question Example

Write a SQL command to create a database named LIBRARY.

CREATE DATABASE LIBRARY;

2. CREATE TABLE

Purpose

Used to create a new table inside a database.

Syntax

CREATE TABLE table_name(
column_name datatype,
column_name datatype
);

Example

CREATE TABLE student(
rollno INT,
name VARCHAR(20),
class VARCHAR(5),
marks INT
);

3. DESC (DESCRIBE)

Purpose

Displays the structure of a table.

Syntax

DESC table_name;

Example

DESC student;

Output shows

  • column names

  • data types

  • null information

4. INSERT INTO

Purpose

Used to add records into a table.

Syntax

INSERT INTO table_name
VALUES(value1,value2,value3);

Example

INSERT INTO student
VALUES(101,‘Rahul’,‘XI’,85);

Insert using column names

INSERT INTO student(rollno,name,marks)
VALUES(102,‘Riya’,90);

5. SELECT

Purpose

Used to retrieve data from a table.

Syntax

SELECT column_name
FROM table_name;

Example

SELECT name FROM student;

6. SELECT *

Purpose

Display all columns from the table.

Syntax

SELECT * FROM table_name;

Example

SELECT * FROM student;

7. DISTINCT

Purpose

Used to remove duplicate values.

Syntax

SELECT DISTINCT column_name
FROM table_name;

Example

SELECT DISTINCT city
FROM employee;

8. WHERE

Purpose

Used to apply conditions while retrieving data.

Syntax

SELECT * FROM table_name
WHERE condition;

Example

SELECT * FROM student
WHERE marks > 80;

9. UPDATE

Purpose

Used to modify existing records.

Syntax

UPDATE table_name
SET column=value
WHERE condition;

Example

UPDATE student
SET marks = 88
WHERE rollno = 101;

10. DELETE

Purpose

Used to remove records from a table.

Syntax

DELETE FROM table_name
WHERE condition;

Example

DELETE FROM student
WHERE rollno = 103;

NOTE :  If WHERE clause is omitted, all records will be deleted.

 

11. ALTER TABLE

Purpose

Used to modify the structure of a table.

Add Column

ALTER TABLE student
ADD address VARCHAR(30);

Modify Column

ALTER TABLE student
MODIFY name VARCHAR(25);

Drop Column

ALTER TABLE student
DROP address;

12. DROP TABLE

Purpose

Used to delete a table permanently.

Syntax

DROP TABLE table_name;

Example

DROP TABLE student;

13. ORDER BY

Purpose

Used to sort records.

Syntax

SELECT * FROM table_name
ORDER BY column_name;

Ascending Order

SELECT * FROM student
ORDER BY marks ASC;

Descending Order

SELECT * FROM student
ORDER BY marks DESC;

14. LIKE

Purpose

Used for pattern matching.

Symbols Used

Symbol Meaning
% Any number of characters
_ Single character

Example

Names starting with R

SELECT * FROM student
WHERE name LIKE ‘R%’;

Names ending with a

SELECT * FROM student
WHERE name LIKE ‘%a’;

15. BETWEEN

Purpose

Used to select values within a range.

Syntax

SELECT * FROM table_name
WHERE column BETWEEN value1 AND value2;

Example

SELECT * FROM student
WHERE marks BETWEEN 70 AND 90;

16. IN

Purpose

Used to match values from a list.

Syntax

SELECT * FROM table_name
WHERE column IN (value1,value2);

Example

SELECT * FROM student
WHERE class IN (‘XI’,‘XII’);

17. Logical Operators

Used to combine conditions.

Operator Purpose
AND Both conditions must be true
OR At least one condition true
NOT Reverse condition

Example

SELECT * FROM student
WHERE marks > 80 AND class=‘XI’;

Data Manipulation (DML)

Used to add, change, or remove the actual records (rows).

  • INSERT: INSERT INTO student VALUES (101, 'Rahul', 'XI', 85);

  • UPDATE: UPDATE student SET marks = 88 WHERE rollno = 101;

    • ⚠️ Note: Always use WHERE or all rows will be updated!

  • DELETE: DELETE FROM student WHERE rollno = 103;

    • ⚠️ Note: DELETE FROM student; removes all data but keeps the table structure.

Data Retrieval & Filtering (DQL)

The most common commands for fetching specific information.

The Basic Select

  • SELECT * FROM student; (Show all columns)

  • SELECT name, marks FROM student; (Show specific columns)

  • SELECT DISTINCT city FROM employee; (Removes duplicate entries)

Filtering with WHERE

  • Relational: WHERE marks > 80;

  • List Match: WHERE class IN ('XI', 'XII');

  • Range: WHERE marks BETWEEN 70 AND 90;

  • Pattern Matching (LIKE):

    • LIKE 'R%' → Starts with ‘R’

    • LIKE '%a' → Ends with ‘a’

    • LIKE '_i%' → ‘i’ is the second character

Sorting & Logic

  • ORDER BY: ORDER BY marks DESC; (Use ASC for smallest to largest)

  • AND / OR: Combine conditions (e.g., WHERE marks > 80 AND class = 'XI')

Exam Tips for Students

  1. Semicolons: Don’t forget to end every command with ;.

  2. Quotes: Use single quotes ' ' for VARCHAR, CHAR, and DATE values. Numbers do not need quotes.

  3. DROP vs DELETE: DROP kills the table; DELETE kills the rows inside the table.

  4. NULL: Use IS NULL or IS NOT NULL to check for empty values (never use = NULL).

Class 11 IP Introduction to My SQL notes

Class 11 Informatics Practices – Introduction to SQL Notes

NCERT Class 11 Informatics Practices Chapter 8 – Introduction to SQL.

 

1. What is a Database?

A database is an organized collection of related data stored in a structured way so that it can be easily accessed and managed.

Example

Roll No Name Class Marks
101 Rahul XI 85
102 Priya XI 92

2. DBMS (Database Management System)

A DBMS is software that allows users to create, manage and manipulate databases.

Functions of DBMS

  • Data storage
  • Data retrieval
  • Data modification
  • Data security
  • Data sharing

Examples of DBMS

  • MySQL
  • Oracle
  • Microsoft SQL Server
  • PostgreSQL

3. RDBMS (Relational Database Management System)

An RDBMS stores data in the form of tables consisting of rows and columns.

  • Row → Record
  • Column → Field

Example Table

RollNo Name Class
101 Rahul XI
102 Riya XI

4. What is SQL?

SQL (Structured Query Language) is used to communicate with a database.

Using SQL we can:

  • Create databases
  • Create tables
  • Insert records
  • Retrieve records
  • Update records
  • Delete records

Example Query

SELECT * FROM student;

This query displays all records from the student table.

5. Characteristics of SQL

  • SQL is case insensitive
    ( SELECT
    select
    Select )
    All mean the same.
  • SQL Commands end with a semicolon
    SELECT * FROM student;
  • SQL Queries can be written in multiple lines

6. SQL Command Categories

1. DDL (Data Definition Language)

DDL commands define database structure.

Command Purpose
CREATE Create database or table
ALTER Modify table structure
DROP Delete table or database
DESC Display table structure

Example

CREATE DATABASE SchoolDB;

7. CREATE TABLE

CREATE TABLE student(
rollno INT,
name CHAR(20),
class CHAR(5),
marks INT
);

8. INSERT Command

Used to insert records into a table.

INSERT INTO student
VALUES(101,'Rahul','XI',85);

9. SELECT Command

Used to retrieve data from tables.

SELECT * FROM student;

To display only specific columns:

SELECT name FROM student;

10. UPDATE Command

Used to modify existing records.

UPDATE student
SET marks = 88
WHERE rollno = 101;

11. DELETE Command

Used to remove records from a table.

DELETE FROM student
WHERE rollno = 103;

12. SQL Clauses

WHERE Clause

SELECT * FROM student
WHERE marks > 80;

ORDER BY Clause

SELECT * FROM student
ORDER BY marks DESC;

DISTINCT Clause

SELECT DISTINCT name
FROM student;

LIKE Clause

SELECT * FROM student
WHERE name LIKE 'R%';

13. Logical Operators

  • AND
  • OR
  • NOT

Example

SELECT * FROM student
WHERE marks > 80 AND class = 'XI';

14. Important Database Terms

Term Meaning
Table Collection of rows and columns
Field Column in a table
Record Row containing complete information
Primary Key Unique identifier of a record

Important SQL Commands for Exams

CREATE DATABASE
CREATE TABLE
DESC
INSERT INTO
SELECT
UPDATE
DELETE
ALTER
DROP

 

 

Class 5 Maths Decimals Assertion–Reason

Decimal – Assertion & Reason
Class 5 Maths