Professional Documents
Culture Documents
Practical File
Name :
School:
Class :
Roll no :
PRACTICAL-1
Overview of SQL Commands
SQL Commands
o SQL commands are instructions. It is used to communicate with the database.
It is also used to perform specific tasks, functions, and queries of data.
o SQL can perform various tasks like create a table, add data to tables, drop the
table, modify the table, set permission for users.
o CREATE
o ALTER
o DROP
Syntax:
Example:
b. DROP: It is used to delete both the structure and record stored in the table.
Syntax
Example
DROP TABLE EMPLOYEE;
c. ALTER: It is used to alter the structure of the database. This change could be either
to modify the characteristics of an existing attribute or probably to add a new attribute.
Syntax:
EXAMPLE
o DML commands are used to modify the database. It is responsible for all form
of changes in the database.
o The command of DML is not auto-committed that means it can't permanently
save all the changes in the database. They can be rollback.
o INSERT
o UPDATE
o DELETE
a. INSERT: The INSERT statement is a SQL query. It is used to insert data into the row
of a table.
Syntax:
Or
For example:
b. UPDATE: This command is used to update or modify the value of a column in the
table.
Syntax:
1. UPDATE table_name SET [column_name1= value1,...column_nameN = valueN] [WHER
E CONDITION]
For example:
UPDATE students
SET User_Name = 'Sonoo'
WHERE Student_Id = '3'
Syntax:
For example:
o Grant
o Revoke
Example
Example
o SELECT
a. SELECT: This is the same as the projection operation of relational algebra. It is used
to select the attribute based on the condition described by WHERE clause.
Syntax:
SELECT expressions
FROM TABLES
WHERE conditions;
For example:
SELECT emp_name
FROM employee
WHERE age > 2
PRACTICAL-5
Write down commands for following:
(i) Display the Mobile company, Mobile name & price in descending order of
(ii) List the details of mobile whose name starts with “S”.
(iii) Display the Mobile supplier & quantity of all mobiles except “MB003‟.
SELECT M_Supplier, M_Qty FROM MobileStock
(iv) To display the name of mobile company having price between 3000 & 5000.
2.Flipkart.com
his portal was started with just Rs. 4,00,000 in 2004 and by 2014, it reported
crossing 60,000 Crore turnover. It offers a wide range of items in almost all
categories. It has become the country’s largest e-commerce player after
taking over letsbuy.com
3.Myntra.com
This fashion & lifestyle portal is among the leading eCommerce business in
the country and offers watches, shoes, and T-shirts at a discounted price. It is
said to follow an omnichannel strategy. In FY’19, it logged a loss of Rs. 539.2
Crore.
4. snapdeal.com
This portal offers almost everything ranging from online products to travel
deals, local deals on spas, restaurants, etc. combined with free shipping and
best pricing. As of FY 19, its revenue was Rs. 925 crore. Their strategy is to
focus on the country’s value-conscious buyers.
5.Homeshop18
It is considered to be a Network18 Group venture and among the country’s
fastest-growing entertainment & media group. It also has managed to launch
the country’s first-ever 24/7 TV channel promoting Home Shopping. In 2008.
PC World Magazine awarded it with the ‘Best Shopping Site’. The
consolidated revenue reported for Q4FY19 is Rs. 1236 crore. Their strategy &
mantra to drive sales was ‘Shopping makes me happy’.