Nodia App Sample Paper for Python & SQL
Nodia App Sample Paper for Python & SQL
General Instructions:
1. This question paper contains 37 questions.
2. All questions are compulsory. However, internal choices have been provided in some questions. Attempt
only one of the choices in such questions
3. The paper is divided into 5 Sections- A, B, C, D and E.
4. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
5. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
7. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
8. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
10. In case of MCQ, text of the correct answer should also be written.
SECTION A
1. State if the following statement is True or False:
In Python, when opening a text file in ‘w+’ mode, if the file does not exist, a FileNotFoundError will be
raised.
4. In SQL, which key is an attribute or set of attributes that can uniquely identify a tuple within a relation,
but is not selected as the primary key?
8. Consider the given SQL Query, which intends to display the average salary for each job role having more
than 2 employees.
SELECT job, AVG(salary) FROM employees WHERE COUNT() > 2 GROUP BY job;
Identify the error and provide the corrected query.
(A) SELECT job, AVG(salary) FROM employees GROUP BY job WHERE COUNT() > 2;
(B) SELECT job, AVG(salary) FROM employees GROUP BY job HAVING COUNT() > 2;
(C) SELECT job, AVG(salary) FROM employees HAVING COUNT() > 2;
(D) SELECT job, AVG(salary) FROM employees WHERE COUNT > 2 GROUP BY job;
11. What possible output is expected to be displayed on the screen at the time of execution of the Python
program from the following code?
import random
Words = [“GO”, “TO”, “SLEEP”, “NOW”]
N = [Link](1, 3)
print(Words[N], end=”#”)
print(Words[N-1], end=”#”)
(A) TO#GO#
(B) SLEEP#TO#
(C) GO#TO#
(D) NOW#GO#
NODIA APP Sample Paper 01 Page 3
13. Which SQL aggregate function is used to find the total number of rows in a table that match a specified
condition?
(A) SUM() (B) TOTAL()
(C) COUNT() (D) NUM()
15. In SQL, a table ‘STUDENTS’ has 4 rows and 5 columns. After executing a DELETE command that
removes 2 rows, what will be the new cardinality of the table?
(A) Cardinality: 4 (B) Cardinality: 2
(C) Cardinality: 5 (D) Cardinality: 3
16. Which SQL constraint ensures that all values in a column are different and that the column does not contain
any NULL values?
(A) UNIQUE (B) NOT NULL
(C) PRIMARY KEY (D) CHECK
17. _________ is a network protocol used for secure data communication over a computer network, widely
used for logging into remote machines and executing commands.
(A) TELNET (B) SSH
(C) FTP (D) SMTP
18. Which of the following network topologies requires a central controller or hub, where all nodes are connected
directly to this central device?
(A) Bus Topology (B) Ring Topology
(C) Star Topology (D) Mesh Topology
19. What is the full form of XML, a markup language that defines a set of rules for encoding documents in a
format that is both human-readable and machine-readable?
(A) Extensible Markup Language (B) Executable Markup Language
(C) Extra Modern Language (D) Extended Markup Linguistics
Page 4 Sample Paper 01 CBSE Computer Science Class 12
20. Assertion (A): In Python, a try block must be followed by at least one except block or a finally block.
Reason (R): The finally block is executed regardless of whether an exception is thrown or not, making it
useful for cleanup actions.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
21. Assertion (A): The GROUP BY clause in SQL is always used before the WHERE clause.
Reason (R): The WHERE clause is used to filter individual rows from a table before they are grouped by
the GROUP BY clause.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
SECTION - B
22. Seema was asked to accept a list of even numbers ,but she did not put the relevant condition while accepting
the list of numbers. She wrote a user defined function odd to even (L) that accepts the list L as an argument
and converts all the odd numbers into even by multiplying them by 2.
def oddtoeven (L)
for i in range (size(L)):
if (L[i]%2! == 0)
L[i]= L[1] ** 2
print (L)
There are some errors in the code . Rewrite the correct code.
SECTION-C
29. Write a function countEU() in Python, which should read each character of a text file. [Link] should
count and display the occurrence of alphabets E and U (including small cases e and u too).
e.g. If the file content is as follows :
Pinaky has gone to his friend’s house.
His friend’s name is Ravya. Her house is 12 km from Pinaky’s house.
The countEU() function should display the output as
E:8
U:3
o
Write a Python program to find the longest word in file “[Link]”. If contents of [Link] are Welcome
to your one-step solutions for all your study, practice and assessment need for various competitive and
recruitment examinations and school segment. We have been working tirelessly for over a decade to make
sure that you have best in class study resources because you deserve SUCCESS AND NOTHING LESS...
Output should be
Longest word : examinations
Page 6 Sample Paper 01 CBSE Computer Science Class 12
30. Priya has created a dictionary with names as keys and marks as values for 6 students. Write a program with
separate user-defined functions to perform the following operations.
(a) Push the keys (name of the student) of the dictionary into a stack, where the corresponding value
(marks) is greater than 75.
(b) Pop and display the content of the stack.
For example If the sample content of the dictionary is as follows
R={“OM”:76, “JAI”:45, “BOB”:89, “ALI”:65, “ANU”:90, “TOM”:82}
The output from the program should be
TOM ANU BOB OM
o
Rohit has a list of 10 integers. Write a program with separate user-defined functions to perform the specified
operations on this list..
(a) Traverse the content of the list and push the even numbers into a stack.
(b) Pop and display the content of the stack.
For example, If the sample content of the list is as follows
N = [12, 13, 34, 56, 21, 79, 98, 22, 35, 38]
Sample Output of the code should be:
38 22 98 56 34 12
TABLE: STREAM
STRCDE STRNAME
1 SCIENCE+COMP
2 SCIENCE+ BIO
3 SCIENCE+ECO
4 COMMERCE+MATHS
What will be the ouput of the following statement?
SELECT NAME, STRNAME FROM STUDENT S, STREAM ST WHERE [Link]=[Link];
o
Write the output for SQL queries (i) to (iii), which are based on the table ITEMS.
TABLE: ITEMS
Code IName Qty Price Company TCode
1001 DIGITAL PAD 12i 120 11000 XENITA T01
1006 LED SCREEN 40 70 38000 SANTORA T02
1004 CAR GPS SYSTEM 50 2150 GEOKNOW T01
1003 DIGITAL CAMERA 12X 160 8000 DIGICLICK T02
1005 PEN DRIVE 32 GB 600 1200 STOREHOME T03
NODIA APP Sample Paper 01 Page 7
SECTION-D
32. (a) Find the output of the following Python program:
def makenew (mystr):
newstr = “”
count = 0
for i in mystr:
if count%2!=0:
newstr = newstr + str (count)
else:
if islower (i):
newstr = newstr + upper (i)
else:
newstr = newstr + i
count + = 1
newstr = newstr + mystr [:1]
print(“The new string is:”,
newstr)
makenew(“sTUdeNT”)
(b) Consider the table Student whose fields are
Write the Python code to update grade to ‘A’ for all these students who are getting more than 8 as points.
The table structure is as follows :
Scode : integer
Name : varchar
Age : integer
Strcde : integer
Points : integer
Grade : varchar
Note the following to establish the connection between Python and MySQL:
Host : localhost
Username : Admin
Password : Admin@123
The table exists in MySQL database as : Student
Page 8 Sample Paper 01 CBSE Computer Science Class 12
o
(a) Write a Python program to remove the characters of odd index values in a string.
(b) Consider the table MobileStock with following fields
M_Id. M_Name, M_Oty, M_Supplier
Write the Python code to fetch all records with fields M_Id, M_Name and M_Supplier from database
Mobile.
Consider:
host : localhost
UserName : root
Password : system
Database : Mobile
33. Consider the following tables GARMENT and FABRIC. Write SQL commands for the statements (i) to
(iv).
TABLE: GARMENT
GCODE DESCRI-PTION PRICE FCODE READY-DATE
10023 PENCIL 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 TULIP SKIRT 850 F02 31-MAR-07
10019 EVENING GOWN 850 F03 06-JUN-08
10009 INFORMAL PANT 1500 F02 20-OCT-08
10007 FORMAL PANT 1350 F01 09-MAR-08
10020 FROCK 850 F04 09-SEP-07
10089 SLACKS 750 F03 20-OCT-08
TABLE: FABRIC
FCODE TYPE
F04 POLYSTER
F02 COTTON
F03 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 GARMENTs, which have READYDATE in between 08-DEC-07 and
16-JUN-08 (inclusive of both the dates).
(iii) To display the average PRICE of all the GARMENTs. Which are made up of FABRIC with FCODE as
F03.
(iv) To display FABRIC wise highest and lowest price of GARMENTs from GARMENT table.
(Display FCODE of each GARMENT alongwith highest and lowest price.)
NODIA APP Sample Paper 01 Page 9
34. Red Pandas Info-systems has its 4 blocks of buildings. The number of computers and distances between
them is given below :
HR 15
ADMIN 100
SYSTEM 25
PERS 30
Building Distance
HR -Admin 10 m
HR- System 50 m
Admin- Pers 20 m
System-Pers 250 m
Answer the following questions with respect to the above :
(i) Suggest a suitable cable layout for the network.
(ii) Suggest the best place to house the server of the network.
(iii) Which topology should be used to connect computers in each building?
(iv) What kind of network will be formed here? (LAN/MAN/WAN)
Page 10 Sample Paper 01 CBSE Computer Science Class 12
SECTION - E
36. Consider the table MOVIE DETAILS given below
Table : MOVIEDETAILS
MOVIEID TITLE LANGUAGE RAT-ING PLAT-FORM
M001 Minari Korean 5 Netflix
M004 MGR Magan Tamil 4 Hotstar
M010 Kaagaz Hindi 3 Zee5
M011 Harry Potter and the Chamber of Secrets English 4 Prime Video
M015 Uri Hindi 5 Zee5
M020 Avengers: Endgame English 4 Hotstar
ss
NODIA APP Sample Paper 01 Page 11
37. Below is a program to delete the line having word (passed as argument). Answer the questions that follow
to execute the program successfully.
import ......
def filedel (word):
file1 = open (“Python. txt ”,
“......”)
nfile = open (“[Link]”, “w”)
while True:
line = [Link]( )
if not line:
break
else :
if word in line :
......
else :
print(line)
nfile......(line)
[Link]()
[Link]()
filedel (‘write’)
(i) Name the module that should import in Line 1.
(ii) In which mode, above program should open the file to delete the line?
(iii) Fill the blank in Line 11 and Line 14.
(iv) Suggest an alternative way to open and read the file without using.
(v) Explain what happens if the specified word is not found in any line of “[Link]”.
******
NODIA APP Sample Paper 02 Page 1
General Instructions:
1. This question paper contains 37 questions.
2. All questions are compulsory. However, internal choices have been provided in some questions. Attempt
only one of the choices in such questions
3. The paper is divided into 5 Sections- A, B, C, D and E.
4. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
5. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
7. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
8. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
10. In case of MCQ, text of the correct answer should also be written.
SECTION A
1. State if the following statement is True or False:
In Python, the [Link]() function is used to serialize a Python object and write it to a binary file, while
[Link]() is used to read from the binary file and deserialize it back into a Python object.
4. In SQL, which key is an attribute in one table that is used to refer to the primary key in another table,
thereby establishing a link between them?
(A) Primary Key (B) Alternate Key
(C) Foreign Key (D) Candidate Key
Page 2 Sample Paper 02 CBSE Computer Science Class 12
8. A user wants to add a new column named DOB of DATE type to the STUDENT table. The user writes the
following SQL query:
MODIFY TABLE Student ADD DOB DATE;
Identify the error and provide the corrected query.
(A) ALTER TABLE Student ADD COLUMN DOB DATE;
(B) UPDATE TABLE Student ADD DOB DATE;
(C) ALTER TABLE Student ADD DOB DATE;
(D) MODIFY Student ADD COLUMN DOB DATE;
11. What possible output is expected to be displayed on the screen at the time of execution of the Python
program from the following code?
import random
fruits = [“Apple”, “Orange”, “Banana”, “Grape”]
chosen_fruit = [Link](fruits)
print(len(chosen_fruit), chosen_fruit[0], sep=’-’)
(A) 5-Apple
(B) 6-O
(C) 5-A
(D) Banana-6
NODIA APP Sample Paper 02 Page 3
13. Which DML command in SQL is used to modify existing records in a table?
(A) MODIFY
(B) ALTER
(C) INSERT
(D) UPDATE
15. In SQL, a table ‘EMPLOYEE’ has attributes EID, Ename, Salary, and Dept. What is the degree of this
relation?
(A) Degree: 1
(B) Degree: 2
(C) Degree: 3
(D) Degree: 4
16. Which of the following SQL commands is used to add a new row of data into a table?
(A) ADD ROW
(B) CREATE
(C) INSERT INTO
(D) UPDATE
17. _________ is the standard protocol for sending emails across the Internet. It is a push protocol and is
used to send the mail, whereas POP3 or IMAP are used to retrieve it.
(A) HTTP
(B) FTP
(C) PPP
(D) SMTP
Page 4 Sample Paper 02 CBSE Computer Science Class 12
18. Which network device operates at the Network Layer (Layer 3) of the OSI model and is used to connect
different networks together, making decisions about the best path for data packets?
(A) Hub (B) Switch
(C) Repeater (D) Router
19. What does URL stand for, which is essentially the address of a given unique resource on the Web?
(A) Universal Resource Link (B) Uniform Resource Locator
(C) Unified Resource Link (D) Uniform Resource Linker
20. Assertion (A): A Python tuple is immutable, meaning its elements cannot be changed after creation.
Reason (R): If a tuple contains a mutable element like a list, the contents of that list can be modified.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
21. Assertion (A): In SQL, the LIKE operator is used with the WHERE clause for pattern matching in string
values.
Reason (R): The ‘%’ wildcard used with LIKE matches any single character.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
SECTION - B
22. Find the error in following (s).
L1 = [7, 2, 3, 4] Statement 1
L2 = L1 + 2 Statement 2
L3 = L1 * 2 Statement 3
L = [Link](7) Statement 4
24. Name two switching techniques used to transfer data between two terminals (computers).
o
Arrange the following network in ascending order of their area:
LAN, PAN, WAN, MAN
SECTION - C
29. Write a function Del() to delete the 4th word from a text file [Link].
o
Write a function countmy( ) in Python to read the text file “[Link]” and count the number of times “my”
occurs in the file.
For example If the file contents are:
My first book was. Me and My Family.
It gave me chance to be known to the world.
The output of the function should be
No. of times “my” occur : 2
30. Write Push (contents) and Pop (contents) methods in Python to add numbers and remove numbers
considering them to act as Push and Pop operations of stack.
o
Write the Push operation of stack containing person names. Notice that the name should only accept
characters, spaces and period (.) except digits. Assume that Pname is a class instance attribute.
Page 6 Sample Paper 02 CBSE Computer Science Class 12
31. Write a user-defined function find-name (name), where name is an argument in Python to delete phone
number from a dictionary phone-book on the basis of the name, where name is the key.
o
Given below is a code to open a text file and perform some operations on it. Answer questions with respect
to the code given
myfile=open(“[Link]”, “r”)
s =.......... Line 2
print(s)
[Link]( )
(i) In which mode is the file opend?
(ii) If the entire file is to be read, write a statement in place of Line 2.
(iii) What is the original code performing?
SECTION - D
32. Does python create a file itself if the file doesn’t exist in the memory? Illustrate your answer with an
example:
Write a program using following functions :
(a) inputStud() :To input details of as many students and add them to a csv file “[Link]” without
removing the previous records.
SrNo Studname City Percentage
(b) readCollege() : To open the file “[Link]” and display records whose city is “Kolkata”
o
Write a statement to create a [Link] file with the following text.
Python file handling is very interesting and useful.
Write a python code using two functions as follows
(a) removerow( ) : To remove a record from the college file “[Link]” having following structure.
SrNo Studname City Percentage
(b) getCollege( ) : To read the records of the college file “[Link]” and display names of students whose
names start with a lowercase vowel.
33. (a) Consider the tables CARS and SUPPLIER given below. What will be the output of the statement
given?
TABLE: CARS
Ccode Car-Name Make Color Capa-city Cha-rges Scode
501 A-star Suzuki RED 3 14 1
503 Indigo Tata SILVER 3 12 2
502 Innova Toyota WHITE 7 15 2
509 SX4 Suzuki SILVER 4 14 2
510 C-Class Merc-edes RED 4 35 4
Table : SUPPLIER
Scode Sname
1 Great Suppliers
2 Himalayan Vehicles
3 Road Motors
4 Speed
NODIA APP Sample Paper 02 Page 7
SELECT CarName, Sname, Charges FROM CARS C, SUPPLIER S WHERE [Link]= S. Scode
AND Charges > 15;
(b) Write the output for SQL queries (i) to (iv), which are based on the table CARDEN.
TABLE: CARDEN
C code Car Name Make Color Capa-city Charges
501 A-star Suzuki RED 3 14
503 Indigo Tata SILVER 3 12
502 Innova Toyota WHITE 7 15
509 SX4 Suzuki SILVER 4 14
510 C-Class Mercedes RED 4 35
(i) SELECT COUNT(DISTINCT Make) FROM CARDEN;
(ii) SELECT COUNT(*) Make FROM CARDEN;
(iii) SELECT CarName FROM CARDEN WHERE Capacity = 4;
(iv) SELECT SUM (Charges) FROM CARDEN WHERE Color = “SILVER”;
34. Write the output of the queries (i) to (iv) based on the table FURNITURE given below.
Table : FURNITURE
FID NAME DATE OF PURCHASE COST DISCOUNT
35. Sony corporation has set up its 4 offices in the city of Srinagar, with its offices X, Z, Y, U:
Page 8 Sample Paper 02 CBSE Computer Science Class 12
X to Z 40 m
Z to Y 60 m
Y to X 135 m
X to U 70 m
Z to U 165 m
Z to U 80 m
Number of computers in each of the offices is as follows:
X 50
Z 130
Y 40
U 15
(i) Suggest a suitable cable layout of connectivity of the offices.
(ii) Suggest placement of server in the network with suitable reason.
(iii) Suggest placement of following devices in the network:
(a) Switch/Hub
(b) Repeater
(iv) Suggest a suitable topology for connecting the computers in each building.
SECTION - E
36. Consider the table APPLICANTS
TABLE: APPLICANTS
No NAME FEE GEN-DER C_ID JOINYEAR
o
(Option for part (iii) only)
Write statements to
(a) Change width of column FEE to 20.
(b) Remove the column C_ID.
37. (a) Carefully observe the following Python code and answer the question that follow:
x = 5
def func2():
x = 3
global x
x = x + 1
print(x)
print(x)
On execution the above code, produces the following output:
6
3
Explain the output with respect to the scope of the variables.
(b) Write the code to create a table Product in database Inventory with following fields
Fields Datatype
PID varchar(5)
PName char(30)
Price float
Rank varchar(2)
Note the following to establish the connection between Python and MySQL:
Host : localhost
Username : system
Password : hello
Database : Inventory
EN
NODIA APP Sample Paper 05 Page 1
General Instructions:
1. This question paper contains 37 questions.
2. All questions are compulsory. However, internal choices have been provided in some questions. Attempt
only one of the choices in such questions
3. The paper is divided into 5 Sections- A, B, C, D and E.
4. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
5. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
7. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
8. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
10. In case of MCQ, text of the correct answer should also be written.
SECTION A
1. State if the following statement is True or False:
In Python, a variable created inside a function is local by default and cannot be accessed from outside that
function.
4. In SQL, which command is used to modify the structure of a database table, such as adding, deleting, or
modifying columns?
(A) UPDATE (B) MODIFY TABLE
(C) ALTER TABLE (D) EDIT TABLE
Page 2 Sample Paper 05 CBSE Computer Science Class 12
11. What possible output is expected to be displayed on the screen at the time of execution of the Python
program from the following code?
import random
word = “PYTHON”
char = [Link](word)
print(char, [Link](char))
(A) P 0 (B) T 2
(C) N 5 (D) All of the above
NODIA APP Sample Paper 05 Page 3
13. In SQL, which clause is used to filter the results of a GROUP BY based on an aggregate function?
(A) WHERE (B) FILTER
(C) HAVING (D) RESTRICT
15. Which of the following SQL statements is a DDL command that removes all rows from a table without
logging the individual row deletions, making it faster than DELETE?
(A) DROP (B) REMOVE ALL
(C) TRUNCATE (D) CLEAR
16. Which of the following is considered a Data Definition Language (DDL) command in SQL?
(A) SELECT (B) INSERT
(C) CREATE (D) UPDATE
17. Which protocol enables real-time, two-way voice communication over the internet, allowing users to make
phone calls using an internet connection instead of a traditional phone line?
(A) SMTP (B) VoIP
(C) PPP (D) HTTP
18. In a computer network, which device broadcasts an incoming data packet to all other connected ports,
unlike a switch which sends it only to the intended destination?
(A) Router (B) Modem
(C) Gateway (D) Hub
19. What is the term for a service that allows organizations and individuals to post a website or web page onto
the Internet, making it accessible to others on the World Wide Web?
(A) Web Browser (B) Web Server
(C) Web Hosting (D) Domain Name
20. Assertion (A): The expression my_list[:] in Python creates a shallow copy of my_list.
Reason (R): Slicing a list always creates a new list object, and a full slice [:] copies all references from the
original list into this new list object.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
Page 4 Sample Paper 05 CBSE Computer Science Class 12
21. Assertion (A): In SQL, a column with a UNIQUE constraint can contain multiple NULL values.
Reason (R): The UNIQUE constraint ensures that all values in the column are different from each other,
and NULL is not considered equal to another NULL.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
SECTION B
22. Observe the given list and find the answer of questions that follows.
list1 = [23, 45, 63, ‘Hello’, 20
‘World’, 15, 18]
(i) list1[–3]
(ii) list1[3]
28. Describe the concept of candidate keys and provide a suitable example to illustrate.
o
Observe the following table carefully and write the names of the most appropriate columns, which can be
considered as (i) candidate keys and (ii) primary key.
Table: Product
CID CNAME AMOUNT COUNTRY ITEM
101 ALLE 100000 JMEKA SHOES
111 BEN 20000 FRANCE HELMET
110 RIKI 25000 AMERICA BAG
011 BRETT LEE 105000 AUSTRALIA BAT
SECTION C
29. Write Push(contents) and Pop() methods in Python to add and remove numbers, simulating stack operations.
o
Find the final contents of a stack on which the following operations are done.
1. Push(100)
2. Push(200)
3. Push(50)
4. Push(50)
5. Pop()
6. Push()
7. Pop(2)
8. Pop()
30. The binary file “[Link]” contains employee records with the following structure:
Eno Ename Salary
1 Mr. Raj 85000
h
Write a Python program to open “[Link]” and display only the records where the employee’s salary
exceeds 75000.
o
Write a program to read the content from a text file “[Link]”, count and display the total number of lines
and blank spaces present in it. e.g. if the “[Link]” file contains the following lines:
Welcome to your one-step solutions for all your study, practice and assessment needs for various competitive
& recruitment examinations and school segment. We have been working tirelessly for over a decade to make
sure that you have best in class study resources because you deserve SUCCESS AND NOTHING LESS...
The output will be:
The status file contents are
Total lines in file are: 4
Total spaces in file are: 43
Page 6 Sample Paper 05 CBSE Computer Science Class 12
31. The code given below reads a text file and displays those words that begin with an uppercase vowel and end
with a lowercase vowel . Some of the codes are missing .Write codes to fill up the blanks.
f=open(“[Link]”)
filedata=[Link]()
count=0
print(filedata)
data=[Link](‘ ’)
for.......... in data : #Blank1
if words[–1] in “aeiou” and ...in “AEIOU”: # Blank2
print(......... .) # Blank3
[Link]()
(i) Write the missing code for Blank1.
(ii) Write the missing code for Blank2.
(iii) Write the missing code for Blank3.
o
Write a user defined function change(L) to accept a list of numbers and replace the numbers in the list with
their sum of digits.
Example
Input : [32,142,215,26,7]
Output : [5, 7 , 8 , 8, 8,7]
SECTION D
32. (a) Underline the syntax errors in the following program
x = int(input(“Enter first number:))
y = int(input(“Enter second number:”))
z = int(input(“Enter third number:”)
a = x+ b+ z
print (“Result = ”, b)
(b) Write the code to create the following table Student with the following fields
RollNo
FirstName
LastName
Address
ContactNo
Marks
Course
Rank
In the table, Rank should be Good, Best, Bad, Worst, Average.
o
(a) Differentiate between a logical error and syntax error. Also, give suitable examples of each in Python.
(b) What is the use of fetchone() method? Write an example code to fetch a single record from a database.
Note :
Database : PythonDB
Table : Student
Host : localhost
UsedlD : root
Password : arihant
NODIA APP Sample Paper 05 Page 7
34. (a) Consider the tables Travel and Train given below.
Table : Travel
Tcno Pname Class TId Amt
1 Rahul AC T1 2500
2 Sujit SL T2 4500
3 Ravi AC T1 6000
4 Ankita AC T3 1800
Table : Train
TId Tname
T1 Rajdhani
T2 Himgiri Exp
T3 Darjeeling Mail
Write the command to display the passenger names and the train names by which they are travelling for all
passengers travelling by “Mail” trains.
(b) Considering the tables Train and Travel given above write commands for the following :
(i) Display passenger names , corresponding train names and amounts for records where amount
>5000.
(ii) Increase amount of passengers by 20% who are travelling by ‘AC”
(iii) Display a cross join of the two tables.
o
(iv) Remove records of passengers who are travelling by “Rajdhani”.
35. Consider the following tables SENDER and RECIPINT. Write SQL commands for the statements (i) to
(iv).
TABLE: SENDER
SenderlD SenderName SenderAddress SenderCity
ND01 R Jain 2, ABC Appts New Delhi
MU02 H Sinha 12, Newtown Mumbai
MU15 S Jha 27/A, Park Street Mumbai
ND50 T Prasad 122-K, SDA New Delhi
Page 8 Sample Paper 05 CBSE Computer Science Class 12
TABLE: RECIPIENT
RecID SenderlD 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 Terminus Mumbai
ND48 ND50 S Tripathi 13, B1 D, Mayur Vihar New Delhi
(i) To display the names of all Senders from Mumbai.
(ii) To display the RecID, SenderName, SenderAddress, RecName, RecAddress for every Recipient.
(iii) To display Recipient details in ascending order of RecName.
(iv) To display number of Recipients from each City.
SECTION E
36. Freshminds University of India is launching its first campus in Ana Nagar, South India, with a central
admissions office in Kolkata. The campus spans 5 km and consists of three main blocks: Office, Science, and
Commerce.
As a network expert, propose a network plan addressing points (i) to (v), considering the given distances
and parameters.
Office Block 10
Science Block 140
Commerce Block 30
Kolkata Admission Office 8
NODIA APP Sample Paper 05 Page 9
(i) Suggest the authorities, the cable layout amongst various blocks inside university campus for connecting
the blocks.
(ii) Suggest the most suitable place (i.e. block) to house the server for this university with a suitable reason.
(iii) Suggest an efficient device from the following to be installed in each of the block to connect all the
computers.
(a) Modem
(b) Switch
(c) Gateway
(iv) Suggest a suitable topology to connect the computers in each building.
(v) University is planning to connect its campus in Kolkata which is more than 100 km. Which type of
network will be formed?
EN
NODIA APP Sample Paper 06 Page 1
General Instructions:
1. This question paper contains 37 questions.
2. All questions are compulsory. However, internal choices have been provided in some questions. Attempt
only one of the choices in such questions
3. The paper is divided into 5 Sections- A, B, C, D and E.
4. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
5. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
7. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
8. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
10. In case of MCQ, text of the correct answer should also be written.
SECTION A
1. State if the following statement is True or False:
In Python, using the with open(...) as f: syntax for file handling ensures that the file is automatically closed
even if an error occurs within the with block.
4. In SQL, what is the term for giving a temporary name to a table or a column in a table for the purpose of
a particular query?
(A) Renaming (B) Aliasing
(C) Referencing (D) Nicknaming
Page 2 Sample Paper 06 CBSE Computer Science Class 12
8. A user wants to display customer names and their corresponding hotel names from two tables, Customers
and Hotels. The query fails.
SELECT [Link], [Link] FROM Customers C JOIN Hotels H WHERE [Link] =
[Link];
What is the most likely error in this SQL join syntax?
(A) The WHERE clause should be an ON clause.
(B) JOIN should be INNER JOIN.
(C) Table aliases C and H cannot be used.
(D) The SELECT statement is incorrect.
10. A stack is implemented using a list. What will be the final content of the stack after these operations:
push(10), push(20), pop(), push(30), pop(), push(40)?
(A) [10, 40] (B) [40]
(C) [10, 20, 30, 40] (D) [10, 30]
13. Which of the following is a Data Control Language (DCL) command in SQL used to give users permissions
to the database?
(A) ALLOW (B) COMMIT
(C) GRANT (D) SECURE
15. Which of the following best describes a Candidate Key in a relational database?
(A) A key used to link two tables together.
(B) An attribute that can be left NULL.
(C) A minimal set of attributes that can uniquely identify a record.
(D) The primary key of another table.
16. Which SQL command is used to view the structure of a table, including its columns, data types, and
constraints?
17. Which protocol provides a command-line interface for communication with a remote device or server, but is
considered insecure because it transmits data, including passwords, in plaintext?
(A) SSH (B) HTTPS
(C) FTP (D) TELNET
18. Which network device is used to regenerate a signal to extend the distance over which data can travel on
a network?
(A) Switch (B) Hub
(C) Repeater (D) Router
Page 4 Sample Paper 06 CBSE Computer Science Class 12
19. What does HTML stand for, which is the standard markup language for documents designed to be displayed
in a web browser?
(A) Hyper Text Markup Language
(B) High Tech Modern Language
(C) Hyperlink and Text Markup Language
(D) Home Tool Markup Language
21. Assertion (A): The ORDER BY clause in SQL sorts the result set in ascending order by default.
Reason (R): The ASC keyword is used to specify ascending order, while the DESC keyword specifies
descending order.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
SECTION B
22. Observe the code given below and find the output.
s=“OceanView”
print(s[8] +s[2:] +str(len(s)))
SECTION C
29. The binary file “[Link]” contains student records with the following structure:
30. Write the Push operation of stack containing person names. Notice that the name should only accept
characters, spaces and period(.) except digits. Assume that Pname is a class instance attribute.
o
Find the final contents of a stack that encounters the following tokens.
Assume that an operand is pushed to stack and a binary operator pops two operands from stack and pushes
the result to the stack.
45, 30, + , 50, 80, +, +
31. Write user defined functions factors(num) and factorial(num) to find the factors and factorial of a number
accepted from the user and passed to the functions from main function.
o
Riya wrote a program to search any string in text file “school”. Help her to execute the program successfully.
def check () :
datafile = open (.....)
found = input (“Enter any string to
be searched : ”)
f = False
for line in ....... :
if found in line :
Page 6 Sample Paper 06 CBSE Computer Science Class 12
f = .......
break
return f
f = check ()
if (f = =.......) :
print (“True”)
else :
print (......)
(i) Riya should open which file to search any string?
(ii) Which value will assign to f in Line 7?
(iii) Fill the blank in Line 5.
SECTION E
32. (a) Underline the errors in the following code and write the correct code :
while s>0
if a%2=0
print(a%2)
elseif a%3=0 then
print(a%3)
(b) What is database connectivity? How to create a connection object?
o
(a) Differentiate between identifier and keyword.
(b) What conditions or terms are included by BD-API?
Table : Hotel
T Id C Name Roomld DtofArrival Charges
T1 Ritesh R1 2016-09-09 1800
T2 Sumana R2 2020-08-01 2000
T3 Abhi R3 1995-04-05 3000
T4 Ram R1 1994-02-02 2500
T5 Nitin R2 NULL 7000
Table : Room
Room lD Room Type F Loor
R1 AC First
R2 Deluxe Second
R3 General Second
With respect to the tables given above, write SQL commands for the following.
(i) Create the table hotel and insert the 1st record
(ii) Display the details of customers who have arrived after 01-05-2005
(iii) Display names and room types of customers whose charges are between 2000 and 3000.
(iv) Display Names of customers who are staying in “AC” rooms”
NODIA APP Sample Paper 06 Page 7
34. Write the SQL commands for (i) to (iv) on the basis of the table HOSPITAL
TABLE: HOSPITAL
S. No Name Age Department Date-ofadm Cha-rges Sex
1 Sandeep 65 Surgery 23/02/98 300 M
2 Ravine 24 Orthopaedic 20/01/98 200 F
3 Karan 45 Orthopaedic 19/02/98 200 M
4 Tarun 12 Surgery 01/01/98 300 M
5 Zubin 36 ENT 12/01/98 250 M
6 Ketaki 16 ENT 24/02/98 300 F
7 Ankita 29 Cardiology 20/02/98 800 F
8 Zareen 45 Gynaecology 22/02/98 300 F
9 Kush 19 Cardiology 13/01/98 800 M
10 Shailya 31 Nuclear Medicine 19/02/98 400 M
(i) To show all information about the patients of Cardiology Department.
(ii) To list the name of female patients, who are in Orthopaedic Department.
(iii) To list names of all patients with their date of admission in ascending order.
(iv) To display Patient’s Name, Charges, Age for male patients only.
o
Write the command to view all the tables in database.
SECTION E
36. Consider the following table Cab :
Table : Cab
CablD CabType Nop Rate
Cb1 Sedan 4 40
Cb2 Yellow Taxi 5 25
Cb3 Mini 3 30
Cb4 Micro 2 20
(i) Which column can serve as the primary key?
(ii) Write a command to display the fields of the table along with their types and sizes.
Page 8 Sample Paper 06 CBSE Computer Science Class 12
37. Quick Learn University is establishing its academic blocks in Prayag Nagar and planning to set up a
network. The university includes three academic blocks and a human resources center, as illustrated in the
diagram below.
Law Block 15
Technology Block 40
HR Centre 115
Business Block 25
(i) Suggest the most suitable place (i.e. block/Centre) to install the server of this university with a suitable
reason.
(ii) Suggest an ideal layout for connecting these block/Centre for a wired connectivity.
(iii) Which device you will suggest to be placed/installed in each of these blocks/Centre to efficiently
connect all the computers with in these blocks/Centre ?
(iv) The university is planning to connect its admission office in the closest big city, which is more than 250
km from university, which type of network out of LAN, MAN or WAN will be formed? Justify your
answer.
(v) Expand the following
LAN
WAN
EN
NODIA APP Sample Paper 07 Page 1
General Instructions:
1. This question paper contains 37 questions.
2. All questions are compulsory. However, internal choices have been provided in some questions. Attempt
only one of the choices in such questions
3. The paper is divided into 5 Sections- A, B, C, D and E.
4. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
5. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
7. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
8. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
10. In case of MCQ, text of the correct answer should also be written.
SECTION A
1. State if the following statement is True or False:
In Python’s binary file handling, the seek() method is used to change the position of the file handle (or
cursor) to a specified location within the file.
4. In SQL, which keyword is used in a SELECT statement to return only unique values from a specified
column?
(A) UNIQUE (B) DISTINCT
(C) DIFFERENT (D) SINGLE
8. A user tries to insert a new record into the Employees table which has three columns: EID, Name, Salary.
The query fails.
INSERT INTO Employees VALUES (101, ‘Ravi’);
What is the most likely reason for the failure?
(A) String values should not be in quotes.
(B) The number of values does not match the number of columns.
(C) INSERT INTO should be INSERT.
(D) Table name should be in quotes.
13. Which of the following SQL queries will count the number of unique departments in the Employee table?
(A) SELECT COUNT(Department) FROM Employee;
(B) SELECT UNIQUE(Department) FROM Employee;
(C) SELECT COUNT(DISTINCT Department) FROM Employee;
(D) SELECT DISTINCT(COUNT(Department)) FROM Employee;
16. Which SQL command is used to delete an entire database, including all its tables, indexes, and other
objects?
(A) DELETE DATABASE (B) DROP DATABASE
(C) REMOVE DATABASE (D) ERASE DATABASE
17. Which protocol is used by email clients to retrieve emails from a mail server, and generally removes the
email from the server after it has been downloaded to the client?
(A) SMTP (B) HTTP
(C) POP3 (D) FTP
18. Which network device is more intelligent than a hub and forwards data packets only to the specific port of
the intended recipient, using the MAC address?
(A) Modem (B) Repeater
(C) Router (D) Switch
19. What is the term for a computer or system that hosts websites, storing their files (HTML, CSS, images) and
delivering them to users’ web browsers upon request?
(A) Web Browser (B) Web Host
(C) Web Client (D) Web Server
20. Assertion (A): In Python, when a mutable object like a list is passed to a function, modifications made to
the object inside the function are visible outside the function.
Reason (R): Python passes arguments by assignment (pass-by-object-reference), meaning the function
parameter becomes a new reference to the exact same object.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
Page 4 Sample Paper 07 CBSE Computer Science Class 12
21. Assertion (A): The TRUNCATE command in SQL is faster than the DELETE command for removing all
rows from a table.
Reason (R): TRUNCATE is a DML command, whereas DELETE is a DDL command.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
SECTION B
22. Examine the code provided below and determine the output:
s = “oceanview”
count = 0
for a in s:
if a in “stuv”:
count += 1
print(count)
24. Provide a detailed explanation of a database and a Database Management System (DBMS).
o
Write function names for the following with respect to strings.
(i) To make the first letter of a string in capital
(ii) To find the index of the 1st occurrence of a string in another
SECTION C
29. Write a Python program to open a binary file named “[Link],” which contains student records with
the structure:
Roll Name SemPercentage
The program should display only the records of students whose percentage is above 30.
o
Create a method countopen() to count and display the number of lines that start with the word “OPEN”
(case-insensitive) in a text file named “[Link]”.
For example, if “[Link]” contains the following lines:
Get the data value to be deleted,
Open the file for reading from it.
Read the complete file into a list
Delete the data from the list
Open the file
Open same file for writing into it
Write the modified list into file.
Close the file.
The method should display
Total lines started with word ‘OPEN’ is/are: 3
30. Describe the traversal operation in a stack and provide the algorithm for traversing a stack to display its
contents. There is no need to write the actual code.
o
Find the final contents of a stack that encounters the following tokens.
Assume that an operand is pushed to stack and a binary operator pops two operands from stack and pushes
the result to the stack.
7,11,*,80,+,50,+
31. Write a user-defined function that accepts a string and checks whether it is a palindrome (a string that reads
the same forwards and backwards).
o
A program in python to modify records of a binary file “[Link]” using random access. The program would
accept the room id , search the record by random access and display. It will then accept the new data and
modify the file.
The file structure is :
Roomld Customer Name Days
import pickle
1st=[]
f=open(“[Link]”, “rb+”)
ans=‘y’
Page 6 Sample Paper 07 CBSE Computer Science Class 12
while ans==‘y’:
r=int(input(“Enter roomid to
modify :”))
1st=[Link](f)
size=[Link]()
[Link](0)
[Link]((r-1)*size)
1st=[Link](f)
print(“old record ”)
print(“Room Id :”, 1st[0])
print(“Customer :”, 1st[1])
print(“Days :”, 1st[2])
[Link](0)
... ... ... # Statement 1
print(“Enter new record ”)
nm=input(“Enter, customer name
:”)
days=input(“Enter days :”)
rs=str(r)
1st=[rs,nm,days]
[Link](1st,f)
ans=input(“Modify another(y/n)”)
[Link]()
(i) What type of data is returned by the load() method?
(ii) Which method closes a binary file?
(iii) What will be inserted in statement 1?
SECTION D
32. (a) Underline the errors in the following code and write the correct code:
s= WelcometoCS”
For a IN s :
If a IN “aeiou” :
print(a)
else
print(“False”)
(b) Write a code in Python to update the class of a student to 12 whose roll number is 22. The table
structure is as follows :
RollNo Name Class Perc
Note :
Database : PythonDB
Table : Student
Host : localhost
UserId : root
Password : Nodia
o
(a) Write the output of the following function
def showOutput( ):
num=4 + float(7)/int(2.0)
print(“num =”, num)
NODIA APP Sample Paper 07 Page 7
(b) Write a code in Python to delete the record of a student whose rollno is 33. The table structure is as
follows
RollNo Name Class Perc
Note :
Database : PythonDB
Table : Student
Host : localhost
UserId : root
Password : Nodia
Table : PERSON
P_Id Last_Name First_Name City
1 Sharma Abhay Mumbai
2 Gupta Mohan Delhi
3 Verma Akhil Mumbai
Table : ORDERS
O_Id Order_No P_Id
1 10050 3
2 25000 3
3 5687 1
4 45000 1
5 35000 15
With respect to the tables given above write a command to display the Lastname, Firstname and
corresponding order number arranged by Lastname.
(b) With respect to the table PAYMENTS given below, write, output of the following questions.
TABLE : PAYMENTS
Empld Emp_Name Salary Department
1 Ridhi 20000 D1
2 Rohit 25000 D2
3 Rakesh 20000 D2
4 Roshan 44000 D1
5 Rohini 15000 D3
6 Radha 14000 D1
(i) To display the average of employees salary from PAYMENTS table.
(ii) To count the total number of employees from PAYMENTS table Department wise
(iii) To count distinct values of column Department from PAYMENTS table.
(iv) To display department wise number of employees , but for only those departments where number of
employees are more than 2.
Page 8 Sample Paper 07 CBSE Computer Science Class 12
34. Write SQL commands from (i) to (iv) on the basis of the table INTERIORS given below
TABLE : INTERIORS
No ITEMNAME TYPE DATEOF-STOCK PRICE DISC-OUNT
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
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/03 7000 10
(i) To show all information about the Sofa from the INTERIORS table.
(ii) To list the ITEMNAME, which are priced at more than 10000 from the INTERIORS table.
(iii) To list ITEMNAME and TYPE of those items, in which DATEOFSTOCK is before 22/01/02 from the
INTERIORS table in descending order of ITEMNAME.
(iv) To insert a new row in the INTERIORS table with the following data
{14, ‘TrueIndian’, ‘Office Table’, ‘25/03/03’, 15000, 20}
o
Write the command to display the sum of prices of items of type “cot”.
35. What is the purpose of the writerows() function for handling CSV files?
A binary file named “[Link]” stores hotel customer details with the following structure:
Roomld CustomerName Days
Write a program in python for adding and displaying records from the binary file using following functions
(a) Reserve() : To add data of customers to the binary file.
(b) ShowReservations() : To open the file “[Link]” and display all the records.
SECTION E
36. Tech Up Corporation (TUC) is a professional consultancy firm planning to establish new offices in India, with
Hyderabad as its central hub. As their network consultant, you are tasked with assessing their requirements
and recommending optimal solutions. Their queries are listed below from (i) to (v).
Physical locations of TUC’s blocks:
NODIA APP Sample Paper 07 Page 9
General Instructions:
1. This question paper contains 37 questions.
2. All questions are compulsory. However, internal choices have been provided in some questions. Attempt
only one of the choices in such questions
3. The paper is divided into 5 Sections- A, B, C, D and E.
4. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
5. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
7. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
8. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
10. In case of MCQ, text of the correct answer should also be written.
SECTION A
1. State if the following statement is True or False:
A stack is a First-In, First-Out (FIFO) data structure, where the first element added is the first one to be
removed.
4. In SQL, what is the main difference between the CHAR(n) and VARCHAR(n) data types?
(A) CHAR is for numbers, VARCHAR is for text.
(B) CHAR stores variable-length strings, VARCHAR stores fixed-length strings.
(C) CHAR stores fixed-length strings, VARCHAR stores variable-length strings.
(D) CHAR is limited to 10 characters, VARCHAR is not.
Page 2 Sample Paper 08 CBSE Computer Science Class 12
5. What will be the output of the following Python code? (Assuming Python 3.7+ where dictionary order is
preserved)
D = {‘x’: 1, ‘y’: 2, ‘z’: 3}
k, v = [Link]()
print(k, v)
8. A user wants to sort the Products table by Price in descending order but receives a syntax error.
SELECT FROM Products ORDER BY DESC Price;
Identify the error and provide the corrected query.
(A) SELECT ALL FROM Products ORDER BY Price DESC;
(B) SELECT FROM Products SORT BY Price DESC;
(C) SELECT FROM Products ORDER BY Price DESC;
(D) SELECT FROM Products ORDER Price BY DESC;
10. What is the result of list1 after the following Python code is executed?
list1 = [1, 2]
list2 = [3, 4]
[Link](list2)
(A) [1, 2, [3, 4]] (B) [[1, 2], [3, 4]]
(C) [1, 2, 3, 4] (D) None
13. Which SQL aggregate function is used to calculate the average value of a numeric column?
(A) MEAN() (B) AVERAGE()
(C) CALC() (D) AVG()
16. In SQL, which clause is used with ALTER TABLE to change the data type of an existing column?
(A) CHANGE COLUMN (B) UPDATE COLUMN
(C) MODIFY COLUMN (D) SET COLUMN
17. Which protocol forms the foundation of data communication for the World Wide Web, defining how messages
are formatted and transmitted?
(A) FTP (B) SMTP
(C) HTTP (D) TCP/IP
18. Which network topology connects all devices to a single central cable, or “backbone,” and is now largely
obsolete due to its single point of failure?
(A) Star (B) Ring
(C) Tree (D) Bus
20. Assertion (A): In Python, [Link]() reads the entire file into memory and returns its contents as a list
of strings.
Reason (R): For very large files, using [Link]() in a loop is more memory-efficient than [Link]().
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
Page 4 Sample Paper 08 CBSE Computer Science Class 12
21. Assertion (A): A Primary Key in a table must contain unique values for each row.
Reason (R): A Primary Key also cannot contain any NULL values.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
SECTION B
22. Determine the output for the following Python expressions:
(i) ‘amazing’.center(15, ‘#’)
(ii) ‘python123’.isalnum()
Keys Values
A One
B Two
C Three
D Four
SECTION C
29. Write a method Filterwords() to find and display words from the text file [Link] that have a length
of less than 4 characters.
o
Write a method countAN() that checks the number of occurrance of “A” and “N” in a text file “[Link]”.
31. Write a user-defined function patterns(n) to display the following pattern for n lines, based on the number
passed to the function. The number should be entered in the main() function..
Example :
Enter a number : 4
4
44
444
4444
Enter a number 5
5
55
555
5555
55555
Page 6 Sample Paper 08 CBSE Computer Science Class 12
o
A user defined method to open a text file “[Link]” and display count of number of ‘c’ or ‘C’ and number
of ‘e’ or ‘E’ separately.
def test():
f=open(“[Link]”)
n1=0
n2=0
while True:
1=........... //Statement
if not 1:
break
for i in 1:
if (i ==‘E’ or i ==‘e’):
n1=n1+1
elif(i==‘C’ or i==‘c’):
n2=n2+1
print(n1)
print(n2)
[Link]()
(a) Which module needs to be imported to use text file handling functions?
(b) Write the function name to close a file object.
(c) Write the code best suitable for statement as marked.
SECTION D
32. (a) Write a program to find all numbers between 200 and 300 (inclusive) that are divisible by 7 but not
multiples of 5.
(b) Consider the table Faculty whose columns’ name are
F_ID, Fname, Lname, Hire_date,
Salary, Course_name
Write the code to insert the following record into the above table.
34. (a) Consider the tables EMP and SALGRADE storing details of employees and their salaries.
Table: EMP
empno ename sal date
110 Priya 7000 11-11-2010
111 Seema 14000 15-02-2014
151 Sachin 30000 18-04-2015
142 Deepa 25000 20-05-2015
Table : SALGRADE
empno city lowsal hisal grade
110 Delhi 5000 10000 2
111 NCR 11000 13000 1
142 Meerut 10000 20000 5
With respect to the tables given above write a command to display the Employee names and the corresponding
cities.
(b) With respect to the tables given above , write commands for the following :
(i) To display the average salaries of all employees who are not from Delhi.
(ii) To display, maximum salary from the EMP table among employees whose date is after “2014”
(iii) To find the count of employees who are from “Delhi”
(iv) To display each employee’s name and Grade.
TABLE: BOOKS
Book_Id Book Name Author_Name Publishers Price Type Qty
F0001 The Tears William Hopkins First Publ 750 Fiction 10
F0002 Thunder bolts Anna Roberts First Publ 700 Fiction 5
T0001 My First C++ Brain & Brooke EPB 250 Text 10
T0002 C++ Brainworks A.W. Rossaine TDH 325 Text 5
C0001 Fast Cook Lata Kapoor EPB 350 Cookery 8
Page 8 Sample Paper 08 CBSE Computer Science Class 12
TABLE : ISSUED
Book_Id Quantity_Issued
F0001 3
T0001 1
C0001 5
(i) To show Book name, Author name and Price of books of EPB Publishers.
(ii) To list the names from books of Fiction type.
(iii) To display the names and price of the books in descending order of their price.
(iv) To increase the price of all books of First Publ Publishers by 50.
o
Write the command to remove all the records of the BOOKS table keeping the structure.
SECTION E
36. G.R.K International Inc. is planning to connect its Bengaluru Office Setup with its Head Office in Delhi.
The Bengaluru Office G.R.K. International Inc. is spread across an area of approx. 1 square kilometres
consisting of 3 blocks. Human Resources, Academics and Administration. You as a network expert have to
suggest answers to the questions (i) to (v) raised by them.
Note Keep the distances 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 the placement of switch.
(iv) Suggest the most suitable media to provide secure, fast and reliable data connectivity between Delhi
Head Office and the Bengaluru Office Setup.
(v) Expand the following
(i) WAN
(ii) LAN
EN
NODIA APP Sample Paper 09 Page 1
General Instructions:
1. This question paper contains 37 questions.
2. All questions are compulsory. However, internal choices have been provided in some questions. Attempt
only one of the choices in such questions
3. The paper is divided into 5 Sections- A, B, C, D and E.
4. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
5. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
7. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
8. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
10. In case of MCQ, text of the correct answer should also be written.
SECTION A
1. State if the following statement is True or False:
In Python’s csv module, the writerow() method takes a single list (or iterable) as an argument to write one
row, while writerows() takes a list of lists (or iterables) to write multiple rows.
4. In SQL, which wildcard character used with the LIKE operator matches any single character?
(A) % (percent) (B) (asterisk)
(C) ? (question mark) (D) _ (underscore)
Page 2 Sample Paper 09 CBSE Computer Science Class 12
8. A user is trying to find departments with an average salary greater than 50000. The query fails.
SELECT Department, AVG(Salary) FROM Employees HAVING AVG(Salary) > 50000;
What is missing from this query?
(A) A WHERE clause (B) A GROUP BY clause
(C) The table name in the HAVING clause (D) An ORDER BY clause
13. Which SQL aggregate function is used to find the highest value in a set of values?
(A) HIGHEST() (B) TOP()
(C) MAX() (D) UPPER()
15. In a relational table, what does the term ‘Degree’ refer to?
(A) The number of rows in the table. (B) The number of columns in the table.
(C) The number of tables in the database. (D) The number of primary keys.
16. Which SQL command is used to remove rows from a table based on a condition?
(A) DROP (B) ERASE
(C) REMOVE (D) DELETE
17. What is the name of the suite of communication protocols used to connect network devices on the internet,
which is also the foundational protocol of the Internet?
(A) HTTP/HTTPS (B) FTP/SMTP
(C) TCP/IP (D) PPP/POP3
18. Which network device connects different networks together and acts as a single entry and exit point for all
network traffic between them, often translating protocols?
(A) Hub (B) Switch
(C) Repeater (D) Gateway
19. What is the difference between a static website and a dynamic website?
(A) Static sites use HTML/CSS, dynamic sites use images/video.
(B) Static sites are fixed, dynamic sites change content based on user interaction.
(C) Static sites are hosted for free, dynamic sites require payment.
(D) Static sites are slow, dynamic sites are fast.
Page 4 Sample Paper 09 CBSE Computer Science Class 12
21. Assertion (A): The WHERE clause in an SQL query is used to filter rows before any groupings are made.
Reason (R): The HAVING clause is used to filter groups after they have been created by a GROUP BY
clause.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
SECTION B
22. Find the output of the following code :
i = 1
while(i < 5):
print(i)
i = i * 2
25. Explain the UPDATE command in SQL, including its basic syntax and an example.
SECTION C
29. Write a Python function that accepts a sentence and counts the occurrences of the words “is” and “was”.
Example
Input: “It is what it is. The situation was complex and still is.”
Output:
Number of “is”: 3
Number of “was”: 1
o
Write a definition of a function that takes input a sentence and display the list of words that start with a
lowercase vowel and list of words that start with a uppercase vowel separately.
Example
Input : A quick black elephant enters Into a jungle.
Output
List of words starting with lowercase vowels [‘elephant’, ‘enters’, ‘a’]
List of words starting with uppercase vowels [‘A’, ‘Into’]
30. How can you create a Python function to repeatedly accept person names and add them to a list, ensuring
that each name only contains letters, spaces, and periods (.) without any digits?
o
Find the final contents of a stack that encounters the following tokens.
Assume that an operand is pushed to stack and a binary operator pops two operands from stack and pushes
the result to the stack.
100,8,3,*,50,2,+,+,*
31. Write a program that calculates the sum and mean of a series of numbers entered by the user.
o
A user-defined method to open a text file “[Link]” and write its contents to another file fter removing the
3rd line
Page 6 Sample Paper 09 CBSE Computer Science Class 12
def Func():
with open (‘[Link]’, ‘r’) as f:
l=[Link]()
[Link]()
print(l)
del l[3]
print(l)
f=open (‘[Link]’, ‘w’)
f...........
[Link]()
(a) Which module needs to be imported to use operating system functions like rename() and remove().
(b) Write the function name to open a text file.
(c) Fill the blank as marked in above code.
SECTION D
32. (a) Write a Python program to find maximum and minimum elements in a tuple.
(b) Consider the table MobileStock with following fields
M_Id, M_Name, M_Qty, M_Supplier
Write the Python code to fetch all records with fields M_Id, M_Name and M_Supplier from database
Mobile.
o
(a) Which of the following are invalid names and why?
(i) Paidlnterest
(ii) S-num
(iii) Percent
(iv) 123
(b) Write the steps for Database connectivity with short explanation of each step.
TABLE : PRODUCT
PID ProductName Manufacturer Price
TP01 Powder LAK 40
FW05 Face Cleaner ABC 45
BS01 Liquid Soap ABC 55
SH06 Dove Shampoo XYZ 120
FW12 Face Wash XYZ 95
NODIA APP Sample Paper 09 Page 7
TABLE : CLIENT
C_ID ClientName City P_ID
01 Cosmetic Shop Delhi FW05
06 Total Health Mumbai BS01
12 Life care Delhi SH06
15 Pretty Store Delhi FW12
16 Dreams Bengaluru TP01
(a) To display the ClientName, City from table CLIENT and ProductName and Price from table PRODUCT,
with their corresponding matching P_ID.
(b) Write SQL queries for statements (i) to (iv)
(i) To display the details of those Clients, whose City is Delhi.
(ii) To display the details of products, whose Price is in the range of 50 to 100 (both values included).
(iii) To display product name and their manufacturer whose Price is more than 100.
(iv) To display client name for those whose product id is FW12.
35. Write SQL commands (i) to (iv) for the following tables :
TABLE : STUDENT
S NO NAME STREAM FEES AGE SEX AID
1 RAJAN KUMAR COMPUTER 750.00 17 M A1
2 DEEPA JENEJA COMPUTER 750.00 18 F A2
3 KESHAR MEHRA BIOLOGY 500.00 16 M A2
4 SACHIN SINGH ENG. DR 350.00 18 M A1
5 PRACHI ECONOMICS 300.00 19 F A3
6 NISHA ARORA COMPUTER 750.00 15 F A3
7 NEEL KUMAR ECONOMICS 300.00 16 M A1
8 SARIKA VASWANI BIOLOGY 500.00 15 F A1
TABLE: ADDRESS
AID City
Al Jaipur
A2 Bengaluru
A3 Delhi
(i) List the name of all the students, who have taken stream as COMPUTER.
(ii) To count the number of female students.
(iii) To display the number of students stream wise.
(iv) To display names of the students with corresponding cities.
o
Write the command to display all the tables in the database.
Page 8 Sample Paper 09 CBSE Computer Science Class 12
SECTION E
36. Expertia Professional Global (EPG) is an online corporate training provider specializing in IT-related
courses. The company is establishing a new campus in Mumbai, and as a network expert, you are tasked
with analyzing the physical layout of various buildings and determining the optimal number of computers
to be installed in each location. During the planning phase, you must provide the most effective solutions
for the queries (i) to (v) that have been raised by the company..
Physical locations of the buildings of EPG
From To Distance
Administrative Building Finance Building 60
Administrative Building Faculty Studio Building 120
Finance Building Faculty Studio Building 70
Expected computers to be installed in each building
Buildings Computers
Administrative Building 20
Finance Building 40
Faculty Studio Building 120
(i) Suggest the most appropriate building, where EPG should plan to install the server.
(ii) Suggest the most appropriate building to building cable layout to connect all three buildings for efficient
communication.
(iii) Which type of network out of the following is formed by connection the computers of these three
buildings?
(a) LAN (b) MAN (c) WAN
(iv) Write the difference between LAN and MAN.
(v) Expand the following
(a) WAN (b) MAN
NODIA APP Sample Paper 09 Page 9
TABLE : ORDERS
O_Id OrderDate OrderPrice Customer
1 2008/11/12 1000 Hansen
2 2008/10/23 1600 Nilsen
3 2008/09/02 700 Hansen
4 2008/09/03 300 Hansen
5 2008/08/30 2000 Jensen
6 2008/10/04 100 Nilsen
(i) Write a statement to create the above table.
(ii) Write a command to change the width of Customer column to varchar(30)
(iii) Write statements to :
(a) Display the field names, their type , size and constraints .
(b) Display details of orders where orderprice is in the range 500 to 1500
(Option for part iii only)
o
(a) Write a command to increase orderprice of all orders by 15%.
(b) Name the constraint that will restrict both NULL and DUPLICATE values in the O_Id field.
EN
NODIA APP Sample Paper 10 Page 1
General Instructions:
1. This question paper contains 37 questions.
2. All questions are compulsory. However, internal choices have been provided in some questions. Attempt
only one of the choices in such questions
3. The paper is divided into 5 Sections- A, B, C, D and E.
4. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
5. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
7. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
8. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
10. In case of MCQ, text of the correct answer should also be written.
SECTION A
1. State if the following statement is True or False:
In a Python function call, positional arguments must always be specified before any keyword arguments.
4. In SQL, which constraint is used to uniquely identify each record in a database table and cannot contain
NULL values?
(A) UNIQUE (B) FOREIGN KEY
(C) PRIMARY KEY (D) NOT NULL
8. A user wants to change the city of a customer with ID = 10 to ‘Mumbai’ but the query fails.
UPDATE Customers City = ‘Mumbai’ WHERE ID = 10;
Identify the error and provide the corrected query.
(A) UPDATE Customers SET City = ‘Mumbai’ WHERE ID = 10;
(B) MODIFY Customers SET City = ‘Mumbai’ WHERE ID = 10;
(C) UPDATE Customers SET City TO ‘Mumbai’ WHERE ID = 10;
(D) UPDATE Customers WHERE ID = 10 SET City = ‘Mumbai’;
10. What is the primary difference between a list’s pop(i) and remove(x) methods in Python?
(A) pop removes an item by value, remove by index.
(B) pop removes an item by index, remove by value.
(C) pop can only remove from the end, remove from anywhere.
(D) They are identical in function.
13. Which SQL aggregate function is used to get the total sum of a numeric column?
(A) TOTAL() (B) ADD()
(C) SUM() (D) COUNT()
15. In a relational table, what does the term ‘Cardinality’ refer to?
(A) The number of tables in the database.
(B) The number of columns in the table.
(C) The number of rows in the table.
(D) The amount of memory used by the table.
16. Which SQL statement is used to add a FOREIGN KEY constraint to an existing table?
(A) UPDATE TABLE ... ADD FOREIGN KEY
(B) CREATE TABLE ... ADD CONSTRAINT
(C) ALTER TABLE ... ADD CONSTRAINT
(D) MODIFY TABLE ... ADD FOREIGN KEY
18. Which type of network spans a large geographical area, such as a city, country, or even across continents,
connecting multiple LANs together?
(A) PAN (Personal Area Network)
(B) LAN (Local Area Network)
(C) MAN (Metropolitan Area Network)
(D) WAN (Wide Area Network)
19. What is the role of the Domain Name System (DNS) on the internet?
(A) To assign physical MAC addresses to devices.
(B) To create the content for web pages using HTML.
(C) To translate human-readable domain names into IP addresses.
(D) To secure the connection between a browser and a server.
20. Assertion (A): To modify a global variable from inside a Python function, the global keyword must be used.
Reason (R): Without the global keyword, an assignment to a variable inside a function creates a new local
variable with the same name.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
Page 4 Sample Paper 10 CBSE Computer Science Class 12
21. Assertion (A): The VARCHAR data type in SQL is generally more space-efficient than the CHAR data type
for storing strings of varying lengths.
Reason (R): CHAR(n) always allocates a fixed space of n bytes, padding with spaces if necessary, whereas
VARCHAR(n) only uses the space required by the actual string plus a small overhead.
(A) Both A and R are True and R is the correct explanation for A.
(B) Both A and R are True and R is not the correct explanation for A.
(C) A is True but R is False.
(D) A is False but R is True.
SECTION B
22. Write the corresponding Python expression for the following mathematical expression.
a
(i) z = a + b – d2
(ii) z = x2 + y 3
23. (a) Identify which of the following identifiers are valid. If any are invalid, provide the reason..
(i) name_1
(ii) _SUM
(iii) $Sum
(iv) num ^ 2
(b) Find the output of the following code
i=1
while (i<4):
print(i)
i=i*2
24. Mr. GopiNath, Associate Manager of Unit Nations corporate, recently discovered that the communication
between his company’s accounts office and HR office is extremely slow, and signals drop quite frequently.
These offices are 120 meters apart and connected by an Ethernet cable.
(i) Suggest him a device which can be installed in between the office for smooth communication.
(ii) What type of network is formed by having this kind of connectivity out of LAN, MAN and WAN?
o
Define hub and write its functions and types.
25. Differentiate between char(n) and varchar(n) data types with respect to databases.
26. (a) Mention any two advantages of E-mail over conventional, mail.
(b) Mr. Lal owns a factory which manufactures automobile spare parts. Suggest him the advantages of
having a web page for his factory
SECTION C
29. Write a method countFile() that counts and displays the number of lines starting with the word “FILE”
(considering both lowercase and uppercase) in the text file “[Link]”.
e.g. If the file “[Link]” contains the following lines:
Get the data value to be deleted,
Open the file for reading from it.
Read the complete file into a list
Delete the data from the list
Open the file
Open same file for writing into it
Write the modified list into file.
Close the file.
The method should display
Total lines started with word ‘FILE’ is/are: 0
o
Define a function that takes a sentence as input and displays a list of words that end with a lowercase vowel
and a list of words that end with a lowercase consonant.
30. Write the Push operation for a stack that stores person names. Ensure that the names only accept characters,
spaces, and periods (.), excluding digits. Assume that Pname is an instance attribute of the class.
o
Determine the final contents of a stack that processes the following tokens. Assume that an operand is
pushed onto the stack, and a binary operator pops two operands from the stack, performs the operation,
and then pushes the result back onto the stack..
(100, 8, 3, *, 50, 2, +, +, *)
31. Write a program that counts how often each element appears in a list provided by the user.
o
A user-defined method to open the text file “[Link]” and display the lines that contain an even number
of words.
def evenwords():
f=open(“[Link]”)
ln=[Link]()
for line in ln:
linex=............// Statement
if len(linex)%2==0:
print(line)
[Link]()
(a) How is readline() method different from readlines() method in Python?
(b) Write the use of the reader object in csv file operations.
(c) Fill the blank as marked statement.
Page 6 Sample Paper 10 CBSE Computer Science Class 12
SECTION D
32. (a) Write a Python program to merge the following dictionaries into a new one:
d1 = {‘X’: 15, ‘Y’: 25}
d2 = {‘Z’: 35, ‘W’: 45}
d3 = {‘P’: 55, ‘Q’: 65}
(b) Consider the table MobileStock with following fields
M_Id, M_Name, M_Qty, M_Supplier
Write the Python code to fetch all records with fields M_Id, M_Name and M_Supplier from database
Mobile.
o
(a) Sohan has a list containing 8 integers as marks of subject Science. You need to help him to create a
program with separate user defined function to perform the following operations based on the list.
(i) Push those marks into a stack which are greater than 75.
(ii) Pop and display the content of the stack.
Simple Input
Marks = [75, 80, 56, 90, 45, 62, 76, 72]
Sample Output
80 90 76
(b) Consider the following table Traders with following fields
Table : OCCUPATION
Occupationld Type
O1 Service
O2 Business
O3 Mixed
(a) To display Family name , corresponding occupation and income where male members are more than 2.
(b) Write SQL queries for statements (i) to (iv) based on tables FAMILY and Occupation.
(i) To select all the information of family, whose Occupation is Service.
(ii) To list the name of family, where female members are more than 3.
(iii) To list all names of family with income in ascending order.
(iv) To count the number of family, whose income is less than 10000.
35. Study the following tables DOCTOR and SALARY and write SQL commands for the questions (i) to (iv).
TABLE: DOCTOR
ID NAME DEPT SEX EXPER-IENCE
101 John ENT M 12
104 Smith ORTHOPEDIC M 5
107 George CARDIOLOGY M 10
114 Lara SKIN F 3
109 K George MEDICINE F 9
105 Johnson ORTHOPEDIC M 10
117 Lucy ENT F 3
111 Bill MEDICINE F 12
130 Morphy ORTHOPEDIC M 15
TABLE: SALARY
ID BASIC ALLOWANCE CONSULTATION
101 12000 1000 300
104 23000 2300 500
107 32000 4000 500
114 12000 5200 100
109 42000 1700 200
105 18900 1690 300
130 21700 2600 300
(i) Display NAME of all doctors who are in MEDICINE department having more than 10yrs experience
from the table DOCTOR.
(ii) Display the average salary of all doctors working in ENT department using the tables DOCTOR and
SALARY. SALARY = BASIC + ALLOWANCE.
(iii) Display the minimum ALLOWANCE of female doctors.
(iv) Display the highest consultation fee among all male doctors.
o
Write the command to change the data type of consultation to double(8,3).
Page 8 Sample Paper 10 CBSE Computer Science Class 12
SECTION E
36. Workalot Consultants are establishing a secure network for their office campus in Gurgaon to support
their daily office and web-based activities. They plan to set up connectivity between three buildings on the
campus and the head office located in Mumbai. Please answer the questions (i) to (v) after reviewing the
building positions and other details provided below.
Building GREEN 32
Building RED 150
Building BLUE 45
Head Office 10
(i) Suggest the most suitable place (i.e. building) to house the server of this organisation. Also, give a
reason to justify your suggested location.
(ii) Suggest a cable layout of connections between the buildings inside the campus.
(iii) Suggest the placement of the following devices with justification :
(a) Switch
(b) Repeater
(iv) Write the use of Modem in a network.
(v) What is the use of firewall in network?
NODIA APP Sample Paper 10 Page 9
TABLE : FLIGHTS
FL_NO STARTING ENDING NO_FLIGHT NO_STOPS
IC301 MUMBAI DELHI 8 0
IC799 BENGALURU DELHI 2 1
MC101 INDORE MUMBAI 3 0
IC302 DELHI MUMBAI 8 0
AB812 KANPUR BENGALURU 3 1
IC899 MUMBAI KOCHI 1 4
AM501 DELHI TRIVANDRUM 1 5
MU499 MUMBAI MADRAS 3 3
IC701 DELHI AHMEDABAD 4 0
(i) The command to create the table was written as :
Create table FLIGHTS( FL_NO integer, STARTING char(20), ENDING char(30), NO_FLIGHT
integer, NO_STOPS integer);
What is wrong with command ?
(ii) What is the cardinality of the table ?
(iii) Which functions will be used to :
(a) Display total number of flights .
(b) Display number of flights whose FL_NO starts with “IC”
(option for part (iii) only)
o
Write function names to :
(a) Show the average Number of stops.
(b) Show the maximum number of stops.
EN