CBSE Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2013 > Computer Science > Computer Science - by Mr. Sandip Kumar Srivastava

CBSE CLASS XII

Computer Science (C++ and Data Structure)

Previous Index Next

 

DBMS :-

  1. What is primary key and candidate key?
  2. Write SQL command for (a) to (d) and write the outputs for (e) on the basis of table

Table : CLUB

COACH-ID COACHNAME AGE SPORTS DATOFAPP PAY SEX
1 KUKREJA 35 KARATE 27/03/1996 1000 M
2 RAVINA 34 KARATE 20/01/1998 1200 F
3 KARAN 34 SQUASH 19/02/1998 2000 M
4 TARUN 33 BASKETBALL 01/01/1998 1500 M
5 ZUBIN 36 SWIMMING 12/01/1998 750 M
6 KETAKI 36 SWIMMING 24/2/1998 800 F
7 AMKITA 39 SQUASH 20/02/1998 2200 F
8 ZAREEN 37 KARATE 22/02/1998 1100 F
9 KUSH 41 SWIMMING 13/01/1998 900 M
10 SHAILYA 37 BASKETBALL 19/02/1998 3700 M
  1. To show all information about the swimming coaches in the club.
  2. To list names of all coaches with their data of appointment (DATOFAPP) in descending order.
  3. To display a report, showing coach name, pay, age and bonus (15% of pay) for all coaches.
  4. To insert a new record in the CLUB table with the following data:
    11,”Rajender”,25,”Football”,{27/05/2004},4500,”M”
  5. give the output of the following SQL statements:
    1. Select count(distinct SPORTS) from CLUB;
    2. Select min(AGE) from CLUB where SEX=’F’;
    3. Select AVG(PAY) from CLUB where SPORTS=’KARATE’;
    4. Select SUM(PAY) from CLUB where DATOFAPP>{31/01/98};

57. a. What do you understand by Degree and Cardinality of a table?
b.
Consider the following table INTERIORS and NEWONES and give the answer (B1) and (B2) parts of this question.

Table: INTERIORS

No ITEMNAME TYPE DATEOFSTOCK PRICE DISCOUNT
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Red rose
Soft touch
Jerry’s home
Rough wood
Comfort zone
Jerry look
Lion king
Royal tiger
Park sitting
Dine paradise
Double Bed
Baby cot
Baby cot
Office Table
Double Bed
Baby cot
Office Table
Sofa
Sofa
Dining Table
23/02/02
20/01/02
19/02/02
01/01/02
12/01/02
24/02/02
20/02/02
22/02/02
13/12/01
19/02/02
32000
  9000
  8500
20000
15000
  7000
16000
30000
  9000
11000
15
10
10
20
20
19
20
25
15
15

Table: NEWONES

No ITEMNAME TYPE DATEOFSTOCK PRICE DISCOUNT
11.
12.
13.
White wood
James 007
Tom Look
Double Bed
Sofa
Baby Cot
23/03/03
20/02/03
21/02/03
20000
15000
  7000
20
15
10

(B1) Write SQL commands for the following statements:

  1. To show all information about the Sofa from the INTERIORS table.
  2. To list the ITEMNAME which are priced at more than 10000 from the INTERIORS table?
  3. To list ITEMNAME and type of those items, in which DATEOFSTOCK is before 22/01/02 from INTERIORS table in descending order of ITEMNAME.
  4. To display ITEMNAME and DATEOFSTOCK of those items, in which the DISCOUNT percentage is more than 15 from INTERIORS table.
  5. To count the number of items, whose TYPE is “Double Bed” from INTERIORS table?
  6. To insert a new row in the NEWONES table with the following data:

14,”True Indian”, “Office Table”, {28/03/03}, 15000, 20
(B2) Give the output of the following SQL queries
      (Note: without considering the insertion)

  1. Select  count (Distinct TYPE) from INTERIORS;
  2. Select AVG (DISCOUNT) from INTERIORS where TYPE=”Baby cot”;
  3. Select SUM (Price) from INTERIORS where DATEOFSTOCK<{12/02/02};
  4. Select MAX(DISCOUNT) from INTERIORS;

 

Previous Index Next

Submitted By : Mr. Sandip Kumar Srivastava
Email : [email protected]