Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

ST.

XAVIER’S SENIOR SECONDARY SCHOOL, DELHI – 110054


Class 11 Time : 1½ hrs.
15-7-2019 Pre-Midterm Test in COMPUTER SCIENCE M. Marks : 40

1.
a) Which operator is used for checking a list of values in MySQL? Give example. [1]
b) Which operator is used for making range checks in queries? [1]
c) Which command is used in MySQL to make the changes permanent? [1]
d) A table ‘Customer’ in a database has 5 columns and no rows in it. What is its degree and
cardinality? What will be its cardinality if 4 rows are added in the table? [2]
e) Find errors in the following query and write the correct command. [2]
i. Select * from student where stream = “null” ;
ii. Select * from student where marks is between 40 to 60 ;
f) Write the pattern matching symbols used in MySQL. [1]

2. Write the Queries based on the table given below [8]


Table Name :- Product_Master
Attributes :- product_no, description, qty_on_hand, sell_price, cost_price
a) Display the details of products whose selling price is greater than or equal to 5000
b) Display the details of products whose cost price is more than selling price
c) Display the product number, description , selling price * 15 whose quantity on hand is within
the range 10 to 50
d) Display the product_no, description, sell_price of products whose description begins with
letter 'M'
e) Display the details of products in sorted order of their description
f) Change the selling price of product description named '1.44 Drive' to 1150.00
g) Delete the record with product_no 'P19001'
h) Increase the cost_price of the product ‘HP Printer’ by 200

3. Study the following table STAFF and give outputs for SQL queries [4]
TABLE: STAFF
ID NAME DEPT SEX EXPERIENCE
101 Siddharth SALES M 12
104 Raghav FINANCE M 5
107 Naman RESEARCH M 10
114 Nupur SALES F 3
109 Janvi FINANCE F 9
105 Rama M 10
117 James SALES F 3
111 Binoy FINANCE F 12
130 Samuel SALES M 15
a. Select name, dept from Staff where sex=’F’ and experience>5;
b. Select id, experience from Staff where dept is not null and name like ‘B%’;
c. Select name, experience from staff where id in (114,110,134);
d. Select id, sex from Staff where experience between 5 and 7;

4. Write any two differences between. [4]


I. Alter table and Update table commands
II. Primary key and Candidate key
Std. 11 -2- COMPUTER SCIENCE

5. Consider the table STUDENT given below. Write commands in MySql for (i) to (iii) and output
for (iv) to (vi):
Table: STUDENT
No Name Stipend Subject Average Division
1 Sharon 400 English 38 THIRD
2 Amal 680 Mathematics 72 FIRST
3 Vedant 500 Accounts 67 FIRST
4 Shakeer 200 Informatics 55 SECOND
5 Anandha 400 History 85 FIRST
6 Upasna 550 Geagraphy 45 THIRD

i. To display a report listing NAME, SUBJECT and Annual stipend received assuming that the
stipend column has monthly stipend. [1]
ii. To count the number of students, who have either Accounts or Informatics as Subject. [1]
iii. To insert a new row in the table STUDENT: [1]
6,”Mohan”,500, “English”,73, “Second”
iv. SELECT AVG(Stipend) FROM STUDENT WHERE DIVISION=”THIRD”; [1]
v. SELECT COUNT(DISTINCT subject) FROM STUDENT; [1]
vi. SELECT MIN(Average) FROM STUDENT WHERE Subject=”English” [1]

6. a) Name any two common social networking sites. [1]


b) Define the following term [4]
i) Cyber Trolling
ii) Cyber Stalking
iii) Hacker
iv) Cookies
c) Write any one difference between the following [2]
i) Worm and Trojan horse
ii) Http and Https
e) What is an IP Address. [1]
f) Write any two tips of cyber safety [1]
g) What is IT Act, 2000? [1]

-x-x-x-x-x-x-x-x-

You might also like