SQL Queries
SQL Queries
Write SQL queries for the following Questions based on the given table:
(b) Write a Query to show all information about students of History department.
(c) Write a Query to list name of the students whose ages are between 18 to 20.
(d) Write a Query to display the name of the students whose name is starting with 'A'.
2. Write SQL queries for the following Questions based on the given table:
(b) Write a Query to change the fees of Student to 170 whose Roll number is 1, if the existing fess
(c) Write a query to list the names of those students whose name have second alphabet 'n' in their
names.
3. Write SQL queries for the following Questions based on the given table: (4)
(a) Write a Query to add a new column Area of type varchar in table STU.
(b) Write a Query to Display Name of all students whose Area Contains NULL.
(c) Write a Query to delete Area Column from the table STU.
4. Write SQL queries for the following Questions based on the given table:
(a) Write a query to display details of all products in the stock table in descending order of Stock date.
(b) Write a query to delete the details of the product coded 5003.
(c) Write a query to change the unit price of product to 8 whose product number is 5002, if the existing
(d) Write a query to add a new column PType of type varchar in table STOCK.
5. Write SQL queries for the following Questions based on the given table:
(a) Write a query to display details of all products in the stock table in ascending order of Pname.
(b) Write a query to delete the details of the product coded 5006.
(c) Write a query to change the unit price of product to 8 whose product number is 5001, if the existing
(d) Write a Query to display the name of the products whose name contains ‘pen’.
6. Consider the following tables CLUB and MEMBER and answer (a) to (d)
(b) Write a Query to show all information about students of Hindi department.
(c) Write a Query to list name of the students whose fees are between 200 to 300.
(d) Write a Query to display the name of the students whose name is starting with 'D'.
8. Consider the following tables CLUB and MEMBER and answer (a) to (d)
(a) Write a Query to Create a new database in the name of "STOCK" and to to Open the database
"STOCK".
(c) Write a Query to insert all the rows of above table into Product table.
(d) Write a query to display Pno, Pname and Quantity of the products from Product table.
10. Write SQL queries for the following Questions based on the given table:
(a) Write a Query to Create a new database in the name of "STUDENTS" and to to Open the database
"STUDENTS".
(c) Write a Query to insert all the rows of above table into Info table.
(d) Write a query to display Rollno, Name and Department of the students from Info table.
11. Write SQL queries for the following Questions based on the given table:
(a) Write a query to display details of all products in the stock table in descending order of Unit Price.
(b) Write a query to delete the details of the product coded 5009.
(c) Write a query to change the unit price of product to 15 whose product number is 5005.
(d) Write a query to add a new column PType of type varchar in table STOCK.