Get the step-by-step solution for this question inside the Vidyadip app.
Get the answer in the appGenerate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.
Table: TEACHER
| TID | NAME | AGE | DEPT | DATEOFJOIN | SAL | SEX |
| T118 | Navin | 40 | Computer | 2010-01-10 | 12000 | M |
| T107 | Chetna | 37 | History | 2008-03-24 | 20000 | F |
| T105 | Sandeep | 46 | Maths | 2006-12-12 | 30000 | M |
| T110 | Sangeeta | 35 | History | 2010-07-01 | 25000 | F |
| T101 | Rudransh | 42 | Maths | 2004-09-05 | 40000 | M |
| T121 | Neeraj | 38 | Physics | 2011-04-01 | 28000 | M |
(i) To show information about the teachers of the history department.
(ii) To list the names of teachers earning a salary between 20000 and 30000.
(iii) To count the number of male teachers.
(iv) Display gender wise total number of teachers.
(v) To list the name and age of teachers of female teachers in descending order of date of join.
(vi) Increase the salary by 10% for Maths departments.
( vii) To delete the record of teacher Neeraj.
Write a program that reads a line and a substring. It should then display the number of the occurrence of the given substring in the line.
Distances between various buildings:
| Building “RAVI” to Building “JAMUNA” | 120m |
| Building “RAVI” to Building “GANGA” | 50m |
| Building “GANGA” to Building “JAMUNA” | 65m |
| Faridabad Campus to Head Office | 1460km |
Number of computers:
| Building “RAVI” | 25 |
| Building “JAMUNA” | 150 |
| Building “GANGA” | 51 |
| Head Office | 10 |
(a) Suggest the most suitable place (i.e. block) to house the server of this organization. Also give a reason to justify your suggested location.
(b) Suggest a cable layout of connections between the buildings inside the campus.
(c) Suggest the placement of the following devices with justification:
(i) Switch
(ii) Repeater
(d) The organization is planning to provide a high speed link with its head office situated in KOLKATA using a wired connection. Which of the following cable will be most suitable for this job?
(i) Optical Fiber
(ii) Co-axial cable
(iii) Ethernet cable
![]()
where n and x have to be input from the user. The function should have two parameter n and x and return the sum of the series.
Write SQL commands for (a) to (f) and write the outputs for (g) on the basis of tables FURNITURE and ARRIVALS
Table: FURNITURE
| NO | ITEMNAME | TYPE | DATEOFSTOCK | PRICE | DISCOUNT |
| 1 | White lotus | Double Bed | 23/02/2002 | 30000 | 25 |
| 2 | Pink feather | Baby cot | 20/01/2002 | 7000 | 20 |
| 3 | Dolphin | Baby cot | 19/02/2002 | 9500 | 20 |
| 4 | Decent | Office Table | 01/01/2002 | 25000 | 30 |
| 5 | Comfort zone | Double Bed | 12/01/2002 | 25000 | 25 |
| 6 | Donald | Baby cot | 24/02/2002 | 6500 | 15 |
| 7 | Royal Finish | Office Table | 20/02/2002 | 18000 | 30 |
| 8 | Royal tiger | Sofa | 22/02/2002 | 31000 | 30 |
| 9 | Econo sitting | Sofa | 13/12/2001 | 9500 | 25 |
| 10 | Eating Paradise | Dining Table | 19/02/2002 | 11500 | 25 |
Table: ARRIVALS
| NO | ITEMNAME | TYPE | DATEOFSTOCK | PRICE | DISCOUNT |
| 1 | Wood Comfort | Double Bed | 23/03/2003 | 25000 | 25 |
| 2 | Old Fox | Sofa | 20/02/2003 | 17000 | 20 |
| 3 | Micky | Baby cot | 21/02/2003 | 7500 | 15 |
(a) To show all information about the Baby cots from the FURNITURE table.
(b) To list the ITEMNAME which are priced at more than 15000 from the FURNITURE table.
(c) To list ITEMNAME and TYPE of those items, in which date of stock is before 22/01/2002 from the FURNITURE table in descending order of ITEMNAME.
(d) To display ITEMNAME and DATEOFSTOCK of those items, in which the discount t percentage is more than 25 from FURNITURE table.
(e) To count the number of items, whose TYPE is “Sofa ”from FURNITURE table.
(f) To insert a new row in the ARRIVALS table with the following data:
14,“Valvet touch ”, “Double bed ”, {25/03/03}, 25000,30
(g) Give the output of following SQL statement
Note: Outputs of the above mentioned queries should be based on original data given in both the tables i.e., without considering the insertion done in (f) part of this question.
(i) Select COUNT(distinct TYPE) from FURNITURE;
(ii) Select MAX(DISCOUNT) from FURNITURE, ARRIVALS;
(iii) Select AVG(DISCOUNT) from FURNITURE where TYPE=”Baby cot ”;
(iv) Select SUM(Price) from FURNITURE where DATEOFSTOCK <12/02/02;