Monoj Sir
Monoj Sir
Monoj Sir
Informatics Practices(265)
Time: 3 hrs Class XII M .M. 70
General Instructions:
(i) All questions are compulsory.
(ii) Answer the questions after carefully reading the text.
Mname
Aakash
Hirav
Vinayak
Sheetal
Rajeev
Based on the information, find the output of the following queries:
(i) Select Mname from members where mname like "%v";
(ii) Select Mnarrte from members where mname like "%e%";
(c) A table "TRAINS" in a database has degree 3 and cardinality 8. What is the number of rows 1
and columns in it?
(d) Differentiate between Alternate key and Candidate key. 1
(e) Define data encapsulation with reference to Object Oriented Programming 2
(f) A worker_Id consisting of 4 digits is stored in a string variable strWrkld. Now Mr. Jai 2
wants to store this Id in integer type of variable IntWrkld. Write a Java statement to do this.
(g) Sarthya, a student of class XI, created a table "RESUL T". Grade is one of the columns of 2
this table. To find the details of students whose Grades have not been entered, he wrote the
following MySql query, which did not give the desired result:
SELECT * FROM Result WHERE Grade = "Null" ;
Help Sarthya to run the query by removing the errors from the query and write the
correct Query.
• 3 items namely Shoes, Sandals and Slippers are manufactured by the factory.
• A buyer can buy more than one item at a time.
• Each pair of shoes costs Rs.1,500.00, each pair of sandals costs Rs.1,000.00 and each
pair of slippers costs `500.00.
• The item bought will be selected by the user and the Quantity (number of pairs)
bought will be entered by the user.
• Amount to be paid for that item will be displayed in front of the item.
For example if 'Shoe' is selected and Quantity entered is 20, then Amount should be
displayed as 30000. Help Seema write code for the following:
(a) When 'Calculate' button is clicked, the amount should be displayed in front of each
item (in the appropriate textfield) and Total amount (sum total of all the amounts) should
be displayed in the appropriate' textfield.
(b) When Clear button is clicked, all the Textfields and Checkboxes should be cleared.
(c) When Stop button is clicked, the application should close.
5. Answer the following questions:
(a) Consider the table given below : 10
Write SQL queries for (i) to (viii) and output for SQL queries (ix) and (x).
SID Name Phone DOB Salary Area
S101 Amit Kumar 98101789654 1967-01-23 67000.00 North
S102 Deepika Sharma 99104567834 1992-09-23 32000.00 South
S103 Vinay Srivastav 98101546789 1991-06-27 35000.00 North
S104 Kumar Mehta 88675345789 1967-10-16 40000.00 East
S105 Rashmi Kumar 98101567434 1972-09-20 50000.00 South
Note: Columns SID and DOB contain Sales Person Id and Data of Birth respectively.
(i) Write the data types of SID and DOB columns.
(ii) Display names of Salespersons and their Salaries who have salaries in the range
30000.00 to 40000.00
(iii) To list Names, Phone numbers and DOB (Date of Birth) of Salespersons who were
born before 1st November, 1992.
(iv) To display Names and Salaries of Salespersons in descending order of salary.
(v) To display areas in which Salespersons are working. Duplicate Areas should not be
displayed.
(vi) To display SID, Names along with Salaries increased by 500. (Increase of Rs. 500 is
only to be displayed and not to be updated in the table)
(vii) To display Area along with number of Salespersons working in that area.
(viii) To display Names of Salespersons who have the word ‘Kumar’ anywhere in their names.
(ix) Select Name, length (Name) FROM Salesperson;
(x) SELECT Area, COUNT (*)FROM Salesperson GROUP BY Area HAVING COUNT (*) > 1;
Table: DIVISION
Divno Divname Location
10 Media TF02
20 Dance FF02
30 Production SF01
(i) Identify the foreign key in the table Member.
(ii) What output, you will get, when an equi-join query is executed to get the
NAME from Member Table and corresponding Divname from Division table?
(c) In a database there are two tables "Product" and "Client" as shown below: 6
Table: PRODUCT
Table: CLIENT
S. No. Function
1 To enter NAME
2 To enter EMAIL ID
3 To allow user to choose any one MEMBERSHIP DURATION out of 1
Month, 3 Months, 6 Months, 1 year.
4 To choose PRE-EXISTING MEDICAL CONDITIONS out of Diabetes,
Heart Disease, Chest Paie, Shortness of Breath, Epilepsy, Others.