CS Final

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

कें द्रीय विद्यालय संगठन क्षेत्रीय कायाालय रायपुर

Kendriya Vidyalaya Sangathan Regional Office Raipur

COMPUTER SCIENCE

Class - XII
Question Bank Term- II 2021-22
कें द्रीय विद्यालय सगं ठन क्षेत्रीय कायाालय रायपरु
Kendriya Vidyalaya Sangathan Regional Office Raipur

MESSAGE FROM DUPUTY


COMMISSIONER

It gives me immense pleasure to bring out the study material for 2 nd Term in
different subject of Classes X and XII for Raipur Region. All of us know that in the
1st Term Examination questions were objective but in 2nd Term questions will be
subjective so once again to get our children acquainted and familiarized with the new
scheme of examination and types of questions, it is of utmost significance that an
extensive study material should be provided to our children. This question bank is
in complete consonance with CBSE Circular Number 51 and 53 issued in the month
of July 2021. It will help students to prepare themselves better for the examination.
Sound and deeper knowledge of the Units and Chapters is must for grasping the
concepts, understanding the questions. Study materials help in making suitable and
effective notes for quick revision just before the examination.

Due to the unprecedented circumstances of COVID-19 pandemic the


students and the teachers are getting very limited opportunity to interact face to face
in the classes. In such a situation the supervised and especially prepared value
points will help the students to develop their understanding and analytical skills
together. The students will be benefitted immensely after going through the question
bank and practice papers. The study materials will build a special bond and act as
connecting link between the teachers and the students as both can undertake a
guided and experiential learning simultaneously. It will help the students develop
the habit of exploring and analyzing the Creative & Critical Thinking Skills. The
new concepts introduced in the question pattern related to case study, reasoning
and ascertain will empower the students to take independent decision on different
situational problems. The different study materials are designed in such a manner
to help the students in their self-learning pace. It emphasizes the great pedagogical
dictum that ‘everything can be learnt but nothing can be taught’. The self-motivated
learning as well as supervised classes will together help them achieve the new
academic heights.

I would like to extend my sincere gratitude to all the principals and the teachers
who have relentlessly striven for completion of the project of preparing study
materials for all the subjects. Their enormous contribution in making this project
successful is praiseworthy.
Happy learning and best of luck!

Vinod Kumar
(Deputy Commissioner)
कें द्रीय विद्यालय सगं ठन क्षेत्रीय कायाालय रायपरु
Kendriya Vidyalaya Sangathan Regional Office Raipur

Our Patorn

Vinod Kumar
Deputy Commissioner
KVS RO Raipur

Smt.Biraja Mishra Sh.A.K. Mishra


Assistant Commissioner Assistant Commissioner
KVS RO Raipur KVS RO Raipur
SUBJECT CO-ORDINATION BY

Mrs. Sandhya Lakra,


Principal, KV No. 4 Korba

CONTENT TEAM
Mrs. Tara Yadav, PGT CS, K V Bilaspur

Mr. P. L. Sahu, PGT CS, K V Dhamtari

Mr. Lokesh Singh, PGT CS, K V Mahasamund

COMPILATION, REVIEW & VETTING


BY
Mr. Prakash Kumar Dewangan, PGT CS, KV No. 1 Shift II Raipur
TERM-2
Unit I: Computational Thinking and Programming – 2

• Data Structure: Stack, operations on stack (push & pop), implementation of stack using
list.

Unit II: Computer Networks


● Evolution of networking: introduction to computer networks, evolution of networking
(ARPANET, NSFNET, INTERNET)
● Data communication terminologies: concept of communication, components of data
communication (sender, receiver, message, communication media, protocols),
measuring capacity of communication media (bandwidth, data transfer rate), IP
address, switching techniques (Circuit switching, Packet switching)
● Transmission media: Wired communication media (Twisted pair cable, Co-axial cable,
Fiber-optic cable), Wireless media (Radio waves, Micro waves, Infrared waves

● Network devices (Modem, Ethernet card, RJ45, Repeater, Hub, Switch, Router, Gateway,
WIFI card)
● Network topologies and Network types: types of networks (PAN, LAN, MAN, WAN),
networking topologies (Bus, Star, Tree)
● Network protocol: HTTP, FTP, PPP, SMTP, TCP/IP, POP3, HTTPS, TELNET, VoIP
● Introduction to web services: WWW, Hyper Text Markup Language (HTML),
Extensible Markup Language (XML), domain names, URL, website, web browser, web
servers, web hosting
Unit III: Database Management
• Database concepts: introduction to database concepts and its need
• Relational data model: relation, attribute, tuple, domain, degree, cardinality, keys
(candidate key, primary key, alternate key, foreign key)
• Structured Query Language: introduction, Data Definition Language and Data
Manipulation Language, data type (char(n), varchar(n), int, float, date), constraints
(not null, unique, primary key), create database, use database, show databases, drop
database, show tables, create table, describe table, alter table (add and remove an
attribute, add and remove primary key), drop table, insert, delete, select, operators
(mathematical, relational and logical), aliasing, distinct clause, where clause, in,
between, order by, meaning of null, is null, is not null, like, update command, delete
command

• Aggregate functions (max, min, avg, sum, count), group by, having clause, joins
:Cartesian product on two tables, equi-join and natural join
• Interface of python with an SQL database: connecting SQL with Python, performing
insert, update, delete queries using cursor, display data by using fetchone(), fetchall(),
rowcount, creating database connectivity applications

1. Practical
S.No Marks Term- Term-
(Total 1 2
30) (15 (15
Marks) Marks)
1 Lab Test:

1. Python program 8 6 2

2. 3 SQL Queries based on one/two table(s), 4 --- 4


2 output questions based on SQL queries
2 Report file: 7 4 3
Term – 1 : Minimum 15 Python programs
based on Term - 1 Syllabus
Term – 2 :
• Minimum 3 Python programs based
on Term-2 Syllabus
• SQL Queries – Minimum 5 sets using
one table / two tables.
• Minimum 2 programs based on
Python - SQL connectivity.
3 Project (using concepts learnt in 8 3 5
Classes 11 and 12) Term – 1 : Synopsis
of the project to be submitted by the
students (documentation only, may not
submit the code during Term - 1)

Term - 2 : Final coding + Viva voce


(Student will be allowed to modify their
Term 1 document and submit the final
executable code.)
4 Viva voce 3 2 1

2. Suggested Practical List:


Term-2
Python Programming
● Write a Python program to implement a stack using list.
Database Management
● Create a student table and insert data. Implement the following SQL commands
on the student table:
o ALTER table to add new attributes / modify data type / drop attribute
o UPDATE table to modify data
o ORDER By to display data in ascending / descending order
o DELETE to remove tuple(s)
o GROUP BY and find the min, max, sum, count and average
o Joining of two tables.
● Similar exercise may be framed for other cases.
● Integrate SQL with Python by importing suitable module.
Database Management
● Create a student table and insert data. Implement the following SQL commands
on the student table:
o ALTER table to add new attributes / modify data type / drop attribute
o UPDATE table to modify data
o ORDER By to display data in ascending / descending order
o DELETE to remove tuple(s)
o GROUP BY and find the min, max, sum, count and average

● Similar exercise may be framed for other cases.


● Integrate SQL with Python by importing suitable module.

3. Suggested Reading Material


• NCERT Textbook for COMPUTER SCIENCE (Class XII)
• Support Materials on the CBSE website.

4. Project

The aim of the class project is to create something that is tangible and useful using
Python file handling/ Python-SQL connectivity. This should be done in groups of two
to three students and should be started by students at least 6 months before the
submission deadline. The aim here is to find a real world problem that is worthwhile to
solve.

Students are encouraged to visit local businesses and ask them about the problems
that they are facing. For example, if a business is finding it hard to create invoices for
filing GST claims, then students can do a project that takes the raw data (list of
transactions), groups the transactions by category, accounts for the GST tax rates,
and creates invoices in the appropriate format. Students can be extremely creative
here. They can use a wide variety of Python libraries to create user friendly
applications such as games, software for their school, software for their disabled
fellow students, and mobile applications, of course to do some of these projects,
some additional learning is required; this should be encouraged. Students should
know how to teach themselves.

The students should be sensitised to avoid plagiarism and violations of copyright


issues while working on projects. Teachers should take necessary measures for this.
Multiple Choice Questions (MCQs)
Choose the correct answer from the given below:

1. A Computer Network:
A. Is a collection of hardware components and computers?
B. Is interconnected by communication channels
C. Allows sharing of resources and information
D. All of the above
2. What is a Firewall in computer network?
A. The physical boundary of network
B. An operating system of computer network
C. A system designed to prevent unauthorized access
D. A web browsing software
3. What is the use of Bridge in the Network?
A. To connect LANs
B. To separate LANs
C. To control network speed
D. All of the above
4. Each IP packet must contain:
A. Only Source address
B. Only Destination address
C. Source and Destination address
D. Source or Destination address

5. Which of these is not a communication channel?


A. Satellite
B. Microwave
C. Radio wave
D. Wi-Fi

6. MAN Stands for _____.


A. Metropolitan Area Network
B. Main Area Network
C. Metropolitan Access Network
D. Metro Access Network
7. Which of the following is the smallest network?
A. WAN
B. MAN
C. PAN
D. LAN
8. Which transmission media is capable of having a much higher bandwidth (data
capacity)?
A. Coaxial
B. Twisted pair cable
C. Untwisted cable
D. Fiber optic
9. Which type of transmission media is the least expensive to manufacture?
A. Coaxial
B. Twisted pair cable
C. CAT cable
D. Fiber optic
10. A device that forwards data packet from one network to another is called a
A. Bridge
B. Router
C. Hub
D. Gateway

11. What is a standalone computer?


A. A computer that is not connected to a network
B. A computer that is being used as a server
C. A computer that does not have any peripherals attached to it
D. A computer that is used by only one person

12. Which of the following is the fastest media of data transfer?


A. Co-axial Cable
B. Untwisted Wire
C. Telephone Lines
D. Fiber Optic

13. Hub is a
A. Broadcast device
B. Unicast device
C. Multicast device
D. None of the above
14. Switch is a
A. Broadcast device
B. Unicast device
C. Multicast device
D. None of the above

15. The device that can operate in place of a hub is a:


A. Switch
B. Bridge
C. Router
D. Gateway

16. In computer, converting a digital signal in to an analog signal is called


A. modulation
B. demodulation
C. conversion
D. transformation
17. What is the address size of IPv6?
A. 32 bit
B. 64 bit
C. 128 bit
D. 256 bit

18. Which of these is not an example of unguided media?


A. Optical Fibre Cable
B. Radio wave
C. Bluetooth
D. Satellite
19. Two devices are in network if
A. A process in one device is able to exchange information with a process in another
device
B. A process is running on both devices
C. The processes running of different devices are of same type
D. None of the above.

20. Which of the following is not the Networking Devices?


A. Gateways
B. Linux
C. Routers
D. Firewalls

21. The location of a resource on the internet is given by its?


A. Protocol
B. URL
C. E-mail address
D. ICQ

22. The term HTTP stands for?


A. Hyper terminal tracing program
B. Hypertext tracing protocol
C. Hypertext transfer protocol
D. Hypertext transfer program

23. Which software prevents the external access to a system?


A. Firewall
B. Gateway
C. Router
D.Virus checker

24. Which one of the following is the most common internet protocol?
A.HTML
B.NetBEUI
C.TCP/IP
D.IPX/SPX

25. The term FTP stands for?


A.File transfer program
B.File transmission protocol
C.File transfer protocol
D.File transfer protection

26. Which one of the following is not a network topology?


A.Star
B.Ring
C.Bus
D.Peer to Peer

27. Which of the following is not an unit for data transfer rate?
A.MBPS
B.KBPS
C.SBPS
D.GBPS

28. This was the first network.


A.CSNET
B.NSFNET
C.ANSNET
D.ARPANET
29. A_______is a data communication system within a building, plant, orcampus, or
between near by buildings.
A.MAN
B.LAN
C.WAN
D. None of the above

30. _________________ is a collection of many separate networks


A. A MAN
B. An internet
C. A LAN
D. None of the above

31. A________is a set of rules that governs data communication.


A. forum
B. protocol
C. standard
D. None of the above
32. Which of the following is required to communication between two computers?
A. Communication hardware
B. Communications software
C. Protocol
D. All of above including access to transmission medium

33. Bluetooth is an example of


A. Wide area network
B. Virtual private network
C. Local area network
D. Personal area network

34. A device which can be connected to a network without using cable is called
A. Distributed device
B. Centralized device
C. Open-source device
D. Wireless device

35. The vast network of computers that connects millions of people all over the world
is called
A. Internet
B. Hypertext
C. LAN
D. Web

36. MAC address is of ___________


A. 24 bits
B. 36 bits
C. 42 bits
D. 48 bits

37. Which of the following appears harmless but actually performs malicious functions
such as deleting or damaging files.
A.WORM
B.Virus
C.Trojan Horse
D. Malware

38. Name the protocol that is used to send emails


A.FTP
B.SMTP
C.HTTP
D.TCP

39. Name the protocol that is used to receive emails


A.POP
B.VOIP
C.DHCP
D.FTP

40. Rajesh has purchased a new Smart TV and wants to cast a video from his mobile
to his new Smart TV. Identify the type of network he is using:
A.LAN
B.MAN
C.WAN
D.PAN

41. The topology in which all nodes are individually connected to a central
connection point:
A.Ring
B.Bus
C.Star
D.Tree

42. Which of the following best describes uploading information?


A.Sorting data on a disk drive
B.Sending information to a host computer
C.Receiving information from a host computer
D.Sorting data on a hard drive

43. The term IPv4 stands for?


A.Internet Protocol Version 4
B.Internet Programming Version 4
C.International Programming Version 4
D.None of these

4. In specific, if the systems use separate protocols, which one of the following
devices is used to link two systems?
A.Repeater
B.Gateway
C.Bridge
D.Hub

45. DNS is the abbreviation of


A. Dynamic Name System
B. Dynamic Network System
C. Domain Name System
D. Domain Network Service

46. What is the meaning of Bandwidth in Network?


A. Transmission capacity of a communication channels
B. Connected Computers in the Network
C. Class of IP used in Network
D. None of Above
47. What does protocol defines?
A. Protocol defines what data is communicated.
B. Protocol defines how data is communicated.
C. Protocol defines when data is communicated.
D. All of above

48. Which of the following can be Software?


A. Routers
B. Firewalls
C. Gateway
D. Modems

49. The loss in signal power as light travels down the fiber is called.............
A. Attenuation
B.Propagation
C. Scattering
D.Interruption

50. Which of the following TCP/IP protocols is used for transferring files form one
machine to another.
A. FTP
B. SNMP
C. SMTP
D. RPC

51. Which of the following protocol is used for remote terminal connection service?
A. RARP
B. UDP
C. FTP
D. TELNET

52. Which of the following is considered as the unsolicited commercial email?M


A.Virus
B.Malware
C.Spam
D.All of the above

53. It can be a software program or a hardware device that filters all data packets
coming through the internet, a network, etc. it is known as the_______:
A.Antivirus
B.Firewall
C.Cookies
D.Malware

54. The term "TCP/IP" stands for_____


A.Transmission Contribution protocol/ internet protocol
B.Transmission Control Protocol/ internet protocol
C.Transaction Control protocol/ internet protocol
D.Transmission Control Protocol/ internet protocol

55. Which of the following is a type of independent malicious program that never
required any host program?
A. Trojan Horse
B. Worm
C.Trap Door
D.Virus

56. In order to ensure the security of the data/ information, we need to ____________
the data:
A.Encrypt
B.Decrypt
C.Delete
D.None of the above

57. Firewall is the type of ………..


A. Virus
B. Security threats
C. Worm
D. None of the above.

58. It allow a visited website to store its own information about a user on the user’s
computer:
A.Spam
B.cookies
C.Malware
D.Adware

59. In which of the following switching methods, the message is divided into small
packets?
A. Message switching
B. Packet switching
C. Circuit switching
D. None of these

60. Which of the following switch methods creates a point-to-point physical


connection between two or more computers?
A. Message switching
B. Packet switching
C. Circuit switching
D. None of these
61. MAC address is also called ______.
A.Physical address
B.Logical address
C.Source address
D.Destination address

62. ARPANET stands for _______.


A.Advanced Recheck Projects Agency Internet
B.Advanced Recheck Projects Agency Network
C.Advanced Research Projects Agency Network
D.Advanced Research Projects Agency Internet
63. Which of the following devices is not a networking device?
A.Hub
B.Switch
C.Bridge
D.None of these

64. How many pins does RJ-45 contain?


A.Two
B.Four
C.Eight
D.Ten

65. NIC Stands for –


A.Network identity card
B.Network interface code.
C.National interface card
D.Network interface card

66. Which of the following is not a type of guided or wired communication channel?
A.Twisted Pair
B.Coaxial
C.Fibre Optic
D.WiMax

67. Which of the following is not a type of unguided or wireless communications


channel?
A. Microwave
B. Radiowave
C. Ethernet
D. Sattelite

68. Which of the following wireless medium consists of a parabolic antena mounted
on towers?
A.Sattelite
B.Radiowave
C.Microwave
D.Infrared
69. Which of the following cable consist of a solid wire core surrounded by one or
more foil or wire shields?
A.Ethernet Cables
B.Coaxial Cables
C.Fibre Optic Cables
D.Power Cable

70. A collection of hyperlinked documents on the internet forms the ?


A.World Wide Web (WWW)
B.E-mail system
C.Mailing list
D.Hypertext

71. Protocols are set of rules to govern _________


A. Communication
B. Standard
C. Metropolitan communication
D. Bandwidth

72. An internet is a __________


A. Collection of WANS
B. Network of networks
C. Collection of LANS
D. Collection of identical LANS and WANS

73. Which protocol is commonly used to retrieve email from a mail server?
A. FTP
B. IMAP
C. HTML
D. TELNET

74. Which of the following allows user to view a webpage?


A. Operating System
B. Website
C. Interpreter
D. Internet Browser

75. A network router joins two _________ together?


A. Computers
B. Switches
C. Networks
D. Gateway

76. A network point that provides entrance into another network is called as ___________
A. Node
B. Gateway
C. Switch
D. Router

77. TELNET used _________ protocol for data connection


A. TCP
B. UDP
C. IP
D. DHCP

78. Google Chrome is example of :


A.Programming Language
B.Web Server
C.Protocol
D. Web Browser

79. Name the transmission media best suitable for connecting to hilly areas.
A.Co-axial Cable
B.Twisted pair
C. Microwave
D.Optical fiber.

80. Rahul wants to establish computer network in his cyber café, which of the following
device will be suggested by you to connect each computer in the cafe?
A.Switch
B.Modem
C.Gateway
D.Repeater

Very Short Answer Type Questions (1 mark)

Q1. Give one example of each – Guided media and unguided media.
Ans: Guided – Twisted pair, Coaxial Cable, Optical Fiber (any one) Unguided –
Radio waves, Satellite, Micro Waves (any one)
Q2. Name the protocol that is used to transfer file from one computer to another.
Ans:FTP
Q3. Name the transmission media best suitable for connecting to desert areas.
Ans: Microwave
Q4. Rearrange the following terms in increasing order of speedy medium of data
transfer: Telephone line, Fiber Optics, Coaxial Cable, Twisted Paired Cable.
Ans: Telephone line, Twisted Pair Cable, Coaxial Cable, Fiber Optics.
Q5.Which of the following appears harmless but actually performs malicious
functions such as deleting or damaging files.
(a) WORM (b)Virus (c) Trojan Horse
(d)Malware
Ans: (c) Trojan Horse
Q6. Name the transmission media suitable to establish PAN.
Ans: Bluetooth, infra-red
Q7. Name the protocol that is used to upload and download files on internet.
Ans: FTP or HTTP
Q8.Name the protocol that is used to send emails.
Ans:-SMTP
Q9. Name the protocol that is used to receive emails.
Ans:-POP
Q10. Name the transmission media best suitable for connecting to hilly areas.
Ans: Microwave / Radio wave.
Q11. Name the fastest available transmission media.
Ans: OFC (Optical Fiber Cable)

Q12. Sunil has purchased a new Smart TV and wants to cast a video from his mobile to his
new Smart TV. Identify the type of network he is using and explain it.
Ans: Sunil is using PAN-Personal Area Network. It is a private network which is setup by
an individual to transfer data among his personal devices of home.

Short Answer Type Questions (2 mark)

Q1. Expand the following terms:


IPR – Intellectual Property Rights SIM – Subscriber‟s Identity Module
IMAP – Internet Message Access Protocol HTTP – Hypertext transfer Protocol
URL - Uniform Resource Locator POP3-Post office protocol ver. III SMTP- Simple
Mail Transfer Protocol VOIP- Voice over internet Protocol TCP- Transmission
control protocol Wi-Fi - Wireless Fidelity
GPRS – General Packet Radio Service IRC – Internet Relay Chat
CDMA- Code Division Multiple Access TDMA- Time Division Multiple Access VPN-
Virtual Private Network
FLOSS- Free Libre Open Source Software XML-Extensible Markup Language
SMS–Short Messaging Service
GSM-Global system for mobile communication PHP- Hypertext Preprocessor
FTP- File Transfer Protocol
DHCP-Dynamic Host Configuration Protocol

Q2. What is difference between star topology and bus topology of network?
Аnswer:
In star topology, nodes are connected to server individually whereas in bus topology
all nodes are connected to server along a single length of cable.

Q3.Write two advantages of using an optical fibre cable over an ethernet cable to connect
two service stations, which are 190 m away from each other.
Аnswer:
Low power Because signals in optical fibres degrade less, lower power transmitters can be
used.
Higher datarate Due to higher bandwidth, data rate of optical fibre is more than the data
rate of ethernet cable (upto 1 Gbps).

Q4.Differentiate between packet switching and message switching technique in network


communication.
Аnswer:
Message Switching In message switching data is stored in buffer form. The message is,
sent to the nearest directly connected switching node. This process continues until data is
delivered to the destination computer.
Packet Switching In this form of switching data is transferring into packet form. A fixed
size of packet that can be transmitted across the network is specified. All the packets are
stored in the main memory instead of disk.

Q5. Which type of network (out of LAN, PAN and MAN) is formed, when you connect
two mobiles using bluetooth to transfer a picture file?
Аnswer:
When two mobiles are connected using bluetooth to transfer a picture file, a PAN(Personal
Area Network) is created.

Q6.What is the difference between HTTP and FTP?


Аnswer:
FTP is a protocol used to upload files from a workstation to a FTP server or download files
from a FTP server to a workstation.
HTTP is a protocol used to transfer files from a web server onto a browser in order to view
a web page that is on the Internet.
Q7. What is the advantage of using SWITCH over HUB?
Аnswer:
Switch provides a dedicated line at full bandwidth between two devices but hub doesn’t
provide a dedicated line. Hub share the bandwidth.

Q8.What is difference between star topology and bus topology of network?


Аnswer:
In star topology, nodes are connected to server individually whereas in bus topology all nodes
are connected to server along a single length of cable.

Q9.Define the term firewall.

Answer:
Firewall is a feature used for Network Security. In a Network there is always danger
of information leaking out or leaking in. Firewall is a feature which forces all
information entering or leaving the network to pass through a check to make sure
that there is no unauthorized usage of the network.

Q10.What is the importance of URL in networking?

Answer:
URL stands for Uniform Resource Locator. Each page that is created for Web
browsing is assigned a URL that effectively serves as the page’s worldwide name or
address. URL’s have three parts: the protocol, the DNS name of the machine on
which the page is located and a local name uniquely indicating the specific
page(generally the filename).

Long Answer Type Questions (5/4 marks)

Q1.PVS Computers decided to open a new office at Ernakulum, the office consist
of Five Buildings and each contains number of computers. The details are shown
below.

Building-2
Building-1

Distance between the buildings

Building-3
Building-5

Building-4
Building 20
1 and 2 Meters
Building 50
2 and 3 Meters
Building 120
3 and 4 Meters
Building 70
3 and 5 Meters
Building 65
1 and 5 Meters
Building 50
2 and 5 Meters

Computers in each building are networked but buildings are not networked so far.
The Company has now decided to connect building also.

(i) Suggest a cable layout for connecting the buildings


(ii) Do you think anywhere Repeaters required in the campus? Why
(iii) The company wants to link this office to their head office at Delhi
(a) Which type of transmission medium is appropriate for such a link?
(b) What type of network would this connection result into?
(iv) Where server is to be installed? Why?
(v) Suggest the wired Transmission Media used to connect all buildings efficiently.
Ans:-
(i) Any efficient layout with shortest Wire length
(ii) Between 3 and 4 due to larger distance
(iii) (a) Wireless
(a) WAN
(iv) Building-3 due to maximum no of Computers
(v) Co- axial cable or fiber optics

Q2. Riana Medicos Centre has set up its new centre in Dubai. It has four buildings as
shown in the diagram given below:
(4)

Research lab
Accounts
Packaging Store
unit

Distance between various buildings is as follows:

Accounts to Research
Lab 55 m
Accounts to Store 150 m
Store to Packaging Unit 160 m
Packaging Unit to
Research Lab 60 m
Accounts to Packaging
Unit 125 m
Store to Research Lab 180 m
Number of computers:

Accounts 25
Research Lab 100
Store 15
Packaging Unit 60
As a network expert, provide the best possible answer to the following queries:
(i) Suggest the type of network established between the buildings.
(ii) Suggest the most suitable place (i.e., building) to house the server of this organization.
(iii) Suggest the placement of the following devices with justification: Repeater, Switch
(iv) Suggest a system (hardware/software) to prevent unauthorized access to or from the
network.

Ans. (i) LAN (Local Area Network)


(ii) Research Lab as it has the maximum number of computers.

(iii) (a) Repeater: It should be placed between Accounts and Packaging Unit, Accounts to
Research Lab, Store to Research Lab and Accounts to Packaging Unit.
(b) Switch should be placed in each of the buildings for better traffic management.
(iv) Firewall.

Q3. “Bhartiya Connectivity Association” is planning to spread their offices in four major
cities in India to provide regional IT infrastructure support in the field of Education &
Culture. The company has planned to setup their head office in New Delhi in three locations
and have named their New Delhi offices as “Front Office”, “Back Office” and “Work
Office”. The company has three more regional offices as “South Office”, “East Office” and
“West Office” located in other three major cities of India. A rough layout of the same is as
follows:

Approximate distance between these offices as per network survey team is as follows:

Place From Place To Distance


BackOffice Front Office 10KM
Back Office Work Office 70 Meter
Back Office East Office 1291 KM
BackOffice West Office 790 KM
Back Office South Office 1952 KM

In continuation of the above, the company experts have planned to install the following
number of computers in each of their offices:
Back Office 100
Front Office 20
Work Office 50
East Office 50
West Office 50
South Office 50
(i) Suggest network type (out of LAN, MAN, WAN) for connecting each of the
following set of their offices:
• Back Office and Work Office
• Back Office and South Office
(ii) Which device you will suggest to be procured by the company for connecting all the
computers with in each of their offices out of the following devices?
• Switch/Hub
• Modem
• Telephone

(iii) Which of the following communication medium, you will suggest to be procured
by the company for connecting their local offices in New Delhi for very effective and
fast communication?
• Telephone Cable
• Optical Fiber
• Ethernet Cable

(iv) Suggest a cable/wiring layout for connecting the company’s local offices located in
New Delhi. Also, suggest an effective method/technology for connecting the
company’s regional offices-”East Office”, “West Office” and “South Office” with
offices located in New Delhi.
Answer:
(i) Network type: Head Office and Tech: LAN
Head Office and Coimbatore Office: WAN

(ii) Switch/Hub
(iii) Optical fiber
(iv) (a) Optical Fiber/Star Topology
(b) Wireless
Q4. Knowledge Supplement Organization has set up its new center at Mangalore for its
office and web based activities. It has 4 blocks of buildings as shown in the diagram below:

Block A
Block C

Block B Block D

Center to center distances between various blocks

Black A to Block B 50 m
Block B to Block C 150 m
Block C to Block D 25 m
Block A to Block D 170 m
Block B to Block D 125 m
Block A to Block C 90 m

Number of Computers
Black A 25
Block B 50
Block C 125
Block D 10

a) Suggest a cable layout of connections between the blocks.


b) Suggest the most suitable block to house the server of this organisation with a suitable
reason n
c) Suggest the placement of the following devices with justification
(i) Repeater
(ii) Hub/Switch
d) The organization is planning to link its front office situated in the city in a hilly region
where cable connection is not feasible, suggest an economic way to connect it with
reasonably high speed?
Answer:
(a) Any of the following option
Layout Option 1:

Block A Block C

Block B Block D

Layout Option 2: Since the distance between Block A and Block B is quite short

Block A Block C

(b)
Block B Block D
(c)

(b) The most suitable place / block to house the server of this organization would be Block C, as
this block contains the maximum number of computers, thus decreasing the cabling cost for
most of the computers as well as increasing the efficiency of the maximum computers in the
network.
(c) For Layout 1, since the cabling distance between Blocks A and C, and that between B and C
are quite large, so a repeater each, would ideally be needed along their path to avoid loss of
signals during the course of data flow in these routes
For layout 2, since the distance between Blocks A and C is large so a repeater would ideally
be placed in between this path
(d) The most economical way to connect it with a reasonable high speed would be to use radio
wave transmission, as they are easy to install, can travel long distances, and penetrate
buildings easily, so they are widely used for communication, both indoors and outdoors.
Q5. Ravya Industries has set up its new center at Kaka Nagar for its office and web based
activities. The company compound has 4 buildings as shown in the diagram below:

Fazz
Raj
Building
Building

Jazz
Building
Harsh
Building

Center to center distances between various buildings is as follows:

Harsh Building to Raj Building 50 m


Raz Building to Fazz Building 60 m
Fazz Building to Jazz Building 25 m
Jazz Building to Harsh Building 170 m
Harsh Building to Fazz Building 125 m
Raj Building to Jazz Building 90 m

Number of Computers in each of the buildings is follows:


Harsh Building 15
Raj Building 150
Fazz Building 15
Jazz Bulding 25

a) Suggest a cable layout of connections between the buildings.

b) Suggest the most suitable place (i.e. building) to house the server of this organization
with a suitable reason.

c) Suggest the placement of the following devices with justification:


(i) Internet Connecting Device/Modem
(ii) Switch

d) The organization is planning to link its sale counter situated in various parts of the same
city, which type of network out of LAN, MAN or WAN will be formed? Justify your
answer.
Answer:
a)
Layout 1:

Fazz
Raj
Building
Building

Jazz
Harsh Building
Building

Layout 2: Since the distance between Fazz Building and Jazz Building is quite short

Fazz
Raj
Building
Building

Jazz
Harsh Building
Building

b) the most suitable place (i.e. building) to house the server is Raj Building, as this block
contains the maximum number of computers, thus decreasing the cabling cost for most of the
computers as well as increasing the efficiency of the maximum computers in the network.
c) (i) Raj Building
(ii)In both the layouts, a hub/switch each would be needed in all the buildings, to interconnect
the group of cables from the different computers in each block
d) The type of network that shall be formed to link the sale counters situated in various parts
of the same city would be a MAN, because MAN (Metropolitan Area Networks) are the
networks that link computer facilities within a city.

ANSWER KEY (MCQs):


QUS 1 2 3 4 5 6 7 8 9 10
ANS D C A C D A C D B B
QUS 11 12 13 14 15 16 17 18 19 20
ANS A D A B A A C A A B
QUS 21 22 23 24 25 26 27 28 29 30
ANS B C A C C D C D B B
QUS 31 32 33 34 35 36 37 38 39 40
ANS B D D D A D C B A D
QUS 41 42 43 44 45 46 47 48 49 50
ANS C B A B C A D B A A
QUS 51 52 53 54 55 56 57 58 59 60
ANS D C B B B A D B B C
QUS 61 62 63 64 65 66 67 68 69 70
ANS A C D C C D C C B A
QUS 71 72 73 74 75 76 77 78 79 80
ANS A B B D C B A D C A
OBJECTIVE TYPE QUESTIONS /MULTIPLE CHOICE QUESTIONS
1. What is the full form of SQL?
(a) Structured Query Language (b) Structured Query List
(c) Simple Query Language (d) Data Derivation Language

2. What does DML stand for?


(a) Different Mode Level (b) Data Model Language
(c) Data Mode Lane (d) Data Manipulation Language

3. The __________clause of SELECT query allows us to select only those rows in the results that
satisfy a specified condition.
(a) Where (b) from (c) having (d) like

4. Which of the following function is used to FIND the largest value from the given data in
MYSQL?
(a) MAX () (b) MAXIMUM () (c) LARGEST () (c) BIG ()

5. The data types CHAR (n) and VARCHAR (n) are used to create _______ and _______ types of
string/text fields in a database.
(a) Fixed, equal (b) Equal, variable (c) Fixed, variable (d) Variable, equal

6. The term ___________ is use to refer to a record in a table.


(a) Attribute (b) Tuple (c) Row (d) Instance

7. Which command is used for cleaning up the environment (sql with Python)?
(a) my.close (b) is.close (c) con.close (d) mycon.close

8. A relational database consists of a collection of


(a) Tables (b) Fields (c) Records (d) Keys

9. What is the full form of DDL?


(a) Dynamic Data Language (b) Detailed Data Language
(c) Data Definition Language (d) Data Derivation Language

10. A(n) in a table represents a logical relationship among a set of values.


(a) Attribute (b) Key (c) Tuple (d) Entry
11. Name the method which is used for displaying only one resultset.
(a) fetchmany (b) fetchno (c) fetchall (d) fetchone

12. Name the host name used for signing in the database.
(a) localhost (b) localpost (c) localcost (d) none of the above

13. A relational database consists of a collection of


(a)Tuples (b) Attributes (c) Relations (d) Keys

14. Which is the subset of SQL commands used to manipulate database structure including tables?
(a) Data Definition Language (DDL) (b) Data Manipulation Language (DML)
(c) Both (a) and (b) (d) None

15. The term ____________ is used to refer to a field in a table.


(a) Attribute (b) Tuple (c) Row (d) Instance

16. Consider the following table namely employee:


Employee_id Name Salary
5001 Amit 60000

5009 Sumit 45000

5020 Arpit 70000

Which of the names will not be displayed by the below given query?
SELECT name FROM employee WHERE employee_id>5009;
(a) Amit, Sumit (b) Sumit, Arpit (c) Arpit (d) Amit, Arpit

17. Consider the following query


SELECT name FROM stu WHERE subject LIKE ‘_______ Computer Science’;
Which one of the following has to be added into the blank space to select the subject which
has Computer Science as its ending string?
(a) $ (b) _ (c) || (d) %

18. Consider following SQL statement. What type of statement is this?


SELECT * FROM employee
(a) DML (b) DDL (c) DCL (d) Integrity constraint

19. Which of the following function is not an aggregate function?


(a) Round() (b) Sum() (c) Count () (d) Avg ()

20. Pick the correct username used for logging in database (sql with Python).
(a) root (b) local (c) directory (d) host

21. Aggregate functions can be used in the select list or the _____ clause of a select statement.
They cannot be used in a ______ clause.
(a) Where, having (b) Having, where (c) Group by, having (d) Group by, where

22. Select correct SQL query from below to find the temperature in increasing order of all cites.
(a) SELECT city FROM weather ORDER BY temperature;
(b) SELECT city, temperature FROM weather;
(c) SELECT city, temperature FROM weather ORDER BY temperature;
(d) SELECT city, temperature FROM weather ORDER BY city;
23. In SQL, which command is used to SELECT only one copy of each set of duplicable rows
(a) SELECT DISTINCT (b) SELECT UNIQUE
(c) SELECT DIFFERENT (d) All of the above
24. Which of the following is a SQL aggregate function?
(a) LEFT (b) AVG (c) JOIN (d) LEN

25. The command used for modifying the records is:


(a) update (b) add (c) updateall (d) none of the above

26. An attribute in a relation is foreign key if it is the _________key in any other relation.
(a) Candidate (b) Primary (c) Super (d) Sub

27. Which of the following sublanguages of SQL is used to query information from the data base
and to insert tuples into, delete tuples from, and modify tuples in the database?
(a) DML (Data Manipulation Language)
(b) DDL (Data Definition Language)
(c) Query
(d) Relational Schema

28. Which operator performs pattern matching?


(a) BETWEEN operator (b) LIKE operator
(c) EXISTS operator (d) None of these

29. Which of the following is not a legal method for fetching records from database from within
Python?
(a) fetchone() (b) fetchtwo() (c) fetchall() (d) fetchmany()

30. By default, ORDER BY clause lists the results in _______ order.


(a) Descending (b) Any (c) Same (d) Ascending

31. Which of the following attributes can be considered as a choice for primary key?
(a)Name (b)Street (c) Roll No (d) Subject

32. In the given query which keyword has to be inserted?


INSERT INTO employee______(1002, “Kausar”, 2000);
(a) Table (b) Values (c) Relation (d) Field

33. What SQL statement do we use to display the record of all students whose last name contains 5
letters ending with “A”?
(a) SELECT * FROM STUDENTS WHERE LNAME LIKE ‘_ _ _ _A’;
(b) SELECT * FROM STUDENTS WHERE LNAME LIKE ‘ _ _ _ _ _’;
(c) SELECT * FROM STUDENTS WHERE LNAME LIKE ‘ ????A’;
(d) SELECT * FROM STUDENTS WHERE LNAME LIKE ‘*A’;

34. Consider the table with structure as:


Student (ID, name, dept name, tot_cred)
In the above table, which attribute will form the primary key?
(a)Name (b) Dept (c) total_credits (d) ID
35. Which of the following will you use in the following query to display the unique values of the
column dept_name?
SELECT _____________ dept_name FROM Company;
(a)All (b) From (c) Distinct (d) Name
36. Consider the following query:
SELECT name, instructor name, course______id
FROM instructor;
To display the field heading course with a different heading as id, which keyword must be
used here to rename the field name?
(a)From (b) Rename (c) As (d) Join
37. With SQL, how do you select all the records from a table named “Students” where the value of
the column “FirstName” ends with an “a”?
(a) SELECT * FROM Students WHERE FirstName =’a’
(b) SELECT * FROM Students WHERE FirstName LIKE ‘a%’
(c) SELECT * FROM Students WHERE FirstName LIKE ‘%a’
(d) SELECT * FROM Students WHERE FirstName =’%a%’
38. The HAVING clause does which of the following?
(a) Acts EXACTLY like WHERE clause
(b) Acts like a WHERE clause but is used for columns rather than groups.
(c) Acts like a WHERE clause but is used form groups rather than rows.
(d) Acts like a WHERE clause but is used for rows rather than columns.

39. Which clause is used with “aggregate functions”?


(a) GROUP BY (b) SELECT (c) WHERE (d) Both (a) and (b)

40. To open a connector to Mysql database, which statement is used to connect with mysql?
(a) Connector (b) Connect (c) password (d) username

41. If column “Marks” contains the data set {25, 35, 25, 35, 38}, what will be the output after the
execution of the given query?
SELECT MARKS (DISTINCT) FROM STUDENTS;
(a) 25. 35. 25. 35. 38 (b) 25, 25, 35, 35 (c) 25, 35, 38 (d) 25, 25, 35, 35

42. Which connector is used for linking the database with Python code?
(a) MySQL-connector (b) YesSQL: connector
(c) PostSQL: connector (d) None of the above

43. If column “Salary” contains the data set {1000, 15000, 25000, 10000, 15000}, what will be the
output after the execution of the given query?
SELECT SUM(DISTINCT SALARY) FROM EMPLOYEE;
(a)75000 (b) 25000 (c) 10000 (d) 50000

44. SQL applies conditions on the groups through _____ clause after groups have been formed,
(a) Group by (b) With (c) Where (d) Having

45. To execute all the rows from the result set, which method is used?
(a) fetchall (b) fetchone (c) fetchmany (d) none of the above
46. What is the meaning of “HAVING” clause is SELECT query?
(a) To filter out the summary groups (b) To filter out the column groups
(c) To filter out the row and column values (d) None of the mentioned

47. Which of the following queries contains an error?


(a) Select * from emp where empid = 10003;
(b) Select empid from emp where empid=10006;
(c) Select empid from emp;
(d) Select empid where empid=1009 and lastname=’GUPTA’;

48. Which operator tests column for the absence of data (i.e., NULL value) ?
(a) EXISTS operator (b) NOT operator
(c) IS operator (d) None of these

49. Consider the following query:


SELECT name FROM class WHERE subject_____NULL;
Which comparison operator may be used to fill the blank space in above query?
(a) = (b) LIKE (c) IS/IS Not (d) if

50. Which SQL function is used to count the number of rows in a SQL query?
(a) COUNT () (b) NUMBER () (c) SUM () (d) COUNT (*)

51. With SQL, how can you return the number of not null record in the Project field of “Students”
table?
(a) SELECT COUNT (Project) FROM Students
(b) SELECT COLUMNS (Project) FROM Students
(c) SELECT COLUMNS (*) FROM Students
(d) SELECT COUNT (*) FROM Students

52. Which of the following is not an aggregate function?


(a) Avg (b) Sum (c) With (d) Min

53. All aggregate functions except _______ ignore null values in their input collection.
(a) Count (attribute) (b) Count (*) (c) Avg (d) Sum

54. Which of the following group functions ignore NULL values?


(a) MAX (b) COUNT (c) SUM (d) All of the above

55. What will be the order of the data being sorted after the execution of given query
SELECT * FROM STUDENT ORDER BY ROLL_NO;
(a)Custom Sort (b) Descending (c) Ascending (d) None of the above

56. Where and Having clauses can be used interchangeably in SELECT queries?
(a) True (b) False (c) Only in views (d) With order by
57. A______ is property of the entire relation, which ensures through its value that each tuple is
unique in a relation.
(a) Rows (b) Key (c) Attribute (d) fields

58. The operation whose result contains all pairs of tuples from the two relations, regardless of
whether their attribute values match.
(a) Join (b) Cartesian product (c) Intersection (d) Set difference

59. Consider following SQL statement. What type of statement is this?


CREATE TABLE employee (name VARCHAR, id INTEGER)
(a) DML (b) DDL (c) DCL (d) Integrity constraint

60. The pattern ‘- - - ’ matches any string of ________ three character. ‘- - - %’ matches any string
of ____ three characters.
(a) Atleast, Exactly (b) Exactly, Atleast (c) Atleast, All (d) All, Exactly

VERY SHORT ANSWER QUESTIONS (1 MARKS EACH)

Q1. Name the command/clause which is used to display the records in ascending or descending
order.
Q2. Give example of any two DML commands.
Q3. What is the purpose of SQL?
Q4. What is primary key?
Q5. Which command is used to display a list of already existing tables?
Q6. Which command is used to change the structure of table?
Q7. Which command is used to change the data of the table?
Q8. Which command is used to delete data of the table?
Q9. Which command delete the structure of table?
Q10. Identify the DDL and DML commands from the following:
Create, Delete
Q11. Which clause is used with aggregate functions? (Group by/ Where)
Q12. What do you mean by candidate key?
Q13. Correct the error in the following query.
Select * from RECORD where Rname = %math%;
Q14. What is max () function in SQL?
Q15. What do you mean by degree and cardinality of table?
Q16. Expand DDL and DML
Q17. Which command is used to increase the salary of workers in table salary? (Update / Alter)
Q18. Name the command used to see the structure of table.
Q19. Which aggregate function is used to find sum of column in a table?
Q20. What is the difference between having and where clause?
Q21. Name an aggregate function in SQL which return the average of numeric values.
Q22. What is the use of “like” in SQL?
Q23. Correct the following statement:
Delete table data;
Q24. What do you mean by aggregate function?
Q25. Write two wild card characters which are used with like operator?
Q26. Duplication of record is called ____________
Q27. What is the difference between char and varchar?
=====================*====================*========================

Fill in the blanks


1. SQL stands for _______ Query Language.
2. A connectivity package such as _______ must be imported before writing database
connectivity Python code.
3. The SQL keyword_______ is used to specify the table(s) that contains the data to be
retrieved.
4. To remove duplicate rows from the result of a query, specify the SQL qualifier________ in
select list.
5. To obtain all columns, use a(n) _________ instead of listing all the column names in the
select list.
6. The SQL _______ clause contains the condition that specifies which rows are to the
selected.
7. To sort the rows of the result table, the _________ ________ clause is specified.
8. Columns can be sorted in descending sequence by using the SQL keyword ____________
9. When two conditions must both be true for the rows to be selected, the conditions are
separated by the SQL keyword ________
10. To refer to a set of values needed for a condition, we can use the SQL operation
__________
11. To exclude one or more values (a list of values) using a condition, the SQL keyword
________ ________ should be used.
12. The SQL keyword _______ is used in SQL expressions to select based on patterns
13. The SQL built-in function ________ totals values in numeric columns.
14. The SQL built-in function _________ obtains the largest value in a numeric column.
15. The SQL built-in function _________ obtains the smallest value in a numeric column.
16. The SQL built-in function __________ computes the number of rows in a table.
17. The SELECT clause _________ is used to collect those rows that have the same value in a
specified column.
18. ______________ method returns the result set in the form of tuples containing the records
or rows returned by the sql table.
19. A session between the application program and the database is called______________
20. A __________ query is used to check if data has been added to the table or not.
21. The ______________ function works with data of multiple rows at a time and returns
aggregated value.
22. The _____ clause lets you arrange the result set in the order of single column, multiple
column and custom sort order too.
23. To specify filtering condition for groups, the _____________ clause is used in MYSQL.
24. By default, the ORDER BY clauses sorts the result set in the ________ order.
25. To sort the result set in descending order, ___________ keyword is used with ORDER BY.

True/False Questions
1. The condition in a WHERE clause in a SELECT query can refer to only one value
2. SQL provides the AS keyword, which can be used to assign meaningful column names to
the results of queries using the SQL built-in functions.
3. The rows of the result relation produced by a SELECT statement can be sorted but only by
one column.
4. SQL is a programming language.
5. SELECT DISTINCT is used if a user wishes to see duplicate columns in a query.
6. The HAVING clause acts like a WHERE clause, but it identifies groups that meet a
criterion, rather than rows.
7. The qualifier DISTINCT must be used in an SQL statement when we want to Eliminate
duplicate rows.
8. DISTINCT and its counterpart, ALL, can be used more than once in a SELECT statement.
9. DISTINCT and its counterpart, ALL, can be used together on single field in a SELECT
statement.
10. SUM, AVG, MIN and MAX can only be used with numeric columns.
11. The SQL statement: SELECT salary + Comm AS Total FROM Emp; adds two fields salary
and comm from each row together and lists the results in a column named Total.

12. ORDER BY can be combined with the SELECT statement.


13. Data manipulation language (DML) commands are used to define a database, including
creating, altering, and dropping tables and establishing constraints.
14. The keyword LIKE can be used in a WHERE clause to refer to a range of values.
15. The SQL keyword GROUP BY instructs the DBMS to group together those rows that have
the same value in a column.
16. The keyword BETWEEN can be used in a WHERE clause to refer to a range of values.
17. Read operation on any table means to fetch some useful information from the table.
18. Use fetchall() method to retrieve only one value from a database table.
19. Row count is a read-only attribute.
20. To disconnect database connection, use connect () method.
21. Update statement is used to insert data into the table.
22. The ORDER BY clause combines all those records that have identical values in a particular
field or a group of fields.
23. The WHERE clause is used to specify filtering conditions for groups.
24. DISTINCT option causes a group function to consider only the unique values of the
argument expression.
25. By default, ORDER BY clause sorts the result set in descending order.
26. COUNT () function ignores duplicate and null values while counting the records.
27. The return value of MAX () function is a numeric value.
28. Multiple row function is also known as scalar function
29. SUM () function is used to count the total number of records in a table.
30. Argument type of AVG () function can be numeric or string data type.

-------ANSWER -------
OBJECTIVE TYPE QUESTIONS /MULTIPLE CHOICE QUESTIONS
1 (a)Structure Query Language 21 (b)Having, where 41 (c)25,35,38

2 (d)Data Manipulation Language 22 (d)SELECT city, temperature 42 (a)MySQL-connector


FROM weather ORDER BY city;

3 (a)Where 23 (a)SELECT DISTINCT 43 (d)50000


4 (a) MAX() 24 (b)AVG 44 (d)Having
5 (c) Fixed, variable 25 (a)update 45 (a)fetchall
6 (b)Tuple 26 (b)Primary 46 (a)To filter out the summary
groups

7 (d)mycon.close 27 (a)DML (Data Manipulation 47 (d)Select empid where


Language) empid=1009 and
lastname=’GUPTA’;

8 (a)Tables 28 (b)LIKE operator 48 (c)IS operator


9 (c)Data Definition Language 29 (b)fetchtwo() 49 (c)IS/IS Not

10 (c)Tuple 30 (d)Ascending 50 (d)COUNT (*)


11 (d)fetchone 31 (c)Roll No 51 (a)SELECT COUNT (Project)
FROM Students
12 (a)localhost 32 (b)Values 52 (c)With
13 (c)Relations 33 (a)SELECT * FROM STUDENTS 53 (b)Count(*)
WHERE LNAME LIKE’-_ _ _ _
A’;
14 (b)Data Manipulation Language 34 (d)ID 54 (d)All of the above
(DML)

15 (a)Attribute 35 (c)Distinct 55 (c)Ascending


16 (a)Amit, Sumit 36 (c)As 56 (b)False
17 (d)% 37 (c)SELECT * FROM Students 57 (b)Key
WHERE FirstName LIKE ‘%a’

18 (a)DML 38 (c)Acts like a WHERE clause but 58 (b)Cartesian product


is used from groups rather than
rows

19 (a)Round() 39 (a)GROUP BY 59 (b)DDL


20 (a)Root 40 (b)Connect 60 (b)Exactly, Atleast

-------ANSWER -------
VERY SHORT ANSWER QUESTIONS (1 MARKS EACH)
ANS Q.N. ANS Q.N. ANS
Q.N.
1 order by clause 2 Insert , Delete 3 SQL is structured query
language. It is a standard
language of all the
RDBMS
4 A field which is 5 show tables; 6 Alter
unique for each and
every record in table is
called primary key.
7 Update 8 Delete 9 Drop

10 Create —DDL and 11 Group by 12 Those fields which can act


Delete —-DML as primary key is called
candidate key.
13 Select * from 14 Ans. It returns the 15 Number of columns in
RECORD where largest value from a table is called degree.
Rname like %math%; particular column. Number of rows in a table
is called cardinality.
16 Ans. DDL – Data 17 Update 18 Desc
Definition Language,
DML – Data
Manipulation
Language.
19 sum() 20 Having clause can be 21 avg()
used with group by
clause while where
clause can be used
without group by
clause.
22 “Like” operator is used 23 Delete from data 24 A function which perform
to match a particular calculation on multiple
pattern in a particular values and return single
column in SQL. value.
25 % and underscore( _ ) 26 Redundancy 27 Char is fixed length data
type and varchar is
variable length data type.

-------ANSWER -------
Fill in the blanks
1 Structured 11 NOT IN 21 Group/row/ aggregation
function

2 Mysql.connector 12 LIKE 22 ORDER BY

3 FROM 13 SUM 23 Having

4 DISTINCT 14 MAX 24 Ascending

5 Asterisk (*) 15 MIN 25 DESC

6 WHERE 16 COUNT

7 ORDER BY 17 GROUP BY

8 DESC 18 Fetchall()

9 AND 19 Connection
10 IN 20 Select
-------ANSWER -------
True and False
1 F 11 T 21 F

2 T 12 T 22 F

3 F 13 F 23 F

4 F 14 F 24 T

5 F 15 T 25 F

6 T 16 T 26 T

7 T 17 T 27 T

8 F 18 F 28 F

9 F 19 T 29 F

10 T 20 F 30 F

SHORT ANSWER QUESTIONS (2 MARKS EACH)


Q1. What is the difference between cardinality and degree?.
Q.2 Differentiate between WHERE and HAVING clause.
Q.3 Define Primary Key of a relation in SQL. Give an Example using a dummy table.
Q.4 Consider the following Python code is written to access the record of CODE passed
to function: Complete the missing statements:
def Search(eno):
#Assume basic setup import, connection and cursor is created
query="select * from emp where empno=________".format(eno)
mycursor.execute(query)
results = mycursor._________
print(results)
Q. 5 Differentiate between DDL and DML with one Example each.
Q.6 Answer the following:
i) Name the package for connecting Python with MySQL database.
ii) What is the purpose of cursor object?
Q.7 What do you mean by domain of an attribute in DBMS? Explain with an example.
Q.8 Differentiate between fetchone() and fetchmany() methods with suitable examples.
Q.9 What is Constraint ? Give example of any two constraints.
Q.10 Write the steps to perform an Insert query in database connectivity application.
Table ‘student’ values are rollno, name, age (10,’Ashok’,26)
Q.11 Define Candidate Key and Alternate Key with suitable examples from a table containing
some meaningful data.
Q.12 Define RDBMS. Name any two RDBMS software.
Q.13 What is the purpose of the following clauses in a select statement?
i) ORDER BY ii) HAVING
Q.14 Write SQL queries for the following:
i. Create the table Product with appropriate data types and constraints.
ii. Identify the primary key in Product.
Q.15 Write any two differences between Single_row functions and Aggregate functions.
ANSWERS-(SHORT ANSWER QUESTIONS (2 MARKS
EACH)
ANS .1 Degree - The number of attributes or columns in a relation is called the Degree of the relation.
Cardinality - The number of tuples/ rows in a relation is called the Cardinality of the relation.
ANS.2 WHERE clause is used to select particular rows that satisfy a condition whereas HAVING
clause is used in connection with the aggregate function, GROUP BY clause.
For ex. – select * from student where marks > 75;
This statement shall display the records for all the students who have scored more than 75 marks.
On the contrary, the statement – select * from student group by stream having marks > 75; shall
display the records of all the students grouped together on the basis of stream but only for those
students who have scored marks more than 75.
Ans.3 Primary Key- one or more attribute of a relation used to uniquely identify each and every
tuple in the relation. For Example : In the below Table Student, RollNo can be the Primary Key
RollNo Name Marks
1 Pratham 75
2 Srishti 80
Ans. 4 { } and fetchone()
Ans 5 DDL- Data definition language. Consists of commands used to modify the metadata of a
table. For Example- create table, alter table, drop table
DML-Data manipulation language. Consist of commands used to modify the data of a table.
For Example- insert, delete, update
Ans 6 .i) import mysql.connector
ii) It is the object that helps to execute the SQL queries and facilitate row by row processing of
records in the resultset.
Ans 7 Domain of an attribute is the set of values from which a value may come in a
column. E.g. Domain of section field may be (A,B,C,D).
Ans 8 fetchone() is used to retrieve one record at a time but fetchmany(n) will fetch n
records at a time from the table in the form of a tuple.
Ans 9 .Constraints are the checking condition which we apply on table to ensure the correctness of
data . Example primary key, not null, default, unique etc
Ans 10 import mysql.connector as mydb
conn= mydb.connect(host=”localhost”, user=”root”, passwd=”1234”)
cur=conn.cursor()
cur.execute(“INSERT INTO student values(10,’Ashok’,26);”)
cur.commit()
Ans.11 A table may have more than one such attribute/group of attributes that identifies a tuple
uniquely, all such attribute(s) are known as Candidate Keys. All the candidate key except
primary key are called Alternate key.
Table: Employee (empno, aadhar_no, voter_id, ename, deptno, sal, city)
In the above table Employee, empno,aadhar_no, voter_id all are candidate key If we define
empno as primary key then remaining candidate keys will be alternate key.
Ans.12 RDBMS stands for Relational Database Management System. It is a program that offers
commands to create, update, and manage the data with multiple tables. Examples of RDBMS are
1. MySQL
2. Oracle
3. Microsoft SQL Server.
Ans.13
i) Order By : This clause is used to arrange the records in ascending or descending order. for
example Select * from book order by price;
ii) Having : HAVING Clause in SQL is used to specify conditions on the rows with GROUP BY
clause. for example Select sum(price) from book group by (subject) having price > 100;
Ans 14.
i) Create table product(Pcode varchar(3) not null Primary key , PName Varchar(20),
UPrice int(4), Manufacture Varchar(20));
ii) Pcode is primary key.
Ans.15
Single row Functions Multiple row functions / Aggregate Functions

It operates on a single row at a time. It operates on multiple rows.

It returns one result per row It returns one result for multiple rows.

It can be used in Select, Where, and


Order It can be used in the select clause only.
by clause.

Max(), Min(), Avg(), Sum(), Count() and


Math, String and Date functions are
Count(*)
examples of single row functions.
are examples of multiple row functions.
CASE STUDY BASED QUESTIONS/SQL-OUTPUT QUESTIONS (3 MARKS)
Q1. Consider the following tables FACULTY and COURSES and give outputs for SQL queries
(i) to (iii)

FACULTY
F_ID Fname Lname Hire_date Salary
102 Amit Mishra 12-10-1998 12000
103 Nitin Vyas 24-12-1994 8000
104 Rakshit Soni 18-5-2001 14000
105 Rashmi Malhotra 11-9-2004 11000
106 Sulekha Srivastava 5-6-2006 10000
COURSES
C_ID F_ID Cname Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer Security 8000
C24 106 Human Biology 15000
C25 102 Computer Network 20000
C26 105 Visual Basic 6000
i) Select COUNT(DISTINCT F_ID) from COURSES;
ii) Select MIN(Salary) from FACULTY,COURSES where COURSES.F_ID =
FACULTY.F_ID;
iii) Select avg(Salary) from FACULTY where Fname like ‘R%’
Q.2Write output for (i) & (iii) basedon a table COMPANY and CUSTOMER.

COMPANY
CID NAME CITY PRODUCTNAME
111 SONY DELHI TV
222 NOKIA MUMBAI MOBILE
333 ONIDA DELHI TV
444 SONY MUMBAI MOBILE
555 BLACKBERRY MADRAS MOBILE
666 DELL DELHI LAPTOP
CUSTOMER
CUSTID NAME PRICE QTY CID

101 Rohan Sharma 70000 20 222

102 Deepak Kumar 50000 10 666

103 Mohan Kumar 30000 5 111


104 Sahil Bansal 35000 3 333

105 Neha Soni 25000 7 444


106 Sonal Aggarwal 20000 5 333
107 Arjun Singh 50000 15 666

(i) SELECT COUNT(*) ,CITY FROM COMPANY GROUP BY CITY;


(ii) SELECT MIN(PRICE), MAX(PRICE) FROM CUSTOMER WHERE QTY>10 ;
(iii) SELECT AVG(QTY) FROM CUSTOMER WHERE NAME LIKE “%r%;

Q.3 Write output for (i) to (iii) based on the tables ‘Watches’ and ‘Sale’ given below.
Table: Watches
Watchid Watch_Name Price Type Qty_Store
W001 HighTime 10000 Unisex 100
W002 LifeTime 15000 Ladies 150
W003 Wave 20000 Gents 200
W004 HighFashion 7000 Unisex 250
W005 GoldenTime 25000 Gents 100
Table: Sale
Watchid Qty_Sold Quarter
W001 10 1
W003 5 1
W002 20 2
W003 10 2
W001 15 3
W002 20 3
W005 10 3
W003 15 4
i. select quarter, sum(qty_sold) from sale group by quarter;
ii. select watch_name,price,type from watches w, sale s wherew.watchid!=s.watchid;
iii. select watch_name, qty_store, sum(qty_sold), qty_store-sum(qty_sold) “Stock” from
watches
w, sale s where w.watchid=s.watchid group by s.watchid;
Q.4 Write the output for SQL queries (i) to (iii), which are based on the table:
Employees
Employees
Empid Firstname Lastname Designation City Salary
010 Ravi Kumar Manager GZB 75000
105 Harry Waltor Manager GZB 65000
152 Sam Tones Director Paris 80000
215 Sarah Ackerman Manager Upton 75000
244 Manila Sengupta Clerk New Delhi 50000
300 Robert Samuel Clerk Washington 45000
335 Ritu Tondon Clerk GZB 40000
400 Rachel Lee Salesman New York 32000
441 Peter Thompson Salesman Paris 28000
(i) Select Designation , count(*) from Employees Group by Designation Having
count(*)>=3;
(ii) Select Max (salary), Min(Salary) from Employees Where City in (‘GZB’,
‘Paris’);
(iii) Select Firstname, Lastname from Employees where Firstname like ‘R%’;
Q.5 Write output for queries (i) to (iii), which are based on the table:
Books.
Book_id Book_name Author_name Publisher Price Qty
C0001 Fast Cook Lata Kapoor EPB 355 5
F0001 The Tears William hopkin NIL 650 20
T0001 My First Py Brain& Brooke EPB 350 10
T0002 Brain works A.W. Rossaine TDH 450 15
F0002 Thunderbolts Anna Roberts NIL 750 5
i. Select Count(Publisher) from Books;
ii. Select Max(Price) from books where qty >=15;
iii. Select count(distinct publishers) from books where Price>=400;

ANSWERS
ANS .1 (i) 4 (ii) 6000 (iii) 12500
Ans.2
(i) Count(*) CITY
3 DELHI
2 MUMBAI
1 MADRAS
(ii) MIN (PRICE) -50000
MAX (PRICE) -7000
(iii) AVG (QTY)
11
Ans.3
(i) Quarter sum(qty_sold)
1 15
2 30
3 45
4 15
(ii) watch_name price type
HighFashion 7000 Unisex
(iii)
watch_name qty_store qty_sold Stock
HighTime 100 25 75
LifeTime 150 40 110
Wave 200 30 170
GoldenTime 100 10 90

Ans4.
(i) Manager 3
Clerk 3
(ii) 80000 28000
(iii) Ravi Kumar
Robert Samuel
Ritu Tondon
Rachel Lee
Ans .5
(i) 3 (ii)650 (iii)TDH

CASE STUDY BASED QUESTIONS (5 MARKS EACH)


1. Write SQL commands for (a) to (e) on the basis of table GRADUATE.

Table: GRADUATE
S.N NAME STIPEN SUBJECT AVERAG DI
O. D E V
1 KARAN 400 PHYSICS 68 1
2 DIVAKAR 450 COMPUTER SC 68 1
3 DIVYA 300 CHEMISTRY 62 2
4 ARUN 350 PHYSICS 63 1
5 SABINA 500 MATHEMATICS 70 1
6 JOHN 400 CHEMISTRY 55 2
7 ROBERT 250 PHYSICS 64 1
8 RUBINA 450 MATHEMATICS 68 1
9 VIKAS 500 COMPUTER SC 62 1
10. MOHAN 300 MATHEMATICS 57 2
(a) List the names of those students who have obtained DIV 1 sorted by NAME.
(b) Display a report, listing NAME, STIPEND, SUBJECT and amount of stipend
received in a year assuming that the STIPEND is paid every month.
(c) To count the number of students who are either PHYSICS or COMPUTER SC
graduates.
(d) To insert a new row in the GRADUATE table:
11, “KAJOL”, 300, “COMPUTER SC”, 75, 1
(e) Display Name of the students whose average is more than 65.
Q.2 Write SQL commands for (a) to (e) on the basis of table CLUB.
Table: CLUB
COAC COAC AGE SPORTS DATEOFAP PAY SE
H ID H P X
NAME
1. KUKREJA 35 KARATE 27/03/1997 1000 M
2. RAVINA 34 KARATE 20/01/1998 1200 F
3. KARAN 34 SQUASH 19/02/1998 2000 M
4. TARUN 33 BASKETBALL 01/01/1998 1500 M
5. ZUBIN 36 SWIMMING 12/01/1998 750 M
6. KETAKI 36 SWIMMING 24/02/1998 800 F
7. ANKITA 39 SQUASH 20/02/1998 2200 F
8. ZAREEN 37 KARATE 20/02/1998 1100 F
9. KUSH 41 SWIMMING 13/01/1998 900 M
10. SHAILYA 37 BASKETBALL 19/02/1998 1700 M
(a) To show all information about the swimming coaches in the club.
(b) To list names of all coaches with their date of appointment (DATOFAPP) in
descending order.
(c) To display a report, showing coachname, pay, age and bonus (15% of pay) for all
the coaches.
(d) To insert in a new row in the CLUB table with the following data:
11, “PRAKASH”, 37, “SQUASH”, {25/02/98}, 2500, “M”
(e ) Display Coachname ,Sports,Pay from the table .

3. Write SQL command for (a) to (e ) on the basis of tables INTERIORS and
NEWONES.
Table: INTERIORS
NO ITEMNAME TYPE DATEOFSTOCK PRICE DISCOUNT
1 Red rose Double bed 23/02/02 32000 15
2 Soft touch Baby cot 20/01/02 9000 10
3 Jerry’s home Baby cot 19/02/02 8500 10
4 Rough wood Office Table 01/01/02 20000 20
5 Comfort zone Double bed 12/01/02 15000 20
6 Jerry look Baby cot 24/02/02 7000 19
7 Lion king Office Table 20/02/02 16000 20
8 Royal tiger Sofa 22/02/02 30000 25
9 Park sitting Sofa 13/12/01 9000 15
10 Dine Paradise Dining Table 19/02/02 11000 15

Table: NEWONES
NO ITEMNAME TYPE DATEOFSTOCKS PRICE DISCOUNT
11 White wood Double bed 23/03/03 20000 20
12 James 007 Sofa 20/02/03 15000 15
13 Tom look Baby cot 21/02/13 7000 10

(a) To show all information about the sofas from the INTERIORS table.
(b) To list the ITEMNAME which are priced at more than 10,000 from the
INTERIORS table.
( c) To list ITEMNAME and TYPE of those items, in which DATEOFSTOCK
is before
22/01/02 from the INTERIERS table in the descending order of
ITEMNAME.
(d )To display ITEMNAME and DATEOFSTOCK of those items, in which the
discount
Percentage is more than 15 from INTERIORS table.
( e )To count the number of items, whose type is “Double Bed” from INTERIOR table.

4. Write SQL command for (a) to (e) on the bases of tables FURNITURE AND ARRIVALS.
Table: FURNITURE

NO. ITEMNAME TYPE DATEOFSTOCK PRICE DISCOUNT


1 White lotus Double 23/02/02 30000 25
Bed
2 Pink feather Baby cot 20//01/02 7000 20
3 Dolphin Baby cot 19/02/02 9500 20
4 Decent Office 01/01/02 25000 30
Table
5 Comfort zone Double 12/01/02 25000 25
Bed
6 Donald Baby cot 24/02/02 6500 15
7 Royal Finish Office 20/02/02 18000 30
Table
8 Royal tiger Sofa 22/02/02 31000 30
9 Econo sitting Sofa 13/12/01 9500 25
10 Eating Dining 19/02/02 11500 25
paradise Table
Table: ARRIVALS
NO ITEMNAM TYP DATEOFSTOC PRIC DISCOUN
. E E K E T
11 Wood Doubl 23/03/03 25000 25
Comfort e Bed
12 Old Fox Sofa 20/02/03 17000 20
13 Micky Baby 21/02/02 7500 15
cot

(a) To show all information about the baby cots from the FURNITURE table.
(b) To list the ITEMNAME which are priced at more than 15000 from the
FURNITURE table.
(c) To list ITEMNAME AND TYPE of those items, in which DATEOFSTOCK is
before 22/01/02from the FURNITURE table in descending order of
ITEMNAME.
(d) To display ITEMNAME and DATEOFSTOCK of those items, in which
the DISCOUNTpercentage is more than 25 from FURNITURE table.
(e) To insert a new row in the ARRIVALS table with
the following data:14, “Velvet touch”, Double bed”,
{25/03/03}, 25000, 30

5. Write SQL commands for (a) to (e) on the basis of Teacher relation given below:
Relation Teacher
No. Name Ag Department Date of Salary Sex
e join
1. Jugal 34 Computer 10/01/97 12000 M
2. Sharmila 31 History 24/03/98 20000 F
3. Sandeep 32 Maths 12/12/96 30000 M
4. Sangeeta 35 History 01/07/99 40000 F
5. Rakesh 42 Maths 05/09/97 25000 M
6. Shyam 50 History 27/06/98 30000 M
7. Shiv Om 44 Computer 25/02/97 21000 M
8. Shalakha 33 Maths 31/07/97 20000 F

(a) To show all information about the teacher of history department


(b) To list the names of female teacher who are in Hindi department
(c) To list names of all teachers with their date of joining in ascending order.
(d) To display teacher’s Name, Salary, Age for male teacher only
(e) To count the number of teachers with Age>23.
6. Answer the questions (i) and (v) on the basis of the following tables SHOP and
ACCESSORIES.
TABLE SHOP
ID SName Area
S0001 ABC
Computeronics CP
S0002 All Infotech Media GK II
S0003 Tech Shoppe CP
S0004 Greeks Techno Soft
Nehru Place S0005
Hitech Tech Store
Nehru Place

TABLE ACCESSORIES
No Name Price ID
A01 Mother Board
12000
S01
A02 Hard Disk
5000
S01
A03 Keyboard 500 S02
A04 Mouse 300 S01
A05 Mother Board
13000
S02
A06 Keyboard
400
S03
A07 LCD 6000 S04
T08 LCD 5500 S05
T09 Mouse 350 S05
T10 Hard Disk 4500 S03
Write the SQL queries:
(i) To display Name and Price of all the accessories in ascending order of their
Price.
(ii) To display Id and SName of all Shop in Nehru Place.
(iii) To display Minimum and Maximum Price of each Name of accessories.
(iv) To display Name, Price of all accessories and their respective
SName where they are available.
(v) To display all Sname in descending order.
7. Consider the following table GARMENT and FABRIC, Write SQL commands for the
statements (i) to (v)
TABLE GARMENT

GCODE DESCRIPTION PRICE FCODE READYDA


TE
10023 PENCIL SKIRT 1150 F 03 19-DEC-08
10001 FORMAL SHIRT 1250 F 01 12-JAN-08
10012 INFORMAL SHIRT 1550 F 02 06-JUN-08
10024 BABY TOP 750 F 03 07-APR-07
10090 TULIP SKIRT 850 F 02 31-MAR-
07
10019 EVENING GOWN 850 F 03 06-JUN-08
10009 INFORMAL PANT 1500 F 02 20-OCT-08
10007 FORMAL PANT 1350 F 01 09-MAR-
08
10020 FROCK 85 F 04 09-SEP-07
0
10089 SLACKS 750 F 03 20-OCT-08

TABLE FABRIC
FCODE TYPE
F 04 POLYSTER
F 02 COTTON
F 03 SILK
F01 TERELENE
(i) To display GCODE and DESCRIPTION of each GARMENT in descending order of
GCODE.
(ii) To display the details of all the GARMENT, which have READYDATE in between 08-
DEC-07 and16-JUN-08 (inclusive if both the dates).
(iii) To display the average PRICE of all the GARMENT, which are made up of
fabric with FCODE as F03.
(iv) To display fabric wise highest and lowest price of GARMENT from
GARMENT table. (Display FCODE of each GARMENT along with highest and
lowest Price).
(v) To display Gcode whose Price is more than 1000.

ANSWERS:
CASE STUDY BASED QUESTIONS
1.(a) Select Name From GRADUATE Where DIV = 1 Order by Name;
(b) Select Name, stipend, subject, stepend *12 From
GRADUATE
(c) Select count (*) From GRADUATE
Where subject IN (“PHYSICS”, “COMPUTER SC”);
(d) Insert into GRADUATE Values (11, “KAJOL”, 300, “COMPUTER SC”,
75,1);
(e ) Select name from Graduate where average>65

2. (a) Select * From CLUB Where sports = “SWIMMING”;


(b) Select COACHNAME From CLUB order by DATOFAPP desc
(c) Select coachname, pay, age, 0.15 * pay From
CLUB;
(d) Insert into CLUB Values (11, “PRAKASH”, 37, “SQUASH”, {25/02/98],
2500, “M”);
( e) Select Coachname ,Sports,Pay from Club .

3 (a) Select * From INTERIORS Where TYPE = “Sofa”;


(b) Select ITEMNAME From INTERIORS Where PRICE >
(c) 10000; Select ITEMNAME, TYPE From INTERIORS
Where DATEOFSTOCK < {22/01/02} Order by ITEMNAME desc;
(d) Select ITEMNAME, DATEOFSTOCK From INTERIORS Where DISCOUNT
> 15;
( e )Select Count (*) From INFERIORS Where TYPE = “Double
Bed”;
4 (a) Select * From FURNITURE Where TYPE = “Baby cot”;
(b) Select ITEMNAME From FURNITURE Where PRICE >
(c) 15000; Select ITEMNAME, TYPE From FURNITURE
Where DATEOFSTOCK < {22/01/02} Order by ITEMNAME desc;
(d) Select ITEMNAME, DATEOFSTOCK From FURNITURE Where
DISCOUNT > 25.
(e) Insert Into ARRIVALS Values (14, “Velvet touch”, “Double bed”,
{25/03/03}, 25000,30);

5
(a) SELECT * FROM Teacher WHERE Department = “History”;
(b) SELECT Name FROM Teacher WHERE Department = “Hindi” and Sex =
“F”;
(c) SELECT Name, Dateofjoin FROM Teacher ORDER BY
Dateofjoin;
d) SELECT Name, Salary, Age FROM Teacher
WHERE Age > 23 AND Sex = ‘M’;
(e ) SELECT COUNT (*) FROM Teacher WHERE Age > 23;

6. (i) SELECT Name, Price FROM ACCESSORIES ORDER BY Price ASC;


(ii) SELECT ID, Price FROM SHOP
WHERE Area = ‘Nehru Place’;
(iii) SELECT MIN (Price)
“Minimum Price”, MAX
(Price) “Maximum
Price”,
Name FROM ACCESSORIES GROUP BY Name;
(iv) SELECT Name, Price, SName
FROM ACCESSORIES A, SHOP S WHERE A. ID = S. ID
(v) Select Sname from Shop order by SName desc;

7. (i) SELECT GCODE, DESCRIPTION FROM GARMENT ORDER BY GCODE DESC;


(ii) SELECT * FROM GARMENT WHERE READY DATE BETWEEN ’08-DEC-
07’ AND ’16-JUN-08’;
(iii) SELECT AVG (PRICE) FROM GARMENT WHERE FCODE = ‘F03’;
(iv) SELECT FCODE, MAX (PRICE), MIN (PRICE) FROM GARMENT
GROUP BY FCODE;
(v) Select Gcode from GARMENT where Price>1000;
Class: XII Session 2021-22
Computer Science (083)
BLUE PRINT
TERM – 2 Question Paper (Theory)
Class XII (TERM-II)
TOPICS 2 Marks 3 Marks 4 Marks Total
Short answer Long answer Case study-
questions questions based
with internal with internal questions.
options options with internal
options

Computational 1(2) 1(3) - 2(5)


Thinking and
Programming – 2

Computer 1(2) - 2(8) 3(10)


Networks
Database 5(10) 2(6) 1(4) 8(20)
Management
7(14) 3(9) 3(12) 13(35)
Total
*. Marks are given inside the bracket and number of questions outside the bracket.

Note: Question paper will be prepared following the General Instructions given below.
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.

===================*===============*=============*===========
KENDRIYA VIDYALAYA RAIPUR REGION
TERM-2 EXAMINATION 2021-22
SAMPLE QUESTION PAPER_1
CLASS – XII SUB: COMPUTER SCIENCE (083)
Time -90 minutes
M. Marks- 35
General Instructions: Programming language is Python.
• This question paper is divided into 3 sections A, B and C.
• Section A has 7 Questions (1-7).Each question carries 2 marks.
• Section B has 3 Questions (8-10). Each question carries 3 marks.
• Section C has 3 case-based Questions (11-13). Each question carries 4 marks.
• Internal choices have been given for question numbers 7,8 and 12.

Q.N Section A
O.
Each question carry 2 marks
1. Write a function pop() which remove name from stack named "MyStack" 2
2. i) Expand the following- HTTP , ARPANET 1
ii) What is MAC address? Give example also. 1
3 What is the difference between Primary Key and Foreign Key?. 2
4 Explain the following results retrieval methods with examples. fetchone () rowcount 2
() .
5 Consider the following tables GAMES.Give outputs for SQL queries (i) to (iv). 2
Table: GAMES

GCode GameName Number PrizeMoney ScheduleDate


101 Carom Board 2 5000 23-Jan-2004
102 Badminton 2 12000 12-Dec-2003
103 Table Tennis 4 8000 14-Feb-2004
105 Chess 2 9000 01-Jan-2004
108 Lawn Tennis 4 25000 19-Mar-2004

(i) SELECT COUNT(DISTINCT Number) FROM GAMES;


(ii) SELECT MAX(ScheduleDate),MIN(ScheduleDate) FROM GAMES;
(iii) SELECT SUM(PrizeMoney) FROM GAMES;
(iv) SELECT * FROM GAMES WHERE PrizeMoney>12000;
6 i) Which keyword is used to remove duplicate records from relation. 1
ii) A table "Design" in a database has 5 columns and 2records. What is the degree and 1
cardinality of this table?
7 Write SQL query to create a table ‘Inventory’ with the following structure: 2
Field Type Constraint
MaterialId Integer Primary key
Material Varchar(50) NOT NULL
Category Char DEFAULT E
DatePurchase Date
OR
Observe the following table and answer the part (i) and (ii) accordingly.
Pno Name Qty PurchaseDate
101 Pen 102 12-12-2011
102 Pencil 201 21-02-2013
103 Eraser 90 09-08-2010
109 Sharpener 90 31-08-2012
113 Clips 900 12-12-2011

(i) Write the names of most appropriate columns, which can be


considered as candidate keys.

(ii) What is the degree and cardinality of the above table?

Section – B
Each question carry 3 marks
8 Write a function in Python PUSH_IN(L), where L is a list of numbers. From 3
this list, push all even numbers into a stack which is implemented by using
another list.
OR
Write a function in Python POP_OUT(Stk), where Stk is a stack implemented
by a list of numbers. The function returns the value which is deleted/popped
from the stack.
9 i) Why is it not allowed to give string and date type argument for Sum() and 1
Avg() functions?
ii)There is column C1 in a table T1.The following two statements:
select count(*) from T1; and select count(C1) from T1; are giving different 2
output.What may be the possible reason?
10 i) Sanghi created two tables with City as Primary Key in Table1 and Foreign key in 1
Table2 while inserting row in Table2 Mr Sanghi is not able to enter value in the
column City. What is the possible reason for it?
ii)The Pincode column of table 'Post' is given below- 2
100001
1200012

1300013

1600017

1800018

Find the output


i) SELECT Pincode from Post where Pincode LIKE " %1" ;
ii) SELECT Pincode from Post where Pincode LIKE " 0%" ;
Section – C
Each question carry 4 marks
11 TRAINER 4
TID TNAME CITY HIREDATE SALARY
101 SUNAINA MUMBAI 1998-10-15 90000
102 ANAMIKA DELHI 1994-12-24 80000
103 DEEPTI CHANDIGARG 2001-12-21 82000
104 MEENAKSHI DELHI 2002-12-25 78000
105 RICHA MUMBAI 1996-01-12 95000
106 MANIPRABHA CHENNAI 2001-12-12 69000
COURSE

CID CNAME FEES STARTDATE TID


C201 AGDCA 12000 2018-07-02 101
C202 ADCA 15000 2018-07-15 103
C203 DCA 10000 2018-10-01 102
C204 DDTP 9000 2018-09-15 104
C205 DHN 20000 2018-08-01 101
C206 O LEVEL 18000 2018-07-25 105

i)Display the Trainer Name, City & Salary in descending order of their Hiredate.
ii)To display the TNAME and CITY of Trainer who joined the Institute in the
month of December 2001.
iii) To display TNAME, HIREDATE, CNAME, STARTDATE from tables TRAINER and
COURSE of all those courses whose FEES is less than or equal to 10000.
iv) To display number of Trainers from each city.

12 i) Identify the type of topology on the basis of the following: 2


a. Since every node is directly connected to the server, a large amount of cable is
needed which increases the installation cost of the network.
b. It has a single common data path connecting all the nodes.

ii) Define the following: 2


(i)RJ-45 (ii)Ethernet
OR
What is protocol? Name 2 commonly used protocols.

13 Riana Medicos Centre has set up its new centre in Dubai. It has four buildings as shown in the diagram 4
given below:
Accounts Lab

Unit

Distances between various buildings are as follows:

Accounts to Research Lab 55 m


Building No. of
Accounts to Store 150 m Computer
Store to Packaging Unit 160 m Accounts 25

Packaging Unit to Research Lab 60 m Research Lab 100

Accounts to Packaging Unit 125 m Store 15

Store to Research Lab 180 m Packaging Unit 60

a network expert, provide the best possible answer for the following queries:
(i) Suggest the type of network established between the buildings.
(ii) Suggest the most suitable place (i.e., building) to house the server of this
organization.
(iii) Suggest the placement of the following devices with justification:
(a) Repeater (b) Hub/Switch
(iv) Suggest a system (hardware/software) to prevent unauthorized access to or
from the network.

***All the Best***

KENDRIYA VIDYALAYA RAIPUR REGION


TERM-2 EXAMINATION 2021-22
CLASS – XII SUB: COMPUTER SCIENCE (083)
Marking Scheme_1
Section –A
Q1. def Pop(MyStack):
if len(MyStack) > 0:
MyStack.pop()
else:
print("Stack is empty.")
(2 M for correct code)
Q2.i) (i) HTTP - Hyper Text Transfer Protocol
(ii) ARPANET - Advanced Research Project Agency Network (½ for each)
ii) The NIC manufacturer assign a unique physical address to each NIC cars, this physical address is known as MAC
address.
A MAC address is a 6-byye address with each byte separated by colon : example 10:BS:04:56:2E:FC (1/2 m for
definition and 1/ for example) .
Q3. Primary key is the key which uniquely identifies a tuple but foreign key is the key which takes reference from
primary key
ii)There is only one primary key in a table but there can be multiple foreign key on a table. (2 M for correct difference)
Q4. fetchone() :- The fetchone() method will return only one row from the result set in the form of tuple containing a
record.
(B) rowcount() :- cursor.rowcount() that always return how many records have been retrieved so for using any of the
fetch..() methods.
(1 M for each correct answer)
Q5. i) 2
ii)19-Mar-2004 12-Dec-2003
iii)59000
iv)
Lawn 19-Mar-
108 Tennis 4 25000 2004
(1/2 M for each correct answer)

Q6.i)distinct (1 M for correct answer)


ii) Degree – 5 cardinality-12 (1/2 M for each correct answer)
Q7. CREATE TABLE Inventory
(MaterialId INTEGER PRIMARY KEY,
Material Varchar(50)NOT NULL,
Category Char(2) DEFAULT=’E’,
DatePurchase Date); (2 M for correct answer)
OR
i) Candidate Key: Pno, Name
ii) Degree:4 Cardinality:5
Section-B
Q8. top=-1
stk=[]
def PUSH_IN(L): # Allow additions to the stack
for i in L:
if i%2==0:
stk.append(i)
top=len(stk)-1
( ½ marks for correct function header)
( 1 mark for correct accessing of list elements)
( ½ mark for correct condition for even number)
( ½ mark for applying append() correctly)
( ½ mark for assignment in variable top)
OR
def isEmpty(stk): # checks whether the stack is empty or not
if stk==[]:
return True

else:
return False
def POP_OUT(stk):
if isEmpty(stk): # verifies whether the stack is empty or not
print(&quot;Stack Underflow&quot;)
else: # Allow deletions from the stack
item=stk.pop()
if len(stk)==0:
top=-1
else:
top=len(stk)
return item
( ½ marks for correct POP_OUT() function header)
( ½ mark for checking empty stack status)
( ½ mark for removing item for stack )
( 1 mark for assignment in variable top)
( ½ mark for returning the deleted item)

Q9. i) String and dates are not real numbers that we calculate, so sum() or avg() functions are not valid for them.
ii)There may be a Null value. (1 M for each correct answer)
Q10. I) Mr Sanghi was trying to enter the name of City in Table2 which is not present in Table1
i.e. Referential Integrity ensures that value must exist in referred table.
i) i) 100001 ii)No output (1 M for each correct answer)
Q11. (i)SELECT TNAME, CITY, SALARY FROM TRAINER ORDER BY HIREDATE;
(ii)SELECT TNAME, CITY FROM TRAINER WHERE HIREDATE BETWEEN ‘2001-12-01’ AND ‘2001-
12-31’;
(iii)SELECT TNAME,HIREDATE,CNAME,STARTDATE FROM TRAINER, COURSE WHERE
TRAINER.TID=COURSE.TID AND FEES<=10000;
(iv) SELECT CITY, COUNT(*) FROM TRAINER GROUP BY CITY;
(1 M for each correct query)
Q12. i) a. Star Topology b. Bus Topology (1M for each correct answer)
ii) a) RJ-45: RJ45 is a standard type of connector for network cables and networks. It is an 8-pin
connector usually used with Ethernet cables.
(b)Ethernet: Ethernet is a LAN architecture developed by Xerox Corp along with DEC and Intel. It
uses a Bus or Star topology and supports data transfer rates of up to 10 Mbps. (1M for each correct
answer)
OR
A protocol means the rules that are applicable for a network or we can say that the common set
of rules used for communication in network. Different types of protocols are : (i) HTTP : Hyper
Text Transfer Protocol (ii) FTP : File Transfer Protocol (iii) SLIP : Serial Line Internet Protocol (iv)
PPP : Point to Point Protocol (v) TCP/IP : Transmission Control Protocol/ Internet Protocol. ((1M
for each correct definition and ½ M for each correct name))

Q13.i) LAN
ii) Research Lab
iii) hub in each building
iv)Firewall
(1 M for each correct answer)

KENDRIYA VIDYALAYA RAIPUR REGION


TERM-2 EXAMINATION 2021-22
SAMPLE QUESTION PAPER_2
CLASS – XII SUB: COMPUTER SCIENCE (083)
Time -90 minutes
M. Marks- 35
General Instructions: Programming language is Python.
• This question paper is divided into 3 sections A, B and C.
• Section A has 7 Questions (1-7).Each question carries 2 marks.
• Section B has 3 Questions (8-10). Each question carries 3 marks.
• Section C has 3 case-based Questions (11-13). Each question carries 4 marks.
• Internal choices have been given for question numbers 7,8 and 12.

Q.NO Section A M
.
Each question carry 2marks
1. Write a function Push() which takes number as argument and add in a stack 2
"MyValue"
2. Write two advantages and two disadvantages of network. 2
3 What is the difference between where and having clause in SQL. 2
4 Write a small python program to insert a record in the table books with attributes 2
(title ,isbn).
5 Consider the following tables FACULTY and COURSES. Write SQL 2
commands for the statements
(i) to (ii) and give outputs for SQL queries (iii) to (iv).
FACULTY
F_ID Fname Lname Hire_date Salary
102 Amit Mishra 12-10-1998 12000
103 Nitin Vyas 24-12-1994 8000
104 Rakshit Soni 18-5-2001 14000
105 Rashmi Malhotra 11-9-2004 11000
106 Sulekha Srivastava 5-6-2006 10000

COURSES
C_ID F_ID Cname Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer Security 8000
C24 106 Human Biology 15000
C25 102 Computer Network 20000
C26 105 Visual Basic 6000

i) To display the details of courses whose fees is in the


range of 15000 to 50000 (both values included).
ii) To increase the fees of all courses by 500 of “System Design” Course.
iii) Select COUNT(DISTINCT F_ID) from COURSES;
iv)Select Fname,Cname from FACULTY,COURSE where
COURSE.F_ID=FACULTY.F.ID;

6 i) What is constraint? 2
ii) What are single row functions ?

7 Make difference between DELETE and DROP command. Explain with suitable 2
examples of each.
OR
Differentiate between Alter and Update Command
Section – B
Each question carry 3 marks
8 Write a function in Python PUSH(Arr), where Arr is a list of numbers. From 3
this list push all numbers divisible by 5 into a stack implemented by using a
list. Display the stack if it has at least one element, otherwise display
appropriate error message.
OR
Write a function in Python POP(Arr), where Arr is a stack implemented by
a
list of numbers. The function returns the value deleted from the stack.
9 Define degree and cardinality. Based upon given table write degree and cardinality. 3

10 In a database there are two tables ‘LOAN’ and ‘BORROWER’ as shown below:

LOAN
Loan_Number Branch_name Amount
L-170 Downtown 3000
L-230 RedWood 4000

BORROWER
Customer_Name Loan_number
Jones L-170
Smith L-230
Hayes L-155

(i) Write Degree and Cardinality of LOAN table.

(ii) Identify the Primary Key column in the LOAN table.

(iii) How many rows and columns will be there in the natural join of these
two tables?

Section – C
Each question carry 4 marks
11 Consider the following table WORKERS and DESIG. Write SQL commands for
the the statements (i) to (iv) .

WORKERS
W_ID FIRSTNAME LASTNAME ADDRESS CITY
102 Sam Tones 33 Elm St. Paris
105 Sarah Ackerman 440 U.S 110 New York
144 Manila Sengupta 24 Friends Street New Delhi
210 George Smith 83 First Street Howard
255 Mary Jones 842 VineAve. Lsantiville
300 Robert Samuel 9 Fifth Cross Washington
335 Henry Williams 12 Moore Street Boston
403 Ronny Lee 121 Harrison St. New York
451 Pat Thompson 11 Red Road Paris

DESIG
W_ID SALARY BENEFITS DESIGNATION
102 75000 15000 Manager
105 85000 25000 Director
144 70000 15000 Manager
210 75000 12500 Manager
255 50000 12000 Clerk
300 45000 10000 Clerk
335 40000 10000 Clerk
403 32000 7500 Salesman
451 28000 7500 Salesman

(i) To display W_ID Firstname, Address and city of all employees living in New
York from the table WORKERS.
(ii) To Display the content of WORKERS table in ascending order of LASTNAME.
(iii) To display the Firstname ,Lastname and Total Salary of all Clerks from the
tables WORKERS and DESIG , Where Total Salary is calculated as a Salary
+Benefits.
(iv) To display the Minimum salary among Managers and Clerks from the table
DESIG.
12 i) Define the following data communicating devices: 2
(a) Repeater (b)Gateway

OR
Define the following: (i)3G (ii)SMS
ii) Write the two advantages and two disadvantages of Bus Topology in network. 2

13 Multipurpose Public School, Bengaluru is Setting up the network between its Different Wings of 4
school campus.
There are 4 wings named as SENIOR(S), JUNIOR(J), ADMIN(A) and HOSTEL(H).
Distance between various wings are given below:
Wing A to Wing S 100m
Wing A to Wing J 200m
Wing A to Wing H 400m
Wing S to Wing J 300m
Wing S to Wing H 100m
Wing J to Wing H 450m

Number of Computers installed at various wings are as follows:


Wings Number of Computers
Wing A 20
Wing S 150
Wing J 50
Wing H 25

a. Suggest the best wired medium and draw the cable layout to efficiently connect
various wings of Multipurpose Public School, Bengaluru.
b. Name the most suitable wing where the Server should be
installed. Justify your answer.
c. Suggest a device/software and its placement that would provide
data security for the entire network of the School.
d. Suggest a device and the protocol that shall be needed to provide wireless
Internet access to all smartphone/laptop users in the campus of Multipurpose
Public School, Bengaluru.

KENDRIYA VIDYALAYA RAIPUR REGION


TERM-2 EXAMINATION 2021-22
SAMPLE QUESTION PAPER_2
CLASS – XII SUB: COMPUTER SCIENCE (083)

Marking Scheme_2
Section –A
Q1. MyValue=[]
def Push(value):
MyValue.append(value)
(2 M for correct code)
Q2. Advantages of network:
(a) We can share resources such as printers and scanners.
(b) We can share data and access files from any computer.
Disadvantages of network:
(a) If there is any problem in the server, then no communication can take place.
(b) Network faults can cause loss of data.
(c) If there is no privacy mechanism used then the entire network can be accessed by an
unauthorized
person.
Q3. Where is used with single row function where as having is used with group row function.
example- select designation,sum(salary) from desig group by designation having count(*) < 3;
select sum(benefits) from workers where designation = ‘salesman’;
(1 m for difference and 1 m for example)
Q4. import mysql.connector as Sqlator
conn =sqlator.connect(host=”localhost”,user=”root”,passwd=””,database=”test”)
cursor=con.cursor()
query=”INSERT into books(title,isbn) values(‘{}’{})”.format(‘Neelesh’,’5143’)
cursor.execute(query)
con.close()
(2m for correct code)

Q5,i) Select * from Courses.where fees between 15000 and 50000;


ii)Update courses set fees = fees + 500 where Cname = “System Design”;
iii) 4
iv)
Amit Grid Computing
Rakshit Computer Security
Rashmi Visual Basic
Sulekha Human Biology
(1/2 M for each correct answer)
Q6. i)A constraints is a condition or check application on a field or set of fields.
Example: NOT NULL (ensure that column con not have null value), CHECK (make sure that all value
satisfy certain criteria), UNIQUE (ensure that all values in a column are different) etc.

ii) Single Row Function work with a single row at a time. A single row function returns a result for
every row of a quired table
Examples of Single row functions are Sqrt(), Concat(), Lcase(), Upper(), Day(), etc.
(1 M for each correct answer)

Q7. DELETE is DML command while DROP is a DDL command. Delete is used to delete rows from a
table while DROP is used to remove the entire table from the database. (2 M for correct
difference)
OR
Alter command in DDL command but update command is DML Command.
Alter command is used to add,modify and delete a column from the table and update command is
used to make changes in the record of the table

Q8. def PUSH(Arr,value):


s=[]
for x in range(0,len(Arr)):
if Arr[x]%5==0:
s.append(Arr[x])
if len(s)==0:
print("Empty Stack")
else:
print(s)
(3 M for correct code)

OR
def popStack(st) :
# If stack is empty
if len(st)==0:
print("Underflow")
else:
L = len(st)
val=st[L-1]
print(val)
st.pop(L-1)
(3 M for correct code)

Q9. No of attributes called degree and no. of tuples called cardinality. (1 M for each correct
definition)
4 degree , 5 cardinality (1/2 M for each correct value)

Q10. (i) Degree: 3 Cardinality: 2

(ii) Loan_Number

(iii) Rows: 6 Columns: 5

(1 mark for each correct answer)

Q11. i)SELECT W_ID, Firstname, Address, City FROM workers WHERE City = ‘New York’;
(ii) SELECT * FROM Workers ORDER BY LASTNAME;
(iii) SELECT Firstname,Lastname, Salary + Benefits “Total Salary” FROM Workers,Desig
WHERE Workers.W_ID = Desig.W_ID AND Designation = ‘Clerk’;
(iv) SELECT Designation, Min(salary) FROM Desig GROUP BY Designation HAVING
Designation IN (‘Manager’,’Clerk’);
(1 M for each correct query)

Q12. Ans. I) (a)


Repeater: Itis a device that amplifies and restoresthe signal before it gets degraded
and transmitsthe
original signal back to the destination. A repeater is a regenerator and not an amplifier.

(b) Gateway: A gateway operates on all the seven layers of OSI model. A network gateway is a
computer
which has internet-working capability of joining together two networks that use different base
protocols. Gateway converts one protocol to another and can, therefore, connect two dissimilar
networks.
OR
i) 3G: 3G (Third Generation) mobile communication technology is a broadband, packet-based
transmission of text, digitized voice, video and multimedia at data rates up to 2 mbps, offering a
consistent set of services to mobile computer and phone users no matter where they are located in
the world.
(ii)SMS: SMS (Short Message Service) is the transmission of short text messages to and from a
mobile phone, fax machine and IP address.
(1 M for each correct answer)
ii) Advantage: Easy to connect a computer or peripheral to a linear bus. Requires less cable length
than a star topology.
Disadvantage : Slower as compared to tree and star topologies of network. Breakage of wire at any
point disturbs the entire
Q13. a) Best wired medium- Twisted pair cable

Senior Junior

Admin Hostel

( ½ mark for correct wire medium and ½ mark for correct cable layout)
b)The server should be installed at Wing S(Senior) as per 80-20 rule i.e. maximum traffic should be local and
minimum traffic should pass over backbone.
( ½ mark for correct server block and ½ mark for correct justification)

c) Firewall.
( 1 mark for correct answer, No partial marking)
d) Device: Wireless Access Point or Router or WiFi hotspot device or Wifi Dongle
Protocol: IEEE 802.11x or TCP/IP
( ½ mark for correct Device and ½ mark for correct protocol)

***All the Best***


KENDRIYA VIDYALAYA SANGATHAN
REGIONAL OFFICE RAIPUR
Sample Question Paper- 3 TERM2 EXAM-2021-22
CLASS XII - COMPUTER SCIENCE (Code: 083)

Maximum Marks: 35 Time: 2 hours


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

Q. Part Question Mark


No No. s
1. Write an algorithm for pop operation in stack (2)

2. (i) Expand the following: (1)


POP, HTTP

(ii) Write one advantage of star topology over bus topology. (1)

3. What is the difference between degree and cardinality of a (2)


table? What is the degree and cardinality of the following
table?

EMPNO ENAME SALARY


1101 Pramod 48000
1102 Balswaroop 52600

4. Write the code to create the connection in which (2)


database’s name is Python, name of host, user and
password can taken by user. Also, print that
connection.
5. Write the output of the queries (i) to (iv) based on (2)
the table, COURSE given below:

Table: COURSE

CID CNAME FEES STARTDATE TID


C201 AGDCA 12000 2018-07-02 101
C202 ADCA 15000 2018-11-15 103
C203 DCA 10000 2018-10-01 102
C204 DDTP 9000 2018-09-15 104
C205 DHN 20000 2018-11-01 101
C206 O LEVEL 18000 2018-07-25 105

(i) SELECT DISTINCT TID FROM COURSE;


(ii) SELECT TID, COUNT(*), MIN(FEES) FROM COURSE GROUP BY
TID HAVINGCOUNT(*)>1;
(iii) SELECT COUNT(*), SUM(FEES) FROM COURSE WHERE STARTDATE< ‘2018-
09-15’;
(iv) SELECT CID, CNAME FROM COURSE ORDER BY CNAME DESC.

6. (i) Which command is used to delete a table in a database? (1)

(ii) Define natural join. (1)

7. (2)
TABLE: FACULTY

F_ID F_Name Hire_date Salary

102 Amit 12-10-1998 12000

103 Nitin 24-12-1994 8000

104 Rakshit 18-5-2001 14000

105 Rashmi 11-9-2004 11000

106 Sulekha 5-6-2006 10000

(a) Identify the degree and cardinality of the table.


(b) Which field should be made the primary key?
Justify your answer.
OR

Table: GAMES

GCode GameName Number PrizeMoney ScheduleDate


101 Carom Board 2 5000 23-Jan-2004
102 Badminton 2 12000 12-Dec-2003
103 Table Tennis 4 8000 14-Feb-2004
105 Chess 2 9000 01-Jan-2004
108 Lawn Tennis 4 25000 19-Mar-2004

Table: PLAYER
Pcode Name GCode
1 Nabi Ahmad 101
2 Ravi Sahai 108
3 Jatin 101
4 Nazneen 103
5 Anand 108

(i) Which field will be considered as the foreign key as per


the above tables.
(ii) Identify the candidate key(s) from the table GAMES.

SECTION – B
Each question carries 3
marks

8. Pramod has created a dictionary containing (3)


EMPCODE and SALARY as key value pairs of 5
Employees of Parthivi Constructions. Write a
program, with separate user defined functions to
perform the following operations:

● Push the keys (Employee code) of the dictionary


into a stack, where the corresponding value
(Salary) is less than 25000.
● Pop and display the content of the stack.
For example:
If the sample content of the dictionary is as follows:
EMP={"EOP1":16000, "EOP2":28000, "EOP3":19000,
"EOP4":15000, "EOP5":30000}

The output from the program should be:


EOP4 EOP3 EOP1

OR
Aryan has a list containing 10 integers. You need to help him create a
program with separate user defined functions to perform the following
operations based on this list.
● Traverse the content of the list and push the odd numbers into
a stack.
● Pop and display the content of the stack.

For Example:
If the sample Content of the list is as follows:
Num=[31, 55, 76, 89, 21, 45, 76, 68 ]
Sample Output of the code should be:
45 21 89 31
9. (i) A table, PERSON is created with following attributes: (1)
P_Id LastName FirstName Address City

Give the SQL command to insert a new row in the PERSONS


table.

(ii) Differentiate between ALTER and UPDATE commands in (2)


SQL
10. Write the queries for the following questions using the table (3)
Product with the following fields, under the database STORE.
(P_ Code, P_Name, Qty, Price)
(i) Create a database STORE
(ii) Display the price of product having code as P06.
(iii) Display the name of all products with quantity greater than
50 and price less than 500.
Section C
Each question carries 4
marks
11. Write queries (a) to (d) based on the tables Sender and (4)
Recipients given below:
Sender
SenderID SenderName SenderAddress Sendercity

ND01 R Jain 2, ABC Appls New Delhi


MU02 H Sinha 12 Newtown Mumbai
MU15 S Jha 27/A, Park Street Mumbai
ND50 T Prasad 122-K,SDA New Delhi

Recipients
RecID SenderID RecName RecAddress recCity

KO05 ND01 R Bajpayee 5, Central Avenue Kolkata


ND08 MU02 S Mahajan 116, A-Vihar New Delhi
MU19 ND01 H Singh 2A, Andheri East Mumbai
MU32 MU15 P K Swamy B5, C S Terminals Mumbai
ND48 ND50 S Tripathi 13, BI D Mayur New delhi
Vihar

(a) To display the names of all Senders from Mumbai


(b) To display the RecID, Sendername, SenderAddress, RecName,
RecAddress for every Recipient
(c) To display Recipient details in ascending order of RecName
(d) To display number of Recipients from each city
12. (i) Give two advantages and two disadvantages of Radiowave (2)
OR
Define the following terms:
Modem, Bluetooth

(ii) What is the difference between star topology and bus topology (2)
of network?
13. Shiva Multi Tech Corporation (SMTC) has set up its new center at four offices
(4)
for web based activities. The 4 blocks of buildings are as shown in the
diagram below:

Block A Block C

Block D
Block B

Center to center distances between various blocks


Black A to Block B 50 m
Block B to Block C 150 m
Block C to Block D 25 m
Block A to Block D 170 m
Block B to Block D 125 m
Block A to Block C 90 m

Number of Computers
Black A 25
Block B 50
Block C 125
Block D 10

(a) Which of the following devices will be suggested by you to connect each
computer in each of the block? ● Gateway ● Switch ● Modem .
[

(b) Suggest the most suitable place (i.e. block) to house the server of this organisation with
a suitable reason.
(c) What will be the best possible connectivity out of the
following, you will suggest to connect the new setup of offices
in Bengalore with its London based office?
● Infrared ● Satellite Link ● Ethernet Cable
(d) Company is planning to connect its Block in Hyderabad
which is more than 20 km. Which type of network will be
formed?
[1]
KENDRIYA VIDYALAYA SANGATHAN
REGIONAL OFFICE RAIPUR
MARKING SCHEME SAMPLE PAPER – 3 TERM2 EXAM-2021-22
CLASS XII - COMPUTER SCIENCE (Code: 083)
Maximum Marks: 35 Time: 2 hours

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
Q. Part Question Marking Mark
No No. Instructio s
ns
1. Algorithm Steps
2 marks
for correct (2)
1. if (Top == − 1) write “Stack is empty” and answer.
go to step 4
2. ITEM = data [Top]
3. Top = Top − 1
4. Stop.
2. (i) POP : Post Office Protocol ½ mark for
HTTP: Hypertext Transfer each (1)
correct
Protocol
expansion
(ii) Advantage of star topology over bus topology : 1 mark for
The star topology is the most reliable as there is each (1)
a direct connection of every nodes in the network correct
with the central node, so any problem in any answer
node will affect the particular node only
3. Degree: The number of attributes or columns in 1 mark for
a table is called the degree of the table. The correct
degree of the given table is 3. difference.
1 mark for
Cardinality: The number of rows or records in a correct
table is called the cardinality of the table. The degree and (2)
cardinality of the given table is 2. cardinality.

[2]
4. import mysql.connector ½ mark for
mycon = mysql.connector.connect( host = Import statement, (2)
“localhost”, user = “root”, passwd = “tiger”, ½ mark for printing
database = “Python”) connection object.1
print(mycon)
mark for correct
connection
5. The output of the queries (i) to (iv) based on
the table, COURSE.

(i) DISTINCT TID


101 ½ mark for each (2)
103 correct output
102
104
105

(ii) TID COUNT(*) MIN(FEES)


101 2 12000
(iii) COUNT(*) SUM(FEES)
2 30000
(iv) CID CNAME
C206 O LEVEL
C205 DHN
C204 DDTP
C203 DCA
C201 AGDCA
C202 ADCA

6. (i) DROP TABLE <TABLE NAME> 1 mark for


correct (1)
answer
(ii) Natural Join: The join in which only one 1 mark for
of the identical columns existing in both correct answer.
tables is present, No duplication of (1)
columns.
7. (a) Degree: 4 ½ mark each for
Cardinality: correct degree
5 and cardinality
(2)
(b) F_ID should be made the primary key
as it uniquely identifies each record of ½ mark for
the table. correct field and
½ mark for
justification.
[3]
OR ½ mark for
each
(i) GCode correct
field name
(ii) GCode and GameName
1 mark
for
correct
answer
SECTION – B
Each question carries 3 marks

8. # Question No 8 (first option)


EMP={"EOP1":16000, "EOP2":28000, 1 mark for
"EOP3":19000, "EOP4":15000, "EOP5":30000} correct
PUSH
def PUSH(S,N): operation
S.append(N)
1 mark for
def POP(S): correct
if S!=[]: POP
return S.pop() operation
else:
return None 1 mark for
ST=[] correct
for k in EMP: function (3)
if EMP[k]<25000: calls and
PUSH(ST,k) displaying
while True: if the output
ST!=[]:
print(POP(ST),end=" ")
else:
break
OR
# Question No 8 (second option)
Num=[31, 55, 76, 89, 21, 45, 76, 68 ] 1 mark for
correct
def PUSH(S,N): PUSH
operation

[4]
S.append(N) 1 mark for
def POP(S): correct POP
if S!=[]:
return S.pop() operation
else:
return None 1 mark for
ST=[] correct
for k in N: function
if k%2!=0: calls
PUSH(ST,k) and
while True: displaying
if ST!=[]: the output
print(POP(ST),end=" ")
else:
break

9. (i) INSERT INTO PERSONS VALUES(3, ‘Pettersen’ 1 mark


‘Kerry’ ,’Storgt 20’,’Dollas’) for (1)
#or similar command correct
comman
d
(ii) Alter: It belongs to DDL category. 2 marks for (2)
It changes the structure of the table. 2 correct
Columns can be added, modified , deleted etc difference.
Update: It belongs to DML category.
It modifies data of the table.
Data can be changed, updated with values and
expressions.
10 (i) CREATE DATABASE STORE; 1 mark for (3)
. (ii) SELECT Price FROM Product WHERE each
P_Code=“P06”; correct
(iii) SELECT P_Name FROM Product query.
WHERE Qty>50 AND Price<500;

Section C
Each question carries 4 marks
11 (a)SELECT SenderName FROM Sender where
. Sendercity = ‘Mumbai’;

(b) SELECT RecID, Sendername,


SenderAddress, RecName, RecAddress FROM
Sender S, Recipients R WHERE
S.SenderID = R.SenderID;

(c)SELECT * FROM Recipients ORDER BY


RecName;
[5]
(d)SELECT COUNT(*) FROM Recipients GROUP
BY recCity.

[6]
FROM EMPLOYEE
GROUP BY DEPTID;
(b) SELECT NAME, DEPTNAME FROM 1 mark
EMPLOYEE, DEPARTMENT WHERE for each
EMPLOYEE.DEPTID= correct
DEPARTMENT.DEPTID query (4)
AND SALARY>50000;

(c) SELECT NAME FROM EMPLOYEE


WHERE SALARY IS NULL ORDER
BY NAME;
(d) SELECT DISTINCT DEPTID
FROM EMPLOYEE;
12. (i) Advantages
• Cheaper than wired network. ½ mark for
• Provides mobility. each correct
• Easy to use over difficult terrain. advantage /
disadvantag
Disadvantages e (2)
• Insecure communication can be easily
taped.
• It is affected by the weather conditions
such as rain, storms, thunder, etc
OR
Modem: It is a device that converts digital
signal to analog signal (modulator) at the 1 mark for
sender’s site and converts back analog signal to each
digital signal (demodulator) at the receiver’s correct
end, in order to make communication possible definition
via telephone lines. It enables a computer to
transmit data over telephone or cable lines
Bluetooth:It is used for exchanging data over a
short distance from fixed and mobile devices.
This type of media comes under PAN (Personal
Area Network).
(ii) Star Topology: All the nodes are directly 1 mark for (2)
connected with the central node or server. Easy each
to detect faults. It is fast in transmission. correct
difference
Bus topology: There is a single length of
(minimum
transmission medium on which various nodes are two points
attached and the server can be anywhere in the should
transmission cable. Faults cannot be easily be
detected. Becomes slow with increase in node. given.

[7]
13
. (a) Switch
(b) Block C
(c) Satellite Link
(d) MAN
(4)

[1]
KENDRIYA VIDYALAYA SANGATHAN
REGIONAL OFFICE RAIPUR
Sample Question Paper - 4 TERM2 EXAM-2021-22
CLASS XII - COMPUTER SCIENCE (Code: 083)
Maximum Marks: 35 Time: 2 hours

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

Q. Part Question Mark


No No. s

1. Define stack. What is the significance of TOP in stack. (2)

2. (i) Expand the following: (1)


POP , FTP

(ii) Write any two advantages of Optical Fibre (1)


Cable.

3. What is a primary key? How many primary keys can be there (2)
in a table?

4. Differentiate between fetchone() and fetchall() (2)


methods.

[2]
Write the output of the queries (a) to (d) based on the (2)
5. table, TRANSACT given below:
Table: TRANSACT

TRNO ANO AMOUNT TYPE DOT


T001 101 2500 Withdraw 2017-12-21
T002 103 3000 Deposit 2017-06-01
T003 102 2000 Withdraw 2017-05-12
T004 103 1000 Deposit 2017-10-22
T005 101 12000 Deposit 2017-11-06

(a) To display minimum amount transaction from the table


(b) To display total amount withdrawn from table.
(c) To display ANO, DOT, AMOUNT for maximum amount transaction.
(d)To display all information DOT wise
6 (i) Which command is used to view the list of databases in a server? (1)
(ii) Define equi-join with example. (1)
7 Consider the tables given below: (2)
Table: ACTIVITY

ACode ActivityName ParticipantsNum PrizeMoney ScheduledDate


1001 Relay 100x4 16 10000 23-Jan-2004
1002 High jump 10 12000 12-Dec-2003
1003 Shot Put 12 8000 14-Feb-2004
1005 Long Jump 12 9000 01-Jan-2004
1008 Discus Throw 10 15000 19-Mar-2004

(a) Identify the candidate key(s) from the table : ACTIVITY


(b) What is the datatype of the field ScheduledDate
OR
Table: COACH
PCode Name ScheduledDate
1 Ahmad Hussain 1001
2 Ravinder 1008
3 Janila 1001
4 Naaz 1003
(a) Identify the degree and cardinality of the table: COACH
(b) Which key should be used as Primary key from the above
table.
[3]
SECTION – B
Each question carries 3 marks

(3)
8 Ashish students of class XII wants to enter details of student’s- Rollno, Name and grade in a stack.
Help him to write Push() methods in Python to add student’s details. Display the student’s details.

OR

Write a program to implement a stack for the students(studentno, name). Just


implement Pop and display.

9 (i) A table, STUDENT has been created in a database with the following fields. (1)
ROLLNO, SNAME, FNAME, ADDRESS, PER, GRADE
Give the SQL command to delete a field, ADDRESS from the table.

(ii) What is the differences between HAVING clause and WHERE clause? (2)

10 Sagar has to create a database EMPDATA for his company and he wants to enter details of all the (3)

employees in the table EMPLOYEE. Table has the following structure: Table: EMPLOYEE

FIELD NAME DATA TYPE REMARKS


EMP_ID CHAR(5) PRIMARY KEY
EMP_NAME CHAR(30)
DESIGNATION CHAR(15)
BASIC INTEGER(6)
ADDRESS CHAR(20)

Help him to complete the task by suggesting appropriate SQL commands.

[4]
(4)
Consider the following tables GAMES and PLAYER. Write SQL commands for the
11 statements (i) to (iv) and give outputs for SQL queries (v) to (viii).

Table: GAMES

GCode GameName Number PrizeMoney ScheduleDate


101 Carom Board 2 5000 23-Jan-2004
102 Badminton 2 12000 12-Dec-2003
103 Table Tennis 4 8000 14-Feb-2004
105 Chess 2 9000 01-Jan-2004
108 Lawn Tennis 4 25000 19-Mar-2004

(i) To display the name of all Games with their Gcodes.


(ii) To display details of those games which are having PrizeMoney more than
7000.
(iii) To display the content of the GAMES table in ascending order of ScheduleDate.
(iv) To display sum of PrizeMoney for each of the Number of participation

12 (i) Give one advantage and one disadvantage of Bus topology (2)
OR
Define the following terms:
URL, IP Address

(ii) Write the difference between LAN and MAN. (2)

13 Himalaya Corporation has set up its new centre at New Delhi for its office and web-based (4)
activities. It has 4 blocks of buildings.

Himalaya Corporation

Block B
Block A

Block C Block D

[5]
Distance between the various blocks is as
follows:
A to B 50 m
B to C 110m
C to D 105 m
A to D 165 m
B to D 45 m
A to C 40 m

Numbers of computers in each block


Block A - 30
Block B - 45
Block C - 50
Block D - 75

(a) Suggest and draw the cable layout to efficiently


connect various blocks of buildings within the New
Delhi centre for connecting the digital devices.

(b) Suggest the placement of the following device


with justification
i. Repeater
ii. Hub/Switch

(c) Which kind of network (PAN/LAN/WAN) will be formed if


the Noida office is connected to its head office in
Mumbai?

(d) Which fast and very effective wireless transmission medium should
preferably be used to connect the head office at Mumbai with the centre
at New Delhi?

[6]
KENDRIYA VIDYALAYA SANGATHAN
REGIONAL OFFICE RAIPUR
MARKING SCHEME SAMPLE PAPER – 4 TERM2 EXAM-2021-22
CLASS XII - COMPUTER SCIENCE (Code: 083)

Maximum Marks: 35 Time: 2 hours

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

Q. Par Question Marking Mar


No t Instructio ks
No. ns
1. A stack is an abstract data type and a linear or user- 1 mark
defined data structure based on the principle of Last In each for (2)
First Out (LIFO). def. of
A stack is a list where insertion and deletion can take stack
place only at one end called Top. and
TOP.
2. (i) POP : Post Office Protocol. ½ mark
FTP: File Transfer Protocol. for each (1)
correct
expansion
(ii) Advantages of Optical Fibre Cable : 1mark for
1. It is immune to electrical and magnetic fields. So, correct (1)
the data does not get disturbed and pure data is answer
retrieved on the other end.
2. It guarantees secure transmission and has a very
high transmission capacity.
3. It is a combination of one or more fields in a table that 2 mark for
can uniquely identify a record. There can be only one correct
primary key in a table. It plays an important role in answer
identifying the records, because it is the primary key who
carries unique values. The criteria for a field to become (2)
primary key is : It must be carrying unique and NOT NULL
values.
[7]
4. fetch(): It returns the next row from the result set as tuple. 2 mark for
correct (2)
If there are no more rows to retrieve, None is returned.
answer
fetchall():It fetches all the rows of a query result. It returns
all the rows as a list of tuples. An empty list is returned if
there is no record to fetch.
5.
(i) To display minimum amount transaction from the table.
Ans. select min(amount) from Transact;
(ii) To display total amount withdrawn from table.
½ mark (2)
Ans. select sum(amount) from Transact where type = “Withdraw”; for each
(iii) To display ANO, DOT, AMOUNT for maximum amount correct
transaction. output
Ans. select ANO, DOT, AMOUNT from Transact where AMOUNT =
max(AMOUNT);
(iv) To display all information DOT wise.
Ans. select * from Transact order by DOT;

6. (i) SHOW TABLES; 1 mark


for (1)
correct
answer
(ii) Equi join is a simple SQL join condition that uses equal sign 1 mark for
as a comparison operator. correct
Syntax: answer
and (1)
SELECT col1, col2, col3 FROM table1, table2
syntax.
WHERE table1.col1 = table2.col1;
7. (a) Acode, ActivityName ½ mark for
(b) Date each
correct
field name
(2)
1 mark for
correct
OR answer
(a) Degree: 3 OR
½ Mark each
Cardinality :4 for correct
(b) PCode degree &
cardinality,
1 Mark for
correct field
name.

[8]
SECTION – B
Each question carries 3 marks
8. # Question No 8 (first option)
def push(stack): 1 mark for
s=[] correct
s.append(input(“Enter student rollno?”)) PUSH
s.append(raw_input(“Enter student name”)) operation
s.append(raw_input(“Enter student grade”))
1 mark for
stack.append(s) correct
display()
def display (stack): operation
l=len(stack)
1 mark for
print “STACK CONTENTS”
correct
for i in range(l-1,-1,-1): function (3)
print stack[i] calls and
entering the
stack=[] values for
print “Creating Stack” students.
n = input(“Enter the number of students”)
for i in range(n):
student = []
student.append(input(“Enter student rollno?”))
student.append(raw_input(“Enter student name”))
student.append(raw_input(“Enter student grade”))
stack, append(student) push(stack)
display(stack)

OR
# Question No 8 (second option)

[1]
1.5 mark for
stk=[]
top=-1 correct POP
def POP(): operation
if(top==-1):
print(“NO STUDENT DATA”) 1.5 mark for
else: correct
function calls
and
print(“Student details are:”, stk.pop())
displaying
top=len(stk)-1
the output
def display():
if(top==-1):
Note: Marks
print(“NO STUDENT DATA”)
to be
else:
awarded for
t=len(stk)-1
any other
print(stk[t])
correct logic
for i in range(t-1,-1,-1):
given by the
print(stk[i]) student
display()
POP()
9. (i) ALTER TABLE STUDENT DROP COLUMN ADDRESS; 1 mark for
correct (1)
command
(ii) Differences between HAVING clause and WHERE clause 2 Marks for (2)
are: 02 correct
HAVING: difference.
HAVING clause is used to filter record from the groups
based on the specified condition.
HAVING clause implements in column operation.
HAVING clause can contain aggregate function.
WHERE:
WHERE clause is used to filter the records from the table
based on the specified condition.
WHERE clause implements in row operation.
WHERE clause cannot contain aggregate function.

45 10 CREATE DATABASE EMPDATA; ½ mark (3)


for
CREATE TABLE EMPLOYEE ( creating
EMP_ID CHAR(5)PRIMARY KEY, EMP_NAME database.
CHAR(30),
2.5 marks
DESIGNATION CHAR(15), BASIC INT(6)
for
VGTEMP INT,
command
ADDRESS CHAR(20)
); to create
a table.
[2]
(v) To display the name of all Games with their Gcodes.
11 An: Select GCode, GameName from Games; (4)
(vi) To display details of those games which are having PrizeMoney
more than 7000.
1 Mark
Ans: Select * from Games where PrizeMoney>7000;
for each
(vii) To display the content of the GAMES table in ascending order
correct
of ScheduleDate.
answer.
Ans: Select *from Games order by ScheduleDate;
(viii) To display sum of PrizeMoney for each of the Number of
participation
Ans:Select SUM(PrizeMoney) from Games Group by Number.

12 12 Bus topology: A bus topology is an arrangement in which the computers and the 1 Mark each (2)
peripheral devices are connected to a common single data line. for
Advantage: All the nodes are connected directly, so very short cable length is advantage &
1 Mark for
required.
disadvantag
Disadvantage: In case of any fault occurred in data transmission, fault isolation e
is very difficult. We have to check the entire network to find the fault.
OR
URL: A uniform resource locator, abbreviated URL, also known as web address,
is a specific character string that constitutes a reference to a resource. In most
web browsers, the URL of a web page is displayed on top inside an address bar.
A URL is a formatted text string used by web browsers.
IP Address (Internet Protocol Address) :The Internet Protocol (IP) is the
method or protocol by which data is sent from one computer to another on the
Internet. Each computer (known as a host) on the Internet has atleast one IP
address that uniquely identifies it from all other computers on the Internet.
1 Mark each
for correct
def. of URL
and IP
Address.

(e) Suggest and draw the cable layout to


efficiently connect various blocks of buildings
within the New Delhi centre for connecting the
digital devices.
Ans:
Bus Topology as follows or Star Topology.
[3]
Himalaya Corporation
(4)
13
Block A
Block B

1 Mark for
each correct
answer.
Block C Block D

(f) Suggest the placement of the following


device with justification
Repeater :
Between C to D in Bus topology.
Between A to D in Star Topology.
To amplify the signal as the distance between these
Blocks are greater than 90-100 Meters.

Hub/Switch: In each Block to connect all


computers together.

(g) Which kind of network (PAN/LAN/WAN) will be


formed if the Noida office is connected to its
head office in Mumbai?
Ans: WAN
(h) Which fast and very effective wireless transmission medium
should preferably be used to connect the head office at
Mumbai with the centre at New Delhi?
Ans: Satellite

[4]
KENDRIYA VIDYALAYA SANGATHAN
REGIONAL OFFICE RAIPUR
SAMPLE PAPER – 5 TERM2 EXAM-2021-22
CLASS XII - COMPUTER SCIENCE (Code: 083)

Maximum Marks: 35 Time: 2 hours

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

Q. Part Question Marks


No No.

1. What is push operation in stack ? (2)

2. (i) Expand the following: (1)


VoIP, WAN

(ii) Write two characteristics of Wi-Fi. (1)

3. Write two wild card characters which are used with like operator? (2)

4. a. What is connection? What is its role? (2)


b. Which package must be imported in Python to create a
database connectivity application?

[5]
5. Write the output of the following on the basis of given (2)
Table : Product

1.Select max(price) from product;


2.Select distinct(price) from product;
3.Select sum(price) where Qty > 30;
4.Select count(distinct(price)) from product;
6. (i) What do you mean by data redundancy? (1)

(ii) What do you mean by data integrity? (1)


7 In a hospital, the patients are allocated to wards. A database named (2)
‘Hospital’ is created. One table in this database is: WARD with
WardId, WardName, NumOfBeds as columns and WardId as the
primary key.
Write another suitable table you could expect to see in the ‘Hospital’
database, with 3 suitable columns identifying Primary key and Foreign key
in the table that you expect.

OR
Is NULL value the same as 0 (zero)? Write the reason for
your answer.
SECTION-B
Each question carries 3 marks
8 Write a function in python, MakePush(Package) and MakePop(Package) to 3
add a new Package and delete a Package from a List of Package
Description, considering them to act as push and pop operations of the
Stack data structure.
OR
Write a function in python, Push(Stu) and MakePop(Stu) to add a new
student and delete student from a List of Stu contain rollno, Sname and
Class as list, considering them to act as push and pop operations of the
Stack data structure

[1]
9 (i) There is a column Salary in a Table EMPLOYEE. The following two 1
statements are giving different outputs. What may be the possible reason?
SELECT COUNT(*) FROM EMPLOYEE;
SELECT COUNT(SALARY) FROM EMPLOYEE;
(ii) Shanya Khanna is using a table Employee. It has the following columns. 2
Admno, Name, Agg, Stream [ column Agg contains aggregate marks] She
wants to display highest Agg in each stream.
She wrote the following statement:
SELECT Stream, MAX(Agg) FROM Employee;
But she did not get the desired result. Rewrite the above query with
necessary changes to help her get the desired output.
10 In a database STUDENT, there is a Table RESULT with the following 3
contents:
Table :RESULT
REGN NAME MARKS SECTIO CLASSTEAC ADMN
O N HER O
10004 Mohit 90 A Ms Nathani Z101
10211 Mukta 85 B Mr. Gokhle Z109
10923 Mohit 92 B Mr. Gokhle Z120
10313 Sana 80 A Ms Nathani Z234
(i) Identify the attributes, which can be chosen as Candidate Keys in the
table RESULT.
(ii) Write SQL Query to change the Marks of Mukta to 95 in the table
RESULT.
11 In a database there are two tables “ITEM” and “CUSTOMER” as shown 4
below:

Write the command in SQL queries for the following:


[2]
(i) To display the details of Items whose Price is in the range of 40
and 95(Both values included)
(ii) To display the CustomerName, City from table Customer
and ItemName and Price from table Item, with their
corresponding matching ID.
(iii) To increase the price of all the products by 50.
(iv) To display the CustomerName of customer table whose city name
start with ‘N’.
12 (i) Identify the type of topology from the following: 2
(i) In it, each node is connected with the help of a single co‐axial cable.
(ii) In it, each node is connected with the help of independent cable with
the help of a central switching (communication controller).
OR
Write the name of the most suitable wireless communication channels for
each of thefollowing situations.
(i) Communication between two offices in different countries.
(ii) To transfer the data from one mobile phone to another.

(ii) Write one advantage and one disadvantage of using Optical fiber cable. 2

13 ABC Consultants are setting up a secured network for their office campus 4
at Gurgaon for their day-to-day office and web-based activities. They are
planning to have connectivity between three buildings and the head office
situated in Mumbai. Answer the questions (i) to (iv) after going through
the building positions in the campus and other details, which are given
below :

[3]
i. Suggest the most suitable place (i.e., building) to house the server of
this organization. Also give a reason to justify your suggested
location.
ii. Suggest a cable layout of connections between the buildings inside the
campus.
[4]
iii. Suggest the placement of the following devices with justification:
o Modem.
o Switch.
iv. The organization is planning to provide a high speed link with its head
office situated in Mumbai using a wired connection. Which of the
following cables will be most suitable for this job ?
o Optical Fiber
o Co-axial Cable
o Ethernet Cable

[5]
KENDRIYA VIDYALAYA SANGATHAN
REGIONAL OFFICE RAIPUR
MARKING SCHEME SAMPLE PAPER – 5 TERM2 EXAM-2021-22
CLASS XII - COMPUTER SCIENCE (Code: 083)

Maximum Marks: 35 Time: 2 hours

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
Q. Part Question Marks
No No.
1. Push operation refers to inserting an element in the stack. Since there's (2)
only one position at which the new element can be inserted — Top of
the stack, the new element is inserted at the top of the stack
2. (i) Voice over internet protocol (1)
Wide Area Network
(ii) 1. It is wireless network. (1)
2. It is for short range.

3. % and underscore( _ ) (2)

4. (a) A Connection (represented through a connection (2)


object) is the session between the application
program and the database. To do anything with
database, one must have a connection object.
(b) There are multiple packages available through which
database connectivity applications can be created in
Python. One such package is mysql.connector.

[6]
5 Ans.a. 320 2
Ans b.
240
300
320
130
100

Ans c. Error
Ans. d. 5
6. (i) Ans. Duplication of data in a table is called redundancy. (1)

(ii) Data integrity means maintaining accuracy and consistency of data. (1)

7 Table ‐ Patient 2
Columns ‐ PatientId,
PatientName, WardId
Patient Id ‐ Primary Key and
WardId ‐ Foreign Key
(You can also mention other appropriate table with suitable columns)

OR
Null value indicates nothing or empty value. It does not
represent 0 or space character.
The column having Null value is ignored while applying
aggregate functions like MIN, MAX or COUNT etc.
SECTION-B
Each question carries 3 marks
def MakePush(Package): 3
a=int(input("enter package title : "))
Package.append(a)

def MakePop(Package):
if (Package==[]):
print( "Stack empty")
else:
print ("Deleted element:",Package.pop())

OR
def Push(Stu):
rollno=int(input("enter package title : "))
Sname=int(input("enter package title : "))
Class=int(input("enter package title : "))
info=[rollno,Sname,Class]
[7]
Stu.append(info)

def Pop(Stu):
if (Stu==[]):
print( "Stack empty")
else:
print ("Deleted element:",Stu.pop())

9 (i) If SALARY column is defined as NULL and then if any employee’s 1


salary is missing then count function will not count those null valued
salary. For example if EMPLOYEE table contains 10 record of
employees and out of 10 employees say 7th employee’s salary is not
entered then output will be 10 and 9 for respective queries.
(ii) SELECT Stream ,MAX(Agg) FROM Employee GROUP BY Stream; 2

10 (i) REGNO and ADMNO can be chosen as Candidate Keys in 3


the table RESULT.
(ii) UPDATE RESULT SET MARKS=95 WHERE
NAME=”Mukta”;
11 (i) SELECT * FROM ITEM WHERE PRICE >= 40 AND PRICE 4
<= 95;
(ii) SELECT CUSTOMERNAME, CITY, ITEMNAME,
PRICE FROM CUSTOMER CUST, ITEM WHERE
CUST.ID = ITEM.ID;
(iii) UPDATE ITEM SET PRICE = PRICE + 50 ;
(iv) SELECT CUSTOMERNAME FROM CUSTOMER WHERE
CITY LIKE ‘N%’
12 (i) (i) Bus Topology (ii) Star Topology 2
OR
(i) Satellite (ii) Bluetooth
(ii) Advantage: 2
(i) Not susceptible to electrical and magnetic interference i.e. free
from EMI.
(ii) High speed and Data Transmission capacity
(iii) Secure Transmission
Disadvantage:
(i) Expensive and not suitable for domestic use.
(ii) Fibers are fragile so installation is typical job.
(iii) Difficult to solder/extend.
13 (i) The most suitable place to install server is building “RED” 4
because this building have maximum computer which reduce
communication delay.

[8]
( iii ) Modem -Red Building
In the layout a switch each, would be needed in all the buildings, to
interconnect the group of cables from the different computers in each
in
In the layout a switch each, would be needed in all the buildings, to
interconnect the group of cables from the different computers in each
building.

(iv ) Optical fiber

[9]
KENDRIYA VIDYALAYA SANGATHAN
REGIONAL OFFICE RAIPUR
SAMPLE PAPER – 6 TERM2 EXAM-2021-22
CLASS XII - COMPUTER SCIENCE (Code: 083)

Maximum Marks: 35 Time: 2 hours

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
Q. Part Question Marks
No No.
1. Explain Push and POP operation of stack. (2)
2. (i) Expand the following: (1)

1. GSM
2. GPRS

(ii) Which protocol is used to creating a connection with a remote (1)


machine?
3. Differentiate between Alternate key and Candidate key. (2)

4. Explain the following 'results' retrieval methods with examples. (2)

A. fetchone ()
B. fetchall ()

[10
]
5. Answer the following questions on the basis the given table. (2)

Admno Name Subject Sex Average

1001 Amit Math M 85.5

1002 Suman English F 90

a. How many attributes are there in above table?


b. How many tuples are there in above table?
c. What is the degree of above table?
d. What is the cardinality of above table?
6. (i) Write statement to open a database named “student”. (1)

(ii) Which statement is used to show all existing table in database. (1)

7 Prathmesh has created the following table with the name ‘Veterinary’. (2)

One of the rows inserted is as follows :

(i) What are the data type of columns AnimalId and


VacinnationDate in the table Veterinary ?
(ii) Prathmesh is now trying to insert the following row

Will he be able to successfully insert it? Give reason.

OR

Write a MySql command for creating a table “BANK” whose structure


is given below:
SECTION-B
Each question carries 3 marks
8 Write a function in python, Push(Package) and Pop(Package) to add 3
details of employee contain information (Empid, Ename and Salary) in
the form of tuple in Package and delete a Package from a List of Package
Description, considering them to act as push and pop operations of the
Stack data structure
OR
Write a user define function to push an item of integer type into stack
(function to push information of student include rollno and name in the
form of list/tuple or dictionary.)

9 (i) Write a SQL command to view the constraints of EMP table. 1

(ii) Mr. AllamRaju is using a table with following columns: 2


Name, Class, Course_Id, Course_name
He needs to display names of students, who have not been assigned
any stream or have been assigned Course_name that ends with
“economics”.
He wrote the following command, which did not
give the desired result.
SELECT Name, Class FROM Students WHREE Course_name=Null
OR Course_name=”%economics”;
Help Mt AllamRaju to run the query by removing the error and write
the correct query.
10 Consider the tables given below. 3
(i) Name the Primary keys in both the tables
(ii) ‘P101’ data is present twice in column ‘PartyId’ in ‘Client’ table –
Is there any discrepancy? Give reason for your answer.
11 In a database company, there are two tables given below: 4
Table: SALES
SALESMANI NAME SALES LOCATIONI
D D
S1 ANITA SINGH 250000 102
ARORA
S2 Y.P.SINGH 1300000 101
S3 TINA JAISWAL 1400000 103
S4 GURDEEP SINGH 1250000 102
S5 SIMI FAIZAL 1450000 103
Table: LOCATION
LOCATION LOCATIONNAM
ID E
101 Delhi
102 Mumbai
103 Kolkata
104 Chennai

Write SQL queries for the following:


(i) To display SalesmanID, names of salesmen, LocationID with
corresponding location names.
(ii) To display names of salesmen, sales and corresponding location
names who have achieved Sales more than 1300000.
(iii) To display names of those salesmen who have ‘SINGH’ in their
names.
(iv) Identify Primary key in the table SALES. Give reason for your
choice.

12 (i) A school with 20 stand‐alone computers is considering networking 2


them together and adding a server. State 2 advantages of doing this.
OR
Distinguish between LAN and WAN.
(ii) Vidya College has three departments that are to be connected into 2
a network. Which of the following communication medium (out
of the given options), should be used by the college for connecting
their departments for very effective High Speed communication?
• Coaxial Cable
• Optical Fiber
• Ethernet Cable
Also name the type of network (out of PAN/LAN/WAN) formed.
13 G.R.K International Inc. is planning to connect its Bengaluru Office 4
Setup with its Head Office in Delhi. The Bengaluru Office G.R.K.
international Inc. is spread across and area of approx. 1 square
kilometer, consisting of 3 blocks – Human Resources, Academics
and Administration.

You as a network expert have to suggest answers to the four queries


(i) to (iv) raised by them.

Notes : Keep the distance between blocks and number of computers


in each block in mind, while providing them the solutions.
(i) Suggest the most suitable block in the Bengaluru Office Setup,
to host the server.
Give a suitable reason with your suggestion.
(ii) Suggest the cable layout among the various blocks within the
Bengaluru Office Setup for
connecting the Blocks.
(iii)Suggest a suitable networking device to be installed in each of
the blocks essentially required for connecting computers inside
the blocks with fast and efficient connectivity.
(iv) Suggest the most suitable media to provide secure, fast and
reliable data connectivity between Delhi Head Office and the
Bengaluru Office Setup.

KENDRIYA VIDYALAYA SANGATHAN


REGIONAL OFFICE RAIPUR
MARKING SCHEME SAMPLE PAPER – 6 TERM2 EXAM-2021-22
CLASS XII - COMPUTER SCIENCE (Code: 083)

Maximum Marks: 35 Time: 2 hours

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
Q. Part Question Marks
No No.
1. Push operation refers to inserting an element in the stack. Since there's (2)
only one position at which the new element can be inserted — Top of
the stack, the new element is inserted at the top of the stack. Pop
operation refers to the removal of an element. .
2. (i) 1. GSM: Global System for Mobile Communication. (1)
2. GPRS: General Packet Radio Service.

(ii) Telnet: It is an older internet utility that lets us log on to remote (1)
computer system. It also facilitates for terminal emulation purpose.
3. (2)

.
4. (A) fetchone() :- The fetchone() method will return only one row from (2)
the result set in the form of tuple containing a record.

(B) fetchall() :- The fetchall() method return all the rows from the result
set in the form of a tuple congaing the records.

5 a. How many attributes are there in above table? (2)

Ans. There are 5 attributes/columns

b. How many tuples are there in above table?

Ans. There are 2 tuples

c. What is the degree of above table?

Ans. degree – 5

d. What is the cardinality of above table?

Ans. Cardinality – 2
6. (i) use student; (1)

(ii) Show tables; (1)

7 (i) Data type of AnimalId : Varchar/charData type of 2


VaccinationDate : Date
(ii) No
Reason – Not Null Constraint applied on attribute AnimalName

OR
CREATE TABLE BANK (Acct_number INTEGER (4) PRIMARY
KEY, Name VARCHAR(3) ,BirthDate DATE, Balance INTEGER ( 8 )
NOT NULL);
Section -B

8 def Push(Package): 3
Empid=int(input(“Enter Id of Employee: "))
Ename=input(“Enter Name of employee”)
Salary= int(input(“Enter Salary of an employee”))
T=(Empid, Ename ,Salary)
Package.append(T)
def Pop(Package):
if (Package==[]):
print( "Stack empty")
else:
print ("Deleted element:",Package.pop())

OR
PUSH OPERATION ON STACK
// function to push an item of integer type into stack
stack=[ ]
def push (stack):
item=int(input(“Enter the values of item”))
stack.append(item)
// function to push information of student include rollno and name in the
form of list, tuple, dictionary

stack=[ ]
def push (stack):
rollno=int(input(“Enter rollno of student”))
name =input(“Enter Name of student”)
item=(rollno, name) \\ [rollno, name] \\ {rollno : “name”} \\ as per the
problem
stack.append(item)

9 (i) Desc EMP; 1

(ii) SELECT Name, Class FROM Students 2


WHERE Course_name IS NULL OR Course_name LIKE ’%economics’;
10 (i) Primary key (Table : Party ) ‐ PartyId Primary key 3
(Table : Client) ‐ ClientId
(ii) There is no discrepancy. PartyId is not the Primary key in table
Client. Hence ,repetition is permissible.
11 (i) Select SalesmanID, Name, LocationID, LocationName 4
from SALES, LOCATION Where SALES.LocationID=
LOCATION.LocationID ;
(ii) Select Name, Sales, LocationName from SALES, LOCATION
Where SALES.LocationID= LOCATION.LocationID And
Sales>1300000;
(iii) Select Name from SALES Where Name Like “%Singh%;
(iv) Primary Key – SALESMANID , because it is containing unique
value.
12 (I) Sharing Resources‐ Resources like Printer, storage, Internet and files 2
can be shared.
Improved Communication‐ Communication among users can be faster
using e‐mail and other services.
OR

LAN is a local network spread over a building or campus in limited


area whereas WAN is big network and can spread across countries.

(ii) (i) Optical fiber 2


(ii) LAN
13 4
(i) Human Resources because it has maximum number of
computers.

( iii) Switch
(iv ) Satellite link

You might also like