This document contains a 3 page test for a Class 11 Informatics Practices subject. It includes 6 multiple part questions testing SQL commands and concepts related to databases, tables, keys, and more. The questions cover topics like opening a database, displaying table data, differentiating types of keys, writing SQL statements for a given table, creating tables with constraints, inserting values, defining DBMS terms, and writing SQL queries for a provided table.
1. 1
KENDRIYA VIDYALAYA ARMY AREA PUNE
3rd
UNIT TEST-2016-17
Class: XI Subject: Informatics Practices
M.Marks:40 Time: 90mins
Instructions: (i) All questions are compulsory.
(ii)Programming Language: Java
(iii)Answer the questions after carefully reading the text.
Topic Covered: Programming Methodology, DBMS Concepts, My SQL
Ques1.a) WriteMysql Command that will be used to open an already existing database “LIBRARY”. 1
b) A table ‘EMP’ has two columns ‘Empname’ and ‘Salary’(per month). Write Sql command to display
Empname along with their annual salary. 1
(c) Differentiate between Alternative Key and Candidate Key. 2
Ques2. a) Write SQL commands for (i) to (vii) on the basis of the table LAB
Table : LAB
NO ITEM
NAME
COST QTY DATEOFPURCHASE WARRANTY OPERATIONAL
1. COMPUTER 45000 9 21/5/96 2 7
2. PRINTER 15000 3 21/5/97 4 2
3. SCANNER 21000 1 29/8/98 3 1
4. CAMERA 12000 2 13/6/96 1 2
5. HUB 4000 1 31/10/99 2 1
6. UPS 5000 5 21/5/96 1 4
7. PLOTTER 13000 2 11/1/2000 2 2
i) to select the item name purchased after 31/10/97. 1
ii) to list item name, which are within the warranty period till present date 1
iii) to list the name in ascending order of the date of purchase where quantity is more than 3. 1
iv) to count the number of items whose cost is more than 10000. 1
v) Give the output of the following SQL commands : 2
a) SELECT MIN(DISTINCT QTY) FROM LAB;
b) SELECT MIN(WARRANTY) FROM LAB WHERE QTY=2 ;
c) SELECT SUM(COST) FROM LAB WHERE QTY>2 ;
d) SELECT AVG(COST) FROM LAB WHERE DATEOFPURCHASE<{1/1/99} ;
Ques3.(a)Create table Depart including constraints: 2
Column Name Dept ID DeptName DepartLOC Distance
Key Type Primary
Constraint NOTNULL
Datatype Number Varchar Varchar Number
Length 2 20 20 4
Total Pages: 2
2. 2
b.Add one more column Email of datatypeVarchar and size 30 to the table Depart 2
c. Select the entire department name in descending order. 2
d.Select the department name whose distance is maximum. 2
e.Insert values in the table as S101, ‘Sales’, “delhi’, 120. 2
Ques4. Briefly answer the following.
a) What is DBMS? Write any two advantages of DBMS. 2
b) How do database management systems ensure data security and privacy? 2
c) What are the steps involves in System Development . 4
d) Define the term : a) Debugging b) Robustness . 2
Ques5. Answer the following in details. (4X3=12)
a) Define the following terms:
(I) DBMS (ii) Relation (iii) domain (iv) tuple
b) Define the following terms:
(i) attribute (ii) Degree (iii) cardinality (iv) data model
C) Write SQL command for the following on the basis of given table sports.
Student No. Class Name Game 1 Grade 1 Game 2 Grade 2
10 7 Sameer Cricket B Swimming A
11 8 Sujit Tennis A Skating C
12 7 Kamal Swimming B Football B
13 7 Veena Tennis C Tennis A
14 8 Kamal Cricket A Tennis B
(i) Display the name of the students who have grade C In either game 1 or game 2 or both.
(ii) Display the name of the students who have same grade for both game 1 and game 2.
(iii) Display the games taken up by the student whose name starts with “A”.
(iv) Write SQL command to create above table.
Ques 6.(i)Create the table-Customer as per following structure: (2)
Column Name Data Type/Size Constraints
Cust_Id integer Primary Key
C_Date date
Cust_Name char(20) Not Null
Cust_Address varchar(30)
Amount decimal(7,2) check Amount>500
Cust_Phone integer(10) unique
Write the queries for the above table:
(ii) To increase amount by adding another Rs.100 where amount is
less than 1000. (1)
(iii) To modify the name of the customer of cust_id=5 to Raja. (1)
(iv) To arrange the data of the above table in descending order of amount. (1)
(v) To display customer details whose name contains ‘A’ as third alphabet. (1)
(vi) To display customer’s name who don’t have their amount in the range of 1000.00 to 2000.00. (1)
(vii) To remove the entire contents of customers those who have no any address. (1)
**********************BEST OF LUCK****************