Class - XII: Multiple Choice Question Bank (MCQ) Term - II
Class - XII: Multiple Choice Question Bank (MCQ) Term - II
Class - XII: Multiple Choice Question Bank (MCQ) Term - II
Multiple Choice
Question Bank
[MCQ ] Term – II
1|Page
QUESTION BANK
S. TERM - 1 TERM - 2
No.
(Click the LINK to directly reach the Page (Click the LINK to directly reach Page
content) Number the content) Number
1 DISTRIBUTION OF MARKS 06 DISTRIBUTION OF MARKS 05
TABLE OF CONTENTS
5|Page
6|Page
7|Page
8|Page
9|Page
11 | P a g e
TERM-2
95 | P a g e
96 | P a g e
97 | P a g e
98 | P a g e
99 | P a g e
100 | P a g e
101 | P a g e
102 | P a g e
103 | P a g e
104 | P a g e
105 | P a g e
106 | P a g e
107 | P a g e
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
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
24. Which one of the following is the most common internet protocol?
A.HTML
B.NetBEUI
C.TCP/IP
D.IPX/SPX
110 | P a g e
27. Which of the following is not an unit for data transfer rate?
A.MBPS
B.KBPS
C.SBPS
D.GBPS
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
111 | P a g e
D. Web
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
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
112 | P a g e
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
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
113 | P a g e
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
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
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
114 | P a g e
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
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
115 | P a g e
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
73. Which protocol is commonly used to retrieve email from a mail server?
A. FTP
B. IMAP
C. HTML
D. TELNET
76. A network point that provides entrance into another network is called as ___________
A. Node
B. Gateway
C. Switch
D. Router
116 | P a g e
77. TELNET used _________ protocol for data connection
A. TCP
B. UDP
C. IP
D. DHCP
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
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.
117 | P a g e
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.
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.
118 | P a g e
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).
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.
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.
119 | P a g e
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).
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
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
Building No of
3 and 5 Meters
computers
Building 65
1 40
1 and 5 Meters
Building 50 2 45
2 and 5 Meters 3 11
4 70
5 60
Computers in each building are networked but buildings are not networked so far. The
Company has now decided to connect building also.
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
unit Store
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.
121 | P a g e
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:
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
122 | P a g e
(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
123 | P a g e
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
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
124 | P a g e
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.
125 | P a g e
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
b) Suggest the most suitable place (i.e. building) to house the server of this organization with a
suitable reason.
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.
126 | P a g e
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.
127 | P a g e
ANSWER KEY (MCQs):
QU 1
S 1 2 3 4 5 6 7 8 9 0
AN
S D C A C D A C D B B
QU 1 1 1 1 1 1 1 1 1 2
S 1 2 3 4 5 6 7 8 9 0
AN
S A D A B A A C A A B
QU 2 2 2 2 2 2 2 2 2 3
S 1 2 3 4 5 6 7 8 9 0
AN
S B C A C C D C D B B
QU 3 3 3 3 3 3 3 3 3 4
S 1 2 3 4 5 6 7 8 9 0
AN
S B D D D A D C B A D
QU 4 4 4 4 4 4 4 4 4 5
S 1 2 3 4 5 6 7 8 9 0
AN
S C B A B C A D B A A
QU 5 5 5 5 5 5 5 5 5 6
S 1 2 3 4 5 6 7 8 9 0
AN
S D C B B B A D B B C
QU 6 6 6 6 6 6 6 6 6 7
S 1 2 3 4 5 6 7 8 9 0
AN
S A C D C C D C C B A
QU 7 7 7 7 7 7 7 7 7 8
S 1 2 3 4 5 6 7 8 9 0
AN
S A B B D C B A D C A
128 | P a g e
129 | P a g e
130 | P a g e
131 | P a g e
132 | P a g e
133 | P a g e
134 | P a g e
135 | P a g e
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
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
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
12. Name the host name used for signing in the database.
(a) localhost (b) localpost (c) localcost (d) none of the above
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
136 | P a g e
16. Consider the following table namely employee:
Employee_id Name Salary
5001 Amit 60000
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
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
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
137 | P a g e
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
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()
31. Which of the following attributes can be considered as a choice for primary key?
(a)Name (b)Street (c) Roll No (d) Subject
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’;
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%’
138 | P a g e
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.
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
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
139 | P a g e
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
53. All aggregate functions except _______ ignore null values in their input collection.
(a) Count (attribute) (b) Count (*) (c) Avg (d) Sum
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
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
140 | P a g e
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?
=====================*====================*========================
141 | P a g e
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.
142 | P a g e
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.
143 | P a g e
-------ANSWER -------
OBJECTIVE TYPE QUESTIONS /MULTIPLE CHOICE QUESTIONS
1 (a)Structure Query Language 21 (b)Having, where 41 (c)25,35,38
144 | P a g e
-------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
145 | P a g e
-------ANSWER -------
Fill in the blanks
1 Structured 11 NOT IN 21 Group/row/ aggregation
function
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
146 | P a g e
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
147 | P a g e
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 returns one result per row It returns one result for multiple rows.
148 | P a g e
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
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;
150 | P a g e
(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
151 | P a g e
Ritu Tondon
Rachel Lee
Ans .5
(i) 3 (ii)650 (iii)TDH
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
152 | P a g e
(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
(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
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
154 | P a g e
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
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 and
16-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.
155 | P a g e
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
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;
157 | P a g e
Class: XII Session 2021-22
Computer Science (083)
TERM – 2 Question Paper (Theory)
Unit-wise mark distribution pattern
Short Case
Unit MCQ Long Answer Total
Answer study
Unit -1 2 (2 Q) - 3 (1 Q) - 5
Unit -2 2 (2 Q) 4 (2 Q) - 4 (1 Q) 10
Unit - 3 1 (1 Q) 6 (3 Q) 9 (3 Q) 4 (1 Q) 20
5 10 12 8 35
158 | P a g e
TERM -2 EXAMINATION
SET-1 – 2021-22
Class –XII SUB-Computer Sc.
Max. Marks: 35 Duration: 2:00Hrs
General Instructions:
5. This question paper contains two parts A and B. Each part is compulsory.
6. Some questions have internal choice.
7. Part-A has 8 MCQ questions of 1 mark each, Attempts any 5 questions.
8. Part – B has three sections
a. Section-I is short answer questions of 2 marks each.
b. Section-II is long answer questions of 3 marks each.
c. Section-III is very long answer questions of 4 marks.
9. All programming questions are to be answered using Python Language only.
160 | P a g e
17 Consider the table TEACHER given below. Write commands in SQK for (i) to (iii)
ID NAME DEPARTMENT HIREDATE CATEGOR GENDER SALARY
Y
1 TANIYA SOCIALSTUDIE 1994-03-17 TGT F 25000
S
2 ABHISHEK ART 1990-12-02 PRT M 20000
3 SANJANA ENGLISH 1980-05-16 PGT F 30000
4 VISHWAJEE ENGLISH 1989-10-16 TGT M 25000
T
5 AMAN HINDI 1990-01-08 PRT F 22000
6 PRITAM MATH 1980-03-17 PRT F 21000
7 RAJKUMAR SCIENCE 1994-02-09 TGT M 27000
8 SITAL MATH 1980-11-17 TGT F 24500
Attempt the following -
i To display all information about teachers of Female PGT Teachers. 1
ii To list names, departments and date of hiring of all the teachers in descending order of date of joining. 1
iii To count the number of teachers and sum of their salary department wise. 1
SECTION - 3
18 Success Institution is an educational organisation. It is planning to set up its India campus at Nepal with
its head office at Mumbai. The Nepal campus has 4 main buildings- ADMIN, ENGINEERING,
BUSINESS and MEDIA.
You as a network expert have to suggest the best network related solutions for their problems raised in (i)
to (iv), keeping in mind the distance between the buildings and other given parameters.
ADMIN ENGINEERING
BUSINESS MEDIA
161 | P a g e
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 4
W003 15 4
Write the SQL command for the following statements:
i To display total quantity in store of unisex type watches. 1
ii To display watch name and their quantity sold in first quarter. 1
Give the output for the following SQL queries:
i SELECT WATCH_NAME, PRICE , TYPE FROM WATCHES W, SALE S WHERE 1
W.WATCHID=S.WATCHID;
ii SELECT WATCH_NAME, QTY_STORE , SUM(QTY_SOLD), FROM WATCHES W, SALE S 1
WHERE W.WATCHID = S.WATCHID GROUP BY S.WATCHID
162 | P a g e
TERM 2 EXAM SET-1-2021-22
MARKING SCHEME
Class –XII SUB-Computer Sc.
Question PART - A Marks
No. Allotted
Section -1
1 C) UNDERFLOW 1
2 C) Reversing the order of items 1
3 a)1 1
4 b)peer-to-peer network 1
5 a)modulation 1
6 c)distinct 1
7 b)Exactly, Atleast 1
8 a)count(attribute) 1
Part B
9 Expand the following- 2
i SIMPLE MAIL TRANSFER PROTOCOL
ii DYNAMIC HOST CONFIGURATION PROTOCOL
iii HYPERTEXT TRANSFER PROTOCOL
iv TRANSMISSION CONTROL PROTOCOL
10 When a hosting provider allocates space on a web server for a website to store its files, they are 2
hosting a website.
OR
Video Conferencing Chat 2
Audio as well Visuals are shared Only text communicated.
High Bandwidth required Works with low bandwidth also.
11 CHAR is used to occupy fixed memory irrespective of the actual values but VARCHAR uses only 2
that much memory which is used actually for the entered values.
E.g. CHAR(10) will occupy always 10 bytes in memory no matter how many characters are used
in values. But VARCHAR will uses only that much bytes of memory whose values are passed.
12 CANDIDATE KEY 2
A Candidate key is the one that is capable of becoming primary key.
CARDINALITY OF A RELATION
Cardinality of a relation represents number of rows in the relation.
13 ORDER BY for sorting 2
GROUP BY for grouping data
14 city=[] 3
def PUSHCITY(cityname,pincode):
city.insert(0,[cityname,pincode])
OR
city=[]
def POPCITY():
if len(city)==0:
print(“Underflow”)
return None
return city.pop()
15 ANSWER
i d) DELETE * FROM WORKER; 1
ii WORKER_ID 1
iii ALTER TABLE WORKER MODIFY FIRST_NAME VARCHAR(20) 1
iv DESC WORKER/DESCRIBE WORKER; 1
16 ANSWER
i 43000
ii MAX(DOB) MIN(DOB)
08-10-1995 05-07-1993
iii GENDER COUNT(*)
F 3
M 3
163 | P a g e
17 ANSWER
iii Firewall 1
iv c) Video Conferencing 1
19 ANSWER
i SELECT SUM(QTY_STORE) FROM WATCHES WHERE TYPE =’Unisex’; 1
ii SELECT WATCH_NAME, QTY_SOLD FROM WATCHES W, SALE S WHERE 1
S.WATCHID=S.WATCHID AND QUARTER=1;
164 | P a g e
TERM 2 EXAMINATION SET-2
Class –XII 2021-22 SUB-Computer Sc.
Max. Marks: 35 Duration: 2:00Hrs
General Instructions:
1. This question paper contains two parts A and B. Each part is compulsory.
2. Some questions have internal choice.
3. Part-A has 8 MCQ questions of 1 mark each, Attempts any 5 questions.
4. Part – B has three sections
a. Section-I is short answer questions of 2 marks each.
b. Section-II is long answer questions of 3 marks each.
c. Section-III is very long answer questions of 4 marks.
5. All programming questions are to be answered using Python Language only.
165 | P a g e
15 Write the outputs of the SQL Queries(i) to (iii) based on the relations Client and Product given below:
Client
C_ID ClientName City Share
01 Cosmetic Shop Delhi 2000
02 Total Health Mumbai 3500
03 Live Life Delhi 4500
04 Pretty Woman Delhi 2500
05 Dreams Delhi NULL
Attempt any 03 of the following :-
i SELECT COUNT(CITY),CITY FROM CLIENT GROUP BY CITY; 1
ii SELECT CLIENTNAME FROM CLIENT WHERE CLIENTNAME LIKE ‘%C%; 1
iii SELECT AVG(SHARE) FROM CLIENT WHERE CITY=’DELHI’; 1
iv SELECT CLIENTNAME FROM CLIENT ORDER BY SHARE DESC; 1
16 Consider the following table GARMENT. Write SQL commands for the following statements.
GCODE DESCRIPTION PRICE FCODE READYDATE
10023 SKIRT 1150 F03 19-DEC-08
10001 FORMAL SHIRT 1250 F01 12-JAN-08
10012 INFORMAL SHIRT 1550 F02 06-JUN-08
10024 BABY TOP 750 F03 07-APR-07
10090 TOP 850 F02 31-MAR-07
10019 EVENING DRESS 850 F03 06-JUN-08
10009 INFORMAL PANT 1500 F02 20-OCT-08
10017 FORMAL PANT 1350 F01 09-MAR-08
10020 FROCK 850 F04 09-SEP-07
10089 SLACKS 750 F03 31-OCT-08
i To Display GCODE and DESCRIPTION of each GARMENT in descending order of GCODE.
ii To display the details of all the GARMENTs, which have READYDATE in between 08-DEC-07 and
16-JUN-08(inclusive of both the dates)
iii To display FCODE wise highest and lowest price of GARMENTs from GARMENT table.
17 Consider the following table HOSPITAL. Write SQL commands for the following statements.
NO NAME AGE DEPARTMENT DATEOFJOIN CHARGES GENDER
1 ARPIT 62 SURGERY 21/01/98 300 M
2 ZARINA 22 ENT 12/12/97 250 F
3 KAREEM 22 ORTHOPEDIC 19/02/98 200 M
4 ARUN 12 SURGERY 11/01/98 300 M
5 ZUBIN 30 ENT 12/01/98 250 M
6 KETAKI 16 ENT 24/02/98 250 F
7 ANKITA 29 CARDIOLOGY 20/02/98 800 F
8 ZAREEN 45 GYNECOLOGY 22/02/98 300 F
9 KUSH 19 CARDIOLOGY 13/01/98 800 M
10 SHILPA 23 NUCLEAR MEDICINE 21/02/98 400 F
i SELECT COUNT (DISTINCT Charges) FROM HOSPITAL; 1
ii SELECT MIN (Age) FROM HOSPITAL WHERE Sex = “F”; 1
iii SELECT SUM (Charges) FROM HSOPITAL WHERE Department = “F”; 1
SECTION - 3
18 Quick Learn University is setting up its academic blocks at Prayag Nagar and planning to set up a
network. The university has 3 academic blocks and one human resource Centre as shown in the
diagram given below:
BUSINESS TECHNOLOGY BLOCK
166 | P a g e
LAW BLOCK HR CENTRE
organization
with suitable reason.
ii Suggest a cable layout of connection between the blocks. 1
iii Which device should be placed/installed in each of these blocks to 1
various parts of the other cities. Which type of network out of LAN,
MAN or WAN will be formed?
19 Write SQL Commands for the following queries based on the relations
PRODUCT and CLIENT given below.
Table: Product
i To display the Client Name and City of all Mumbai- and Delhi-based clients in Client table. 1
ii Increase the price of all the products in Product table by 10%. 1
iii To display the ProductName, Manufacturer, Expiry Date of all the 1
City.
167 | P a g e
TERM 2 EXAMINATION
SET-2-2021-22
Class –XII
MARKING SCHEME SUB-Computer Sc.
Question PART - A Marks
No. Select the most appropriate option out of the options given for each question. Attempt any 5 Allotted
questions from no 1 to 8.
1 d)-18 1
2 b)push 1
3 c)32 bits 1
4 a)Firewall 1
5 c)Physical Address(MAC) 1
6 b)6 1
7 a)Alter 1
8 c)Fixed, Variable 1
Part B
9 Expand the following- 2
i GSM: GLOBAL SYSTEM FOR MOBILES
ii POP: POST OFFICE PROTOCOL
iii FTP: FILE TRANSFER PROTOCOL
iv XML: EXTENSIBLE MARKUP LANGUAGE
10 Web-Server 2
A web server is software and hardware that uses HTTP (Hypertext Transfer Protocol) and other
protocols to respond to client requests made over the World Wide Web.
OR
Difference between HUB and SWITCH. 2
HUB SWITCH
Broadcasts messages. Unicasts messages.
Lower Bandwidth Higher bandwidth
11 Difference between DDL and DML. 2
Data Definition Language is used to work on structure of object (tables etc.) while Data
Manipulation Language is used to work on data stored in tables.
E.g.
DDL create , alter, drop
DML insert, delete, update
12 Primary Key 2
A set of one or more attributes that can uniquely identify tuples within the relation.
Degree of a Relation
Degree of a relation represents number of attributes in the relation.
13 Alter 2
Update
14 def PushBook(Book): 3
iii avg(Share) 1
3000
iv Client Name 1
Live Life
Total Health
Pretty Woman
Cosmetic Shop
Dreams
16 Answer
i SELECT GCODE, DESCRIPTION FROM GARMENT ORDER BY GCODE DESC
ii SELECT * FROM GARMENT WHERE READYDATE BETWEEN ’08-DEC-07’ AND ’16-
JUN-08’;
iii SELECT FCODE, MAX(PRICE), MIN(PRICE) FROM GARMENT GROUP BY FCODE;
17 Answer
i 5 1
ii 16 1
iii 5 1
18 Answer
i HR CENTRE block because it has max number of computers. 1
ii Suggest a cable layout of connection between the blocks. 1
iii HUB/SWITCH 1
iv WAN 1
19 Answer
i SELECT CLIENTNAME, CITY FROM CLIENTWHERE CITY = ‘MUMBAI’ OR CITY = 1
‘DELHI’;
ii UPDATE PRODUCT SET PRICE = PRICE + 0.10 * PRICE; 1
iii SELECT PRODUCTNAME, MANUFACTURER, EXPIRYDATE FROM PRODUCT WHERE 1
EXPIRYDATE < = ‘2010-12-31’;
iv select ProductName, Manufacturer, ClientName from product,client Where product.P_ID = 1
Client.P_ID and city=’Mumbai’
169 | P a g e
Term-2 Examination SET-3 – 2021-22
Model Question Paper
Class- XII, Subject – Computer Science (083)
Duration: 2 Hrs MM: 35
Part-A
(Attempt any 5 questions from question no 1 to 7.)
1. All aggregate functions except ___________ ignore null values in their input 1
collection.
(a) Count (attribute)
(b) Count (*)
(c) Avg ()
(d) Sum ()
170 | P a g e
(c) Bluetooth
(d) Satellite
6. In a stack, if a user tries to remove an element from an empty stack, it is called 1
_________
(a) Overflow
(b) Underflow
(c) Empty collection
(d) Garbage collection
7. Which is known as range operator in MySQL. 1
(a) IN
(b) BETWEEN
(c) IS
(d) DISTINCT
Part-B
(Section - I)
8. Expand the following terms: 2
a) POP3 b) TCP/IP c) VoIP d) HTTPS
Product
P_ID ProductName Manufacturer Price Discount
TP01 Talcom Powder LAK 40
FW05 Face Wash ABC 45 5
BS01 Bath Soap ABC 55
SH06 Shampoo XYZ 120 10
171 | P a g e
FW06 Face Wash XYZ 95
Table: HRDATA
ECode EName Desig Sal
80001 Sunishka Guha Programmer 50000
80004 Tanya Chandra Manager 65000
80007 Sanjana Kapoor Programmer 45000
80008 Tejas Sahu Admin 55000
80012 Aditya Kumar Executive 35000
16. What do you understand by Primary Key, Candidate Key and Alternate Key in a 3
table? In the table given below, identify the Primary, candidate and alternate keys –
OR
Explain any three aggregate functions of SQL with suitable example of each taking
the following table into consideration –
172 | P a g e
(Section - III)
(Q. no. 17 and 18, having 4 marks each with internal choices)
17. Consider the following tables Supplier and Consumer. Write SQL commands for the
statements (a) to (d).
Supplier
SupplierID SupplierName SupplierAddress Suppliercity
JR01 Rohit Bhalla 14, Floret Appt Jaipur
PH02 Harish Nagar A3, Gandhi Lane Panjim
PS15 Subrat Ray 14/B, Surya Vihar Panjim
JT50 Tina Chandran 12-H, Bank Colony Jaipur
Consumer
C_ID SupplierID CName CAddress Ccity
C101 JR01 Varun Mishra 5, Central Avenue Delhi
C342 PH02 Sonia Singh 116, Block A Delhi
C112 JR01 Prabhu S 2A, Andheri East Mumbai
C008 PS15 Abhishek Das B5, CS Terminals Panjim
C035 JT50 Rahul Jain 13,B Mayur Vihar Mumbai
(a) To display the C_ID, Supplier name, Supplier Address, Consumer Name and 1
Consumer Address for every Consumer
(b) To display Consumer details in ascending order of CName 1
(c) To display number of Consumers from each city 1
(d) To display the details of suppliers whose supplier city is ‘Panjim’ 1
OR
Write the outputs of the SQL queries (i) to (iv) based on the relations Drink and
Consumer given below:
Table: Drink
D_ID DrinkName Company Price
AP01 Aam Panna Haldiram 185.00
OS23 Orange Sqaush Rasna 75.00
MP22 Mango pulp Haldiram 190.00
LI12 Lichi Real 125.00
LE02 Lemonade Real 110.00
Table:Consumer
C_ID ConsumerName Address D_ID
1 D Mart Junwani, Durg LI12
6 Rajesh Super Bazaar A Market Sec-10 OS23
12 Shubham K Mart Junwani, Durg AP01
15 Big Bazaar Surya Mall, Bhilai LE02
1
(i) SELECT count(DISTINCT Address) FROM Consumer;
1
(ii) SELECT Company, MAX(Price), MIN(Price), COUNT(*) from Drink
GROUP BY Company;
1
(iii) SELECT Consumer.ConsumerName, Drink.DrinkName, Drink.Price
FROM Drink, Consumer WHERE Consumer.D_ID = Drink.D_ID;
1
(iv) SELECT DrinkName from Drink where DrinkName like “-a%”;
173 | P a g e
18. Dhanvridhhi Investment Pvt. Ltd. has four branches in a Campus, named Durg,
Bhilai, Raipur and Charoda. Dhanvridhhi Investment Pvt. Ltd. wants to establish the
networking between all the four offices. A rough layout of the same is as
follows:
Approximate distances between these offices as per network survey team are as
follows:
Place From Place To Distance
Durg Bhilai 30 m
Bhilai Charoda 40 m
Charoda Raipur 25 m
Durg Raipur 150 m
Bhilai Raipur 105 m
Durg Charoda 60 m
In continuation of the above, the company experts have planned to install the
following number of computers in each of their offices:
(i) Suggest the most suitable place (i.e., Block/Center) to install the server of
this organization with a suitable reason. 1
(ii) Which device will you suggest to be placed/installed in each of these
offices to efficiently connect all the computers within these offices? 1
(iii) Suggest the placement of a Repeater in the network with justification. 1
(iv) The organization is planning to connect its new office in Delhi, which is
more than 1250 km current location. Which type of network out of LAN, 1
MAN, or WAN will be formed? Justify your answer.
OR
“Ujjwal Patra” an NGO is planning to setup its new campus at Pondicherry for its
Web-based activities. The campus has four(04) UNITS as shown below:
174 | P a g e
Distances between above UNITs are given here’s under:
175 | P a g e
\
Term-2 Examination SET-3 – 2021-22
Answer Key
Class- XII, Subject – Computer Science (083)
Duration: 2 Hrs MM: 35
General Instructions to the Examinee:
1. rThis question paper contains two parts – A and B. Each part is compulsory.
2. Part A and Part B both have choices.
3. Part-A is having MCQs
4. Part-B is descriptive paper.
5. Part-B has 3 sections –
a. Section – I is short answer questions of 2 marks each, having 5 questions, out of which 2 questions
having internal options.
b. Section – II is long answer questions of 3 marks each, having 4 questions, out of which 2 questions
having internal options.
c. Section – III is very long answer questions of 4 marks each, having 2 questions with internal
options.
NOTE: Answers are suggestive. Marks can be given for any other valid and correct answer.
Part-A
(Attempt any 5 questions from question no 1 to 7.)
1. All aggregate functions except ___________ ignore null values in their input
collection.
(a) Count (attribute) B
(b) Count (*)
(c) Avg ()
(d) Sum ()
176 | P a g e
6. In a stack, if a user tries to remove an element from an empty stack, it is called
_________
B
(a) Overflow
(b) Underflow
(c) Empty collection
(d) Garbage collection
Part-B
(Section - I)
8. Expand the following terms:
a) POP3 b) TCP/IP c) VoIP d) HTTPS
Answer –
a) Post Office Protocol 3 ½
b) Transmission Control Protocol/ Internet Protocol ½
c) Voice over Internet Protocol ½
d) Hyper Text Transfer Protocol Secure ½
Answer –
WHERE Clause is used to filter the records from the table or used while joining
more than one table.Only those records will be extracted who are satisfying the 1
specified condition in WHERE clause. It can be used with SELECT, UPDATE,
DELETE statements.
HAVING Clause is used to filter the records from the groups based on the given
condition in the HAVING Clause. Those groups who will satisfy the given 1
condition will appear in the final result. It can be used only with GROUP BY
clause.
177 | P a g e
OR
11. Differentiate between fetchone() and fetchall() methods with suitable examples for 2
each.
Answer –
fetchall() fetches all the rows of a query result. An empty list is returned if there
is no record to fetch the cursor.
fetchone() method returns one row or a single record at a time. It will return
None if no more rows / records are available.
12. What is the difference between hub and switch? Which is more preferable in a large 2
network of computers and why?
Answer –
Hub forwards the message to every node connected and create a huge traffic in
the network hence reduces efficiency whereas a Switch is also called intelligent
hub since it redirects the received information/ packet to the intended node(s).
(Section - II)
13. Write a function in Python PUSH(Arr), where Arr is a list of numbers. From this list 3
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.
Answer –
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)
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.
Answer –
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)
Note: Full marks can be awarded for any other correct logic.
14. Write the outputs of the SQL queries (i) to (iii) based on the relations Client and
Product given below:
Client
C_ID ClientName City P_ID
01 Cosmetic Shop Delhi TP01
02 Total Health Mumbai FW05
03 Live Life Delhi BS01
04 Pretty Woman Delhi SH06
05 Dreams Delhi Delhi TP01
179 | P a g e
Product
P_ID ProductName Manufacturer Price Discount
TP01 Talcum Powder LAK 40
FW05 Face Wash ABC 45 5
BS01 Bath Soap ABC 55
SH06 Shampoo XYZ 120 10
FW06 Face Wash XYZ 95
Table: HRDATA
ECode EName Desig Sal
80001 Sunishka Guha Programmer 50000
80004 Tanya Chandra Manager 65000
80007 Sanjana Kapoor Programmer 45000
80008 Tejas Sahu Admin 55000
80012 Aditya Kumar Executive 35000
1
(ii) Write the degree and cardinality of the table HRDATA.
180 | P a g e
Answer – Degree – 4, Cardinality – 5
16. What do you understand by Primary Key, Candidate Key and Alternate Key in a
table? In the table given below, identify the Primary, candidate and alternate keys –
Answer –
Candidate keys – All those key or key combinations in a table that can uniquely
identify a record in a table is candidate key
Primary Key – A candidate key selected by the administrator to serve t,for he
purpose of unique key is called a primary key.
Alternate key – All those candidate keys that could not become Primary key are
alternate keys.
In the table –
Candidate keys – Rno, Aadhar_no, UID and Admn_no
Primary Key – Rno or any one from above
Alternate keys – All candidate keys except the one selected for primary key.
OR
Explain any three aggregate functions of SQL with suitable example of each taking
the following table into consideration –
Answer –
The following are the most commonly used SQL aggregate functions:
AVG – calculates the average of a set of values.
COUNT – counts rows in a specified table or view.
MIN – gets the minimum value in a set of values.
MAX – gets the maximum value in a set of values.
SUM – calculates the sum of values.
(2 marks for any two aggregate functions and 1 mark for correct example)
181 | P a g e
(Section - III)
(Q. no. 17 and 18, having 4 marks each with internal choices)
17. Consider the following tables Supplier and Consumer. Write SQL commands for the
statements (a) to (d).
Supplier
SupplierID SupplierName SupplierAddress Suppliercity
JR01 Rohit Bhalla 14, Floret Appt Jaipur
PH02 Harish Nagar A3, Gandhi Lane Panjim
PS15 Subrat Ray 14/B, Surya Vihar Panjim
JT50 Tina Chandran 12-H, Bank Colony Jaipur
Consumer
C_ID SupplierID CName CAddress Ccity
C101 JR01 Varun Mishra 5, Central Avenue Delhi
C342 PH02 Sonia Singh 116, Block A Delhi
C112 JR01 Prabhu S 2A, Andheri East Mumbai
C008 PS15 Abhishek Das B5, CS Terminals Panjim
C035 JT50 Rahul Jain 13,B Mayur Vihar Mumbai
(a) To display the C_ID, Supplier name, Supplier Address, Consumer Name and
Consumer Address for every Consumer
Answer –
Select C_ID, S.SupplierName, S.SupplierAddress, C.CName, C.CAddress 1
from Supplier S, Consumer C where C.SupplierID=S.SupplierID;
OR
Write the outputs of the SQL queries (i) to (iv) based on the relations Drink and
Consumer given below:
Table: Drink
D_ID DrinkName Company Price
AP01 Aam Panna Haldiram 185.00
OS23 Orange Sqaush Rasna 75.00
MP22 Mango pulp Haldiram 190.00
LI12 Lichi Real 125.00
LE02 Lemonade Real 110.00
182 | P a g e
Table:Consumer
C_ID ConsumerName Address D_ID
1 D Mart Junwani, Durg LI12
6 Rajesh Super Bazaar A Market Sec-10 OS23
12 Shubham K Mart Junwani, Durg AP01
15 Big Bazaar Surya Mall, Bhilai LE02
(i) SELECT count(DISTINCT Address) FROM Consumer;
Answer – 3 1
(ii) SELECT Company, MAX(Price), MIN(Price), COUNT(*) from Drink
GROUP BY Company;
Answer –
Haldiram 190.00 185.00 2
Rasna 75.00 75.00 1 1
Real 125.00 110.00 2
(iii) SELECT Consumer.ConsumerName, Drink.DrinkName, Drink.Price
FROM Drink, Consumer WHERE Consumer.D_ID = Drink.D_ID;
Answer –
D Mart Lichi 125.00
Rajesh Super Bazar Orange Squash 75.00
Shubham K Mart Aam Panna 185.00
1
Big Bazar Lemonade 110.00
(iv) SELECT DrinkName from Drink where DrinkName like “-a%”;
Answer –
Aam Panna
Mango Pulp
1
18. Dhanvridhhi Investment Pvt. Ltd. has four branches in a Campus, named Durg,
Bhilai, Raipur and Charoda. Dhanvridhhi Investment Pvt. Ltd. wants to establish the
networking between all the four offices. A rough layout of the same is as
follows:
Approximate distances between these offices as per network survey team are as
follows:
Place From Place To Distance
Durg Bhilai 30 m
Bhilai Charoda 40 m
Charoda Raipur 25 m
Durg Raipur 150 m
Bhilai Raipur 105 m
Durg Charoda 60 m
183 | P a g e
In continuation of the above, the company experts have planned to install the
following number of computers in each of their offices:
(i) Suggest the most suitable place (i.e., Block/Center) to install the server of 1
this organization with a suitable reason.
Answer – Charoda, as there are more no. of systems and also 80-20
rule of network traffic.
1
(ii) Which device will you suggest to be placed/installed in each of these
offices to efficiently connect all the computers within these offices?
Answer – Hub/Switch
1
(iii) Suggest the placement of a Repeater in the network with justification.
Answer – Between Durg and Raipur, and also Bhilai and Raipur, as
the distance is more than 100 m.
(iv) The organization is planning to connect its new office in Delhi, which is 1
more than 1250 km current location. Which type of network out of LAN,
MAN, or WAN will be formed? Justify your answer.
Answer –
WAN, as the distance is more, hence WAN is suitable.
OR
“Ujjwal Patra” an NGO is planning to setup its new campus at Pondicherry for its
web-based activities. The campus has four(04) UNITS as shown below:
184 | P a g e
No. of Computers in various UNITs are:
Unit No. of computers
Admin 150
Finance 25
Training 90
Resource 75
(i) Suggest an ideal cable layout for connecting the above UNITs.
Any suitable layout 1
(ii) Which network device is used to connect the computers in all UNITs?
Answer – Hub/Switch 1
1
(iii) Suggest the placement of Repeater in the UNITs of above network.
Answer – Admin and Resource, and Admin and Finance
1
(iv) NGO is planning to connect its Regional Office at Chennai, Tamilnadu.
Which out of the following wired communication, will you suggest for a
very high-speed connectivity?
(b) Twisted Pair cable (b) Ethernet cable (c) Optical Fiber
Answer – Optical Fiber
------------xxxx------------
185 | P a g e