SQL Project Class 11
SQL Project Class 11
Output
2)Creating Table
CREATE TABLE table_name
(column_name datatype [constraint],
column_name datatype [constraint],
column_name datatype [constraint],...);
Output
BookNo Name Cost Discount Final Cost
4) Subtraction (-)
SELECT bookno, name, cost, discount, cost-discount AS
"Final Cost"
FROM BOOKS;
Output
5) Multiplication (*)
SELECT bookno, name, cost, discount, cost*discount AS
"Final Cost"
FROM BOOKS;
Output
6)Division (/)
SELECT bookno, name, cost, discount, cost/discount AS
"Final Cost"
FROM BOOKS;
Output
7)Modulus (%)
SELECT bookno, name, cost, discount, cost%discount AS
"Final Cost"
FROM BOOKS;
Output
Output
9) To add multiple columns in
the table
ALTER TABLE Student ADD (Gender varchar(1),
Percentage varchar(11));
Output
Output
SQL - GROUP BY and ORDER BY
11) Select Student and group them
by city
SELECT * FROM Student GROUP BY City;
Output
Output
SQL - WHERE Clause (to filter
data)
13) Fetch Student whose physics marks
are 91
SELECT * FROM Student WHERE physics=91;
Output
Output