Documente Academic
Documente Profesional
Documente Cultură
Assignment - 3
Question 1
COMMAND
DESC student;
OUTPUT
Question 2
Create SALES table with attribute mentioned below:
Columns Type
Product_ID Integer (primary key)
Product Name Varchar
Quantity Integer
Price Integer
COMMANDS
OUTPUT
OUTPUT
OUTPUT
WHERE Quantity>100;
OUTPUT
WHERE Price<10;
OUTPUT
Question 3
Create STUDENT table with attribute mention below: -
Table: STUDENT
Columns Student_ID Integer (primary key)
Student Name Varchar
Total Marks Integer
Maximum Marks Integer
(d) Display all the details of the students whose total marks are more than 300.
(e) Display the details of all the students with unique names.
COMMANDS
VALUES ('1','Rohan','350');
VALUES ('2','Sahil','270');
VALUES ('3','Vanshika','430');
VALUES('4','Atif','280');
OUTPUT
b) UPDATE STUDENT
OUTPUT
WHERE Total_Marks>300;
OUTPUT
FROM STUDENT;
OUTPUT
Question 4
1. Write a query to filter those salesmen with all information who comes from any
of the cities Paris and Rome.
2. Write a SQL statement to find those salesmen with all information who come
from the city either Paris or Rome
3. Write a query to sort out those customers with all information whose ID value is
within any of 3007, 3008 and 3009.
4. Write a SQL statement to find those salesmen with all other information and
name started with other than any letter within 'A' and 'L'.
5. Write a SQL statement to display names and city of salesman, who belongs to the
city of Paris.
COMMANDS
OUTPUT
OUTPUT
OUTPUT
OUTPUT
OUTPUT
Question 5
Sample table: item_mast
1. Write a SQL query to find all the products with a price between Rs.200 and Rs.600
2. Write a SQL query to calculate the average price of all products of the
manufacturer whose code is l6.
COMMANDS
OUTPUT
OUTPUT
FROM item_mast
OUTPUT