Wednesday, March 19, 2014

Sample Question No. 3 for IP - Informatics Practices ( AISSCE 2014 ) _ A

Sample Question No. 3 for IP - Informatics Practices ( AISSCE 2014 ) _ A


Q. No. 3   [1+1+1+1+2+2+2]

(a) Which MySQL command helps you to create database if it does not exist?

(b) How can we see the list of existing DATABASES?

(c) Pragati created a table named Item, She wants to see those items whose price is between 150 and 890. She wrote a query-
           SELECT * FROM Item WHOSE price > 150 OR <890;
Help pragati to run the query by removing the errors from query by rewriting it.

(d) Joshi wants to implement check constraint in the tables being created. How he can use constraint give example?

(e) What is the role of primary key in the table? Explain with the help of suitable example.

(f)  Room_No, Cust_Name, Room_type and Room_Rent of table “HOTEL” are given below:
 Room_No
Cust_Name
Room_type
Room_Rent
204
Ravi
Single
650
308
Tina
Double AC
1400
105
Anita
Single NAC
900
202
Pratibha
Single NAC
800

Based on this information, find output of the following queries:
(i)                  SELECT Room_Type, SUM(Room_Rent) FROM hotel GROUP BY Room_type;
(ii)                SELECT Room_no FROM hotel WHERE Cust_Name LIKE ‘%a%’;


(g) Define Degree and Tuple.