Pre Board XII CS 21 22 1

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

St.

Anne’s School , Jodhpur


Pre-Board Examination
2021-22
Class : XII A Subject : Computer Science(083)
Time Allowed : 2 Hours M.M : 35

General Instructions
• The question paper is divided into 3 sections – A, B and C
• Section A, consists of 7 questions (1-7). Each question carries 2 marks.
• Section B, consists of 3 questions (8-10). Each question carries 3 marks.
• Section C, consists of 3 questions (11-13). Each question carries 4 marks.
• Internal choices have been given for question numbers 7, 8 and 12.

SECTION – A
Each question carries 2 marks
1. What do you mean by LIFO and FIFO characteristics of Stacks and Queues? Also write at (2)
least two application of each stacks and queues.
2. a. Discuss any two technologies to connect to internet wirelessly. (2)
b. Define Web Browser and Web Server.
3. Answer following with reference to python-mysql connectivity :
(a) Consider the following code snippet : (1)
data= cursor.fetchone() //line 1
data1= cursor.fetchmany(5) //line 2
count= cursor.rowcount //line 3
print(count) // line 4
And answer following :
(i) What is the difference between the statements in line 1 and line2? What will be
the datatype of data and data1
(ii) What will the value be printed in line 4
(b) What will be the generated query string ? (1)
Str=”INSERT INTO student(rollno, name, marks, grade)
VALUES({}.’{}’,{},’{}’)”.format(1,’Sanyam’,75,’B’)
4. Answer Following :
(a) Ms. Das is trying to display the total marks of all students but on issuing the command (1)
Select rollno, mark1+mark2+marks3 “total” from student, she is not getting the total
marks for roll no 2 and 5. What may be the possible reason?
Rollno Marks1 Marks2 Marks3
1 45 78 45
2 NULL 62 22
3 56 95 60
4 72 78 56
5 84 63 NULL
(b) Write an example to use aggregate function without group by. (1)
5. Write the output of the queries (a) to (d) based on the table “College” given below. (2)
Table :College
No Name Age Salary Department DateofJoin Gender
1 Shalaz 45 10500 Biology 23/02/2008 M
2 Sameera 54 95000 Biology 10/01/2010 F
3 Yagyen 43 8500 Physics 21/02/2012 M
4 Pratyush 34 7500 Chemistry 22/01/2012 M
5 Aren 51 8500 Mathemati 22/01/2011 M
cs

CS – 1
6 Reeta 27 9000 Chemistry 14/02/2010 F
7 Urvashi 29 85000 Biology 10/02/2012 F
8 Teena 35 10500 Mathemati 02/02/2011 F
cs
9 Viren 49 9000 Mathemati 03/01/2008 M
cs
10 Prakash 22 8000 Physics 17/02/2009 M
(a) Select name, salary from college
Where department = ‘Physics’ and gender = ‘M’;
(b) Select name , salary from college
Where department in (‘Chemistry’,’Biology’) and age <=30;
(c) Select name , age, department from college
Where gender = ‘F” and salary >20000 and name like ‘S%’;
(d) Select max(salary), min(salary) from college
Where department = ‘Biology’;
6. Considering the following details : (2)
A SQL table ‘club’ ( memberno, name , dateofbirth, address, dateofjoin, num_dependent) ,
Database name : ‘club_details’
user name =’abcd’ and password =’depends’

Write functions using Python-Sql Connectivity scripts as per following requirement


1. A function disp() in python to display all the members whose dateofjoin is after 1st
Jan. 2020
2. A function remove() in python to delete all the members whose num_dependent is
more than 5.
7. Consider the following two tables “Graduate” and “Guide” and answer following (2)
questions:
GRADUATE
No Name Stipend DateofJoin Subject Average Division
1 Karan 400 23/02/02 Physics 68 1
2 Divakar 450 20/01/02 Computer Sc 68 1
3 Divya 300 19/02/02 Chemistry 62 2
4 Rubina 450 22/02/02 Mathematics 68 1
5 Vikas 500 13/12/01 Computer Sc 62 1
6 Mohan 300 19/02/02 Mathematics 57 2
GUIDE
MainArea Advisor Month_sal
Physics Vinod 5000
Computer Sc Alok 7000
Chemistry Rajan 6900
Mathematics Samar 8000
(a) What can be the primary key of table “Guide”? Justify.
(b) Is there any Foreign key in above tables set, if yes , name it.
(c) Write a query to display the total number of students in physics using having clause.
(d) How can we display list of all databases .
OR
There are two tables :
Student(sno, name, coach_no, grade)
Coach(coach_no, sport ,age)
There are 100 students and 10 coaches.
Answer following :

CS – 2
(a) What can be the degree and cardinality of both Student and Coach tables.
(b) Write a query to perform equi join based on above two tables.
(c) What is the main point of difference between drop table and delete from
command?
(d) How can we display the structure of the table student.
SECTION – B
Each question carries 3 marks
8. Raman Working in company’s IT department had created a dictionary containing the (3)
employee number as key and name, designation and salary of employees as values in form
of a list. Write User defined functions using STACKS as follows:
(i) PUSH() to push all the employee names in the stack who are “Clerks” with
salary less than 2500.
(ii) POP() to pop the entry from stack and display it, in case stack has no entries
give appropriate message.
For eg.: Consider following dictionary :
Emp={101:[“Rahul”,”Manager”,7000],102:[“Rahim”,”Clerk”,2000],103:[“Simaran”,”An
alyst,9000],105:[“Rekha”,”Clerk”,2450],109:[“Samar”,”Clerk”,2700],110:[“Piyush”,”Cler
k”,1200]}

The output of program will be :


Piyush Rekha Rahim
OR
Rahul had created a nested list where each nest (list) contains the roll number, name and
marks in three subjects in form of tuple. Help him to write following codes to perform
following using STACKS :
(i) PUSH() to push all the students names in the stack whose average marks are
more than 80.
(ii) POP() to pop the entry from stack and display it, in case stack has no entries
give appropriate message.
For eg.: Consider the following list :
Stud=[[1,’amar’,(85,88,87)],[2,’vidhisha’,(73,89,45)],[3,’rahul’,(90,78,82)],[4,’seema’,(78
,88,80)],[5,’vijay’,(76,76,90)],[6,’radha’,(45,67,78)]

Then output will be :


vijay seema rahul amar
9.(i) Consider a table “Customer_detail” with fields as ( cust_no, cust_name, room_type, (2)
num_of _days,cost_of_room), Now write queries to perform following:

(a) Add a new column as total_amount of type integer in above table


customer_detail
(b) Store the values in newly created column total_amount for all customers as
num_of_days X cost_of_room
(ii) Answer following with reference to python – mysql connectivity : (1)
(a) Write the command to clean up the environment, let the connection name be
mycon.
(b) Name the file required to import to perform mysql-python connectivity.
10. Rajat is working in a Educational Institute, he has been given the responsibility to (3)
computerize the exam related data and perform following tasks

He needs to create a database named as “EXAM”


He needs to create the table “Exam_detail” having following structure in database “Exam”

CS – 3
Column Name Data Type Size Constraint Description
Rollnumber Number 3 Primary Key
Class Number 2 Primary Key
Name Character 25 Should be compulsory to enter
Exam_name Character 20 Only Half Yearly, Terminal, Final
allowed
Marks Number 5,2 nonnegative and not more than 100
City Character 20 by default it should be Jodhpur
He needs to store some data in the table “Exam_detail”

Help him by writing the series of SQL commands/queries to perform above tasks.

SECTION – C
Each Question Carries 4 marks

11. Write queries (a) to (h) based on the tables STAFF and SUBJECT. (4)
STAFF
staffno firstname surname hire_date Designation Salary
102 Vikas Ahuja 15-10-2001 Professor 120000
103 Sanjay Choudhary 2-12-2004 Asso. Professor 180000
104 Raman srivastava 10-5-2005 Reader 140000
105 Shubhada Reddy 11-9-2002 Reader 110000
106 Vinay Mohant 13-6-2006 Asso.Professor 100000
107 Nirav Soni 22-8-1996 Reader 160000
SUBJECT
subno staffno subname fees
C21 102 System analysis 4000
C22 106 Sun Java NULL
C23 104 Computer Network 3000
C24 106 Web Hacking NULL
C25 102 Desk Top Publishing 1000
C26 105 C# and C++ 6000
C27 107 Visual Basic . Net 15000
(a) To display designation and number of staff getting more than 150000 salary in each
designation.
(b) To display firstname, surname, subname and fees of all staff whose designation is
‘Professor’
(c) To display all designation only once.
(d) To display all the information from subject table in alphabetical order of subname.
(e) To display all staff whose firstname starts with ‘R’ and surname ends with ‘a’ .
(f) To display all subject name with the firstname of the staff whose fees is still not decided.
(g) To display the firstname and hiredate of all readers whose salary is more than 100000.
(h) To display the firstname of the staff whose subname is “Web Hacking”

CS – 4
12.(a) Answer following : (2)
(i) Write any two advantages and two disadvantages between star topology and
bus topology.
(ii) How is IP address different from MAC address? Discuss briefly.
(b) (i) Expand and explain the protocols IMAP and VoIP. (2)
(ii) Identify domain name and URL from the following :
http://www.stannes.edu.in/login.html
OR
(i) How many switching techniques are there ? Explain any one.
(ii) Explain the difference between the terms “World Wide Web” and “Internet”.
13. XSD Institute of Senior studies in Bangalore is setting up a network between its different (4)
wings . There are four wings named as Medical(Med), Engineering(Engg), Business
Administration(BA), Foreign Language(FL).
A rough layout of same is as follows :
Med
BA

Engg

FL

Approximate distance between these units is as follows :


From To Distance
Med Engg 100 m
Med BA 200 m
Med FL 400 m
Engg BA 300 m
Engg FL 100 m
BA FL 450 m
In continuation of the above, the company experts have planned to install the following
number of computers in each of their office units:
Engg 150
Med 10
FL 7
BA 21
(a) Suggest the best cable layout for effective network connectivity of the building having
server with all the other buildings. Also suggest the most suitable wing to install the main
server in this institute to get efficient connectivity with a suitable reason.
(b) Suggest the placement of following devices with justification :
(i) Repeater (ii) Hub/Switch
(c) The institute management is planning to connect its Engg department to its office in a city
in hilly region where cable layout is not possible. Suggest an economical way to connect it
with reasonably high speed.
(d) Answer following:
(i) Arun and Seema study in medical wing, they are working on their own
connected laptops, working on a common assignment. Name the type of
network used by them.
(ii) Rahul and Aman work in “XSD” institute but in different departments. They
are connected to a common server and sit on different floors of a building.
Name the type of network used by them.

CS – 5
CS – 6

You might also like