Comp check
Comp check
Write SQL query to add a column total price with datatype numeric
and size 10, 2 in a table product.
Question 2:
Sonal needs to display name of teachers, who have “0” as the third
character in their name. She wrote the following query.
SELECT NAME FROM TEACHER WHERE NAME = “$$0?”;
But the query is’nt producing the result. Identify the problem.
Question 3:
Deepika wants to remove all rows from the table BANK. But he
needs to maintain the structure of the table. Which command is used
to implement the same?
Question 4:
While creating table ‘customer’, Rahul forgot to add column ‘price’.
Which command is used to add new column in the table. Write the
command to implement the same.
Question 5:
What is the use of wildcard?
Question 6:
Differentiate between DELETE and DROP table commands ?
Answer:
Write SQL commands for the queries (i) to (iv) and output for (v) &
(viii) based on a
table COMPANY and CUSTOMER.
1. To display those company name which are having prize less than
30000.
2. To display the name of the companies in reverse alphabetical order.
3. To increase the prize by 1000 for those customer whose name starts
with „S?
4. To add one more column totalprice with decimal] 10,2) to the table
customer
5. SELECT COUNT(*) , CITY FROM COMPANY GROUP BY
CITY;
6. SELECT MIN(PRICE), MAX(PRICE) FROM CUSTOMER
WHERE QTY>10;
7. SELECT AVG(QTY) FROM CUSTOMER WHERE NAME LIKE
“%r%;
8. SELECT PRODUCTNAME,CITY, PRICE FROM COMPANY,
CUSTOMER WHERE COMPANY. CID=CUSTOMER.CID AND
PRODUCTNAME=”MOBILE”;