0% found this document useful (0 votes)
18 views6 pages

TERM - 2 - XII - Computer SC - ANS

This document is a sample paper for Computer Science (083) with a total of 35 marks and divided into three sections: A, B, and C. Section A consists of 7 questions worth 2 marks each, Section B has 3 questions worth 3 marks each, and Section C contains 3 questions worth 4 marks each. The paper includes various topics such as data structures, SQL commands, networking concepts, and programming tasks.

Uploaded by

sathyaa.m1720
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views6 pages

TERM - 2 - XII - Computer SC - ANS

This document is a sample paper for Computer Science (083) with a total of 35 marks and divided into three sections: A, B, and C. Section A consists of 7 questions worth 2 marks each, Section B has 3 questions worth 3 marks each, and Section C contains 3 questions worth 4 marks each. The paper includes various topics such as data structures, SQL commands, networking concepts, and programming tasks.

Uploaded by

sathyaa.m1720
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

https://www.learnpython4cbse.

com
/

SAMPLE PAPER-4
COMPUTER SCIENCE (083)
Time allowed: 2 hours Maximum Marks: 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.

(SECTION A)
Each question carries 2 marks

Q1. Differentiate between queues and stacks (2)


Stacks Queues
A Stack is a data structure that follows the LIFO
A Queue follows the FIFO(First in First Out)
(Last In First Out) principle. principle.
We can add and remove an element from the It is open from both the ends hence we can
top/last place only easily
add elements to the back and can
We use append ( ) to add an element at the remove/delete
We use append ( ) to add an element at the
top/last place and pop( ) to remove the elements from the
top/last place front.
and pop(0) to remove the
element from the top/last element from the first place.
Q2. (i) Expand the following: (1)
HTTP,FTP
(ii) You want to share some audio files from your friend's laptop using Bluetooth what kind of
network is this? (1)
Ans. (i) Hyper Text Transfer Protocol, File Transfer Protocol
(ii) PAN-Personal Area Network
Q3. (i) Which constraint specifies the values in the column must be unique?
(ii) Which constraint specified with a column uniquely identifies each row in a table? (2)
Ans. (i) UNIQUE (ii) PRIMARY KEY
Q4. Differentiate between fetchone( ) and fetchall( ) (2)
Ans. fetchall( ) : Whenever we execute the SELECT query using the cursor.execute() method the
cursor.fetchall() method extracts a result set of all the rows. It returns these rows as a list of tuples.
An empty list is returned if there is no record to fetch.
fetchone( ): Whenever we execute the SELECT query using the cursor.execute() method it creates a
cursor object. The cursor.fetchone() method returns a single record as a tuple and it returns None if
no rows are available.

SAMPLE PAPER- LEARNPYTHON4CBSE Page | 1


https://www.learnpython4cbse.com
/

Q5. Write the output of the queries (a) to (d) based on the table SMARTWATCH, given below: (2)
Table: SMARTWATCH
WATCHID NAME PRICE QTY_STORE
W1 Fitbit Versa 21000 100
W2 Apple Watch 55000 150
W3 Garmin Fenix 75000 50
W4 Fitbit Versa 21000 100
W5 Samsung Galaxy 27000 200
W6 Amazfit Watch 17000 100
W7 Fossil Hybrid 15000 50

a) SELECT * FROM SMARTWATCH WHERE PRICE>=21000 AND QTY_STORE>100


b) SELECT SUM(QTY_STORE) FROM SMARTWATCH WHERE NAME IN ("Fitbit Versa", "Fossil
Hybrid");
c) SELECT MAX(PRICE)+ MIN(PRICE) FROM SMARTWATCH;
d) SELECT AVG(PRICE) FROM SMARTWATCH.
Ans. (a) W2 Apple Watch 55000 150 b) 250
W5 Samsung Galaxy 27000 200
(c) 90000 d) 33000

Q6. (i) Which command is used to see the table structure? (1)
(ii) What is a Cartesian join or product on two tables? (1)
Ans. (i) DESC tablename or DESCRIBE tablename
(ii) The Cartesian join is used to generate a paired combination of each row of the first table with
each row of the second table. This join type is also known as cross join. The resultant rows are a
product of the number of rows in each table.
Q7. In the table Loan below (2)
(a) Identify the candidate key(s) from the table Loan.
(b) Which field will be considered as the foreign key if the tables Customers and Loan are related
in a database?
Table Loan
LoanID LoanDate ID EMI Years

1101 2021-03-01 5 20000 4


1102 2021-02-06 3 10000 2
1103 2021-04-12 4 10000 3
1104 2021-05-15 5 5000 3

SAMPLE PAPER- LEARNPYTHON4CBSE Page | 2


https://www.learnpython4cbse.com
/

Table Customers:

ID Name Age City Salary


1 Kashika 37 Jammu 80000.00
2 Anupriya 35 Shimla 75000.00

3 Vijayan 36 Hyderabad 65000.00


4 Krishnan 35 Chennai 55000.00
5 Harsh 37 Gandhinagar 85000.00

6 Raisa 32 Mumbai 45000.00

Ans. a) LoanlD and LoanDate b) ID is the foreign key

(SECTION B)
Each question carries 3 marks

Q8. Coach Abhishek stores the races and participants in a dictionary. Write a program, with separate
user defined functions to perform the following operations: (3)
• Push the names of the participants of the dictionary onto a stack, where the distance is more
than 100.

• Pop and display the content of the stack. For example:


If the sample content of the dictionary is as follows:
Races ={100:'Varnika', 200 :'Jugal', 400:'Kushal',800:'Minisha'}}
The output from the program should be:
Minisha Kushal Jugal
Ans. Races ={100:'Varnika',200:'Jugal', 400:'Kushal',800:'Minisha'}
def PUSH(Stk,N):
Stk.append(N)
def POP(Stk):
if Stk! = []:
return Stk.pop()
else:
return None
stack1=[]
for i in Races:
if i>=200:
PUSH(stack1,Races[i])

SAMPLE PAPER- LEARNPYTHON4CBSE Page | 3


https://www.learnpython4cbse.com
/

while True:
if stack1!=[]:
print(POP(stack1),end="")
else:
break
Q9. (i) A table, Students has been created in a database with the following (3)
fields: StudentID, NAME, DOB, CITY, MARKS
Give the SQL command to change the datatype of CITY from Varchar(30) to Char(30).
(ii) Which of the following is a DML command?
SELECT...FROM, CREATE TABLE, INSERT, UPDATE
Ans. (i) ALTER TABLE Students MODIFY COLUMN CITY char(30);
(ii) DML: SELECT...FROM, INSERT INTO, UPDATE...SET
Q10. Maniklal Fabrics is creating a database called Stores with a table called City_Store. Write the SQL
commands for doing the same. (3)
Store id INT Primary Key
Manager Varchar(20)
Address Varchar(30)
City Varchar(20)
City_Code Char(5)
Last_update Date

Ans. The SQL commands are:


CREATE DATABASE STORES;
CREATE TABLE City_Store (Store_id INT PRIMARY KEY, Manager
VARCHAR(20),
Address VARCHAR(30), City VARCHAR(20), City_Code CHAR(5),
Last_update date );
(SECTION C)
Each question carries 4 marks

Q11. A database called ecompany has two tables COMPANY and CUSTOMER with the following records.
Write SQL commands for the queries (a)-(d) based on the two tables COMPANY and CUSTOMER: (4)

SAMPLE PAPER- LEARNPYTHON4CBSE Page | 4


https://www.learnpython4cbse.com
/

Table: COMPANY
PID NAME CITY PRODUCTNAME
2101 APPLE DELHI WATCH
102 SAMSUNG BANGALORE MOBILE
2103 PANASONIC DELHI TV
2104 SONY MUMBAI MOBILE
2105 LENOVO INDORE TABLET
2106 DELL MUMBAI LAPTOP

Table: COUSTMER
CUSTID NAME UNITPRICE QTY PID
101 REENA SONI 60,000 10 2102
102 MICHAEL PAUL 50,000 20 2106
103 MEETALI SINGH 70,000 15 2101
104 PARULSOHAL 55,000 3 2103
105 RAJESH DESWAL 45,000 7 2104

a) Write an SQL statement to display the name of the companies in reverse alphabetical order.
b) To add one more column to the table customer called TOTAL_PRICE which can have up to two
decimal places.
c) Write an SQL statement to count the products city wise.
d) Write an SQL statement to display the customer name, product of the unit price and quantity,
product name where the name of the city is Mumbai.
Ans. a) SELECT NAME FROM COMPANY ORDER BY NAME DESC;
b) ALTER TABLE CUSTOMER ADD TOTAL_PRICE DECIMAL(10,2);
c) SELECT COUNT(*), CITY FROM COMPANY GROUP BY CITY;
d) SELECT CUSTOMER.NAME, UNITPRICE*QTY, PRODUCTNAME FROM COMPANY,
CUSTOMER WHERE COMPANY.PID=CUSTOMER.PID AND CITY= 'MUMBAI';
Q12. (i) Give two advantages and two disadvantages of ring topology. (4)

OR
Define the following terms:
Web Browser, Web server
(ii) Differentiate between wired and wireless Transmission Media.
Ans. Ring Topology
Advantages Disadvantages
This arrangement prevents collisions. Needs more cable than bus.

SAMPLE PAPER- LEARNPYTHON4CBSE Page | 5


https://www.learnpython4cbse.com
/

Data packets travel at greater speeds. Any snag in the cable ring crashes the network.
Any problems with device and cable can be The network activity is disturbed when adding
easily located. or removing a node.

OR
Web Browser: This is an application software used to view or browse web pages from a web server.
Have to type the exact URL to view the web page to request for a web page. This has no database.
Google Chrome, Safari, Mozilla Firefox, Microsoft Edge are some popular web browsers.
Web Server: This is a technologically advanced machine that stores all the files containing the web
pages which can be viewed by the web browser. Web Servers store, process and deliver web pages
to the users when they receive a request from a browser. The Web Server provides the storage
space for website files. Apache Server is the most popular server.
(ii) Wired Transmission Media: Wired transmission media are the cables that are used in networking.
Popular wired transmission media are twisted pair cable, co-axial cable and fiber optical cable.
Each of them has its own characteristics like transmission speed, effect of noise, physical
appearance, cost etc.
Wireless Transmission Media: Wireless transmission media are the ways of transmitting data
without using any cables. Nowadays wireless communication is becoming popular as it is not
bounded by physical geography. This transmission uses Microwave, Radio wave, Infrared or a
combination of these.

Q13. Jeevan CareGivers Company has set up its head office with 4 blocks of buildings named Block A,
Block B, Block C and Block D. (4)
The number of computers in each block are:
Block A-25 Block B-50
Block C-125 Block D-10
Shortest distances between various Blocks in meters:
Block A to Block B-60 m Block B to Block C-40 m
Block C to Block A-30 m Block D to Block C-50 m
(i) Suggest the most suitable place (i.e. block) to house the server of this company with a suitable
reason.
(ii) Suggest the type of network to connect all the blocks with suitable reason.
(iii) The company is planning to link all the blocks through a secure and high speed wired medium.
Suggest a way to connect all the blocks.
(iv) Suggest the most suitable wired medium for efficiently connecting each computer installed in
every block out of the following network cables:
• Coaxial Cable • Ethernet Cable • Single Pair Telephone Cable.
Ans. (i) Block C , It has maximum number of computer.
(ii) Since the distance between the blocks is less than 1 Km and LAN can be upto 10 Km
(iii) Star topology (iv) Ethernet Cable

SAMPLE PAPER- LEARNPYTHON4CBSE Page | 6

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy