← Back to Hub
Computer Science XII · Board Papers 2025, 2024, 2023, 2022, 2020

Previous Year Questions

150 questions from CBSE board papers (2020–2025) with answers and explanations.

Q1MCQ1 markPython Fundamentals
State True or False: "A Python List must always contain all its elements of same data type."
True
False
Q2MCQ1 markPython Fundamentals
What will be the output of the following statement?
print(14%3**2*4)
(A) 16
(B) 64
(C) 20
(D) 256
Q3MCQ1 markPython Fundamentals
Identify the correct output of the following code snippet:
game="Olympic2024"
print(game.index("C"))
(A) 0
(B) 6
(C) -1
(D) ValueError
Q4MCQ1 markPython Fundamentals
Which of the following is the correct identifier?
(A) global
(B) Break
(C) def
(D) with
Q5MCQ1 markPython Fundamentals
Identify the invalid Python statement out of the following options:
(A) print("A",10,end="*")
(B) print("A",sep="*",10)
(C) print("A",10,sep="*")
(D) print("A"*10)
Q6MCQ1 markPython Fundamentals
Consider the statements given below and then choose the correct output from the given options:
L=['TIC', 'TAC']
print(L[::-1])
(A) ['CIT', 'CAT']
(B) ['TIC', 'TAC']
(C) ['CAT', 'CIT']
(D) ['TAC', 'TIC']
Q7MCQ1 markPython Fundamentals
Which of the following operator evaluates to True if the variable on either side of the operator points towards the same memory location and False otherwise?
(A) is
(B) is not
(C) and
(D) or
Q8MCQ1 markPython Fundamentals
Consider the statements given below and then choose the correct output from the given options:
D={'S01':95, 'S02':96 }
for I in D :
    print(I,end='#')
(A) S01#S02#
(B) 95#96#
(C) S01,95#S02,96#
(D) S01#95#S02#96#
Q9MCQ1 markSQL
While creating a table, which constraint does not allow insertion of duplicate values in the table?
(A) UNIQUE
(B) DISTINCT
(C) NOT NULL
(D) HAVING
Q10MCQ1 markPython Fundamentals
Consider the statements given below and then choose the correct output from the given options:
def Change(N):
    N=N+10
    print(N,end='$$')
N=15
Change(N)
print(N)
(A) 25$$15
(B) 15$$25
(C) 25$$15
(D) 2525$$
Q11MCQ1 markException Handling
Consider the statements given below and choose the correct output:
N='5'
try:
    print('WORD' + N, end='#')
except:
    print('ERROR',end='#')
finally:
    print('OVER')
(A) ERROR#
(B) WORD5#OVER
(C) WORD5#
(D) ERROR#OVER
Q12MCQ1 markPython Fundamentals
Which of the following built-in function/method returns a dictionary?
(A) dict()
(B) keys()
(C) values()
(D) items()
Q13MCQ1 markSQL
Which of the following is a DML command in SQL?
(A) UPDATE
(B) CREATE
(C) ALTER
(D) DROP
Q14MCQ1 markSQL
Which aggregate function in SQL displays the number of values in the specified column ignoring the NULL values?
(A) len()
(B) count()
(C) number()
(D) num()
Q15MCQ1 markSQL
In MYSQL, which type of value should not be enclosed within quotation marks?
(A) DATE
(B) VARCHAR
(C) FLOAT
(D) CHAR
Q16MCQ1 markSQL
State True or False: If table A has 6 rows and 3 columns, and table B has 5 rows and 2 columns, the Cartesian product of A and B will have 30 rows and 5 columns.
True
False
Q17MCQ1 markComputer Networks
Which of the following networking devices is used to regenerate and transmit the weakened signal ahead?
(A) Hub
(B) Ethernet Card
(C) Repeater
(D) Modem
Q18MCQ1 markComputer Networks
Which of the following options is the correct protocol used for phone calls over the internet?
(A) PPP
(B) FTP
(C) HTTP
(D) VoIP
Q19Short1 markComputer Networks
Expand ARPANET.
Q20MCQ1 markFile Handling
Assertion (A): For a binary file opened using 'rb' mode, the pickle.dump() method will display an error.
Reason (R): The pickle.dump() method is used to read from a binary file.
(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
Q21MCQ1 markSQL
Assertion (A): We can retrieve records from more than one table in MYSQL.
Reason (R): Foreign key is used to establish a relationship between two tables.
(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
Q22Short2 marksPython Fundamentals
What does the return statement do in a function? Explain with the help of an example.
Q23Short2 marksException Handling
Write one example of each of the following in Python:
(i) Syntax Error
(ii) Implicit Type Conversion
Q24Short2 marksPython Fundamentals
Consider the following dictionaries, D and D1:
D={"Suman": 40, "Raj":55, "Raman":60}
D1={"Aditi":30, "Amit":90,"Raj":20}
(Answer using built-in Python functions only)
(i) (a) Write a statement to display/return the value corresponding to the key "Raj" in the dictionary D.
OR
(b) Write a statement to display the length of the dictionary D1.
(ii) (a) Write a statement to append all the key-value pairs of the dictionary D to the dictionary D1.
OR
(b) Write a statement to delete the item with the given key, "Amit" from the dictionary D1.
Q25MCQ2 marksPython Fundamentals
What possible output from the given options is expected to be displayed when the following code is executed?
import random
Cards=["Heart","Spade","Club","Diamond"]
for i in range(2):
    print(Cards[random.randint(1,i+2)],end="#")
(A) Spade#Diamond#
(B) Spade#Heart#
(C) Diamond#Club#
(D) Heart#Spade#
Q26Short2 marksPython Fundamentals
The code given below accepts N as an integer argument and returns the sum of all integers from 1 to N. Observe the following code carefully and rewrite it after removing all syntax and logical errors. Underline all the corrections made.
def Sum(N)
    for I in range(N):
        S=S+I
    return S
print(Sum(10))
Q27Short2 marksSQL
Nisha is assigned the task of maintaining the staff data of an organization. She has to store the details of the staff in the SQL table named EMPLOYEES with attributes as EMPNO, NAME, DEPARTMENT, BASICSAL.
(i)(a) Help Nisha to identify the attribute which should be designated as the PRIMARY KEY. Justify your answer.
OR
(b) Help Nisha to identify the constraint which should be applied to the attribute NAME such that the Employees' Names cannot be left empty or NULL while entering the records but can have duplicate values.
(ii)(a) Write the SQL command to change the size of the attribute BASICSAL in the table EMPLOYEES to allow the maximum value of 99999.99 to be stored in it.
OR
(b) Write the SQL command to delete the table EMPLOYEES.
Q28Short2 marksComputer Networks
(a) Expand and explain the term URL.
OR
(b) Expand the term PPP. What is the use of PPP?
Q29Long3 marksFile Handling
(a) Write a Python function that displays all the lines containing the word 'vote' from a text file "Elections.txt".
OR
(b) Write a Python function that displays all the words starting and ending with a vowel from a text file "Report.txt". The consecutive words should be separated by a space in the output.
Q30Long3 marksStack
(a) A stack, named ClrStack, contains records of some colors. Each record is represented as a tuple containing four elements - ColorName, RED, GREEN, BLUE. ColorName is a string, and RED, GREEN, BLUE are integers. For example, a record in the stack may be ('Yellow', 237, 250, 68). Write the following user-defined functions in Python:
(i) push_Clr(ClrStack, new_Clr): pushes a new record onto the stack
(ii) pop_Clr(ClrStack): pops the topmost record and returns it. If empty, display "Underflow"
(iii) isEmpty(ClrStack): checks whether the stack is empty

OR

(b) Write the following user-defined functions in Python:
(i) push_trail(N, myStack): pushes the last 5 elements from list N onto stack myStack
(ii) pop_one(myStack): pops an element and returns it. If empty, display 'Stack Underflow' and return None
(iii) display_all(myStack): displays all elements without deleting. If empty, display 'Empty Stack'
Q31Long3 marksPython Fundamentals
(a) Predict the output of the following code:
def ExamOn(mystr):
    newstr = ""
    count = 0
    for i in mystr:
        if count%2 != 0:
            newstr = newstr + str(count-1)
        else:
            newstr = newstr + i.lower()
        count += 1
    newstr = newstr + mystr[:2]
    print("The new string is:", newstr)
ExamOn("GenX")
OR

(b) Write the output on execution of the following Python code:
def Change(X):
    for K,V in X.items():
        L1.append(K)
        L2.append(V)
D={1:"ONE",2:"TWO",3:"THREE"}
L1=[]
L2=[]
Change(D)
print(L1)
print(L2)
print(D)
Q32Long4 marksSQL
Suman has created a table named WORKER with columns WID, WNAME, WAGE, HOURS, TYPE, and SITEID.
(a) Based on the data, answer the following:
(i) Write the SQL statement to display the names and wages of those workers whose wages are between 800 and 1500.
(ii) Write the SQL statement to display the record of workers whose SITEID is not known.
(iii) Write the SQL statement to display WNAME, WAGE and HOURS of all those workers whose TYPE is 'Skilled'.
(iv) Write the SQL statement to change the WAGE to 1200 of the workers where the TYPE is "Semiskilled".

OR

(b) Write the output on execution of the following SQL commands:
(i) SELECT WNAME, WAGE*HOURS FROM WORKER WHERE SITEID = 103;
(ii) SELECT COUNT(DISTINCT TYPE) FROM WORKER;
(iii) SELECT MAX(WAGE), MIN(WAGE), TYPE FROM WORKER GROUP BY TYPE;
(iv) SELECT WNAME,SITEID FROM WORKER WHERE TYPE="Unskilled" ORDER BY HOURS;
Q33Long4 marksFile Handling
A csv file "P_record.csv" contains the records of patients in a hospital. Each record contains: Name of patient, Disease, Number of days patient is admitted, Amount.
For example: ["Gunjan","Jaundice",4,15000]
Write the following Python functions:
(i) read_data() which reads all the data from the file and displays the details of all the 'Cancer' patients.
(ii) count_rec() which counts and returns the number of records in the file.
Q34Long4 marksSQL
Assume that you are working in the IT Department of a Creative Art Gallery (CAG), which sells different forms of art creations like Paintings, Sculptures etc. The data of Art Creations and Artists are kept in tables Articles and Artists respectively.
Table: Articles (Code, A_Code, Article, DOC, Price)
Table: Artists (A_Code, Name, Phone, Email, DOB)
Write SQL queries for:
(i) To display all the records from the Articles table in descending order of price.
(ii) To display the details of Articles which were created in the year 2020.
(iii) To display the structure of Artists table.
(iv)(a) To display the name of all artists whose Article is Painting through Equi Join.
OR
(b) To display the name of all Artists whose Article is 'Painting' through Natural Join.
Q35Long4 marksDatabase Concepts
A table, named THEATRE, in CINEMA database, has the following structure:
Th_ID char(5), Name varchar(15), City varchar(15), Location varchar(15), Seats int
Write a function Delete_Theatre(), to input the value of Th_ID from the user and permanently delete the corresponding record from the table.
Host: localhost, User: root, Password: Ex2025
Q36Long5 marksFile Handling
A file, PASSENGERS.DAT, stores the records of passengers using the following structure:
[PNR, PName, BRDSTN, DESTN, FARE]
Write user defined functions in Python for the following tasks:
(i) Create() - to input data for passengers and write it in the binary file PASSENGERS.DAT.
(ii) SearchDestn(D) - to read contents from the file PASSENGERS.DAT and display the details of those Passengers whose DESTN matches with the value of D.
(iii) UpdateFare() - to increase the fare of all passengers by 5% and rewrite the updated records into the file PASSENGERS.DAT.
Q37Long5 marksComputer Networks
'Swabhaav' is a big NGO working in the field of Psychological Treatment and Counselling, having its Head Office in Nagpur. It is planning to set up a center in Vijayawada. The Vijayawada Center will have four blocks - ADMIN, PSYCHIATRY, PSYCHOLOGY, and ICU.
Distances: ADMIN to PSYCHIATRY 65m, ADMIN to PSYCHOLOGY 65m, ADMIN to ICU 65m, PSYCHIATRY to PSYCHOLOGY 100m, PSYCHIATRY to ICU 50m, PSYCHOLOGY to ICU 50m.
Nagpur Head Office to Vijayawada Center = 700 km.
Computers: ADMIN 16, PSYCHIATRY 40, PSYCHOLOGY 19, ICU 20.
(i) Suggest the most appropriate location of the server inside the Vijayawada Center. Justify your choice.
(ii) Which hardware device will you suggest to connect all the computers within each block?
(iii) Draw a cable layout to efficiently connect various blocks within the Vijayawada Center.
(iv) Where should the router be placed to provide internet to all the computers in the Vijayawada Center?
(v)(a) The Manager at Nagpur wants to remotely access the computer in Admin block in Vijayawada. Which protocol will be used for this?
OR
(b) Which type of Network (PAN, LAN, MAN or WAN) will be set up among the computers connected with Vijayawada Center?
Q1MCQ1 markPython Fundamentals
State True or False: While defining a function in Python, the positional parameters in the function header must always be written after the default parameters.
True
False
Q2MCQ1 markSQL
The SELECT statement when combined with _______ clause, returns records without repetition.
(a) DISTINCT
(b) DESCRIBE
(c) UNIQUE
(d) NULL
Q3MCQ1 markPython Fundamentals
What will be the output of the following statement:
print (16*5/4*2/5-8)
(a) -3.33
(b) 6.0
(c) 0.0
(d) -13.33
Q4MCQ1 markPython Fundamentals
What possible output from the given options is expected to be displayed when the following Python code is executed?
import random
Signal = ['RED', 'YELLOW', 'GREEN']
for K in range(2, 0, -1):
    R = random.randrange(K)
    print(Signal[R], end = '#')
(a) YELLOW # RED #
(b) RED # GREEN #
(c) GREEN # RED #
(d) YELLOW # GREEN #
Q5MCQ1 markSQL
In SQL, the aggregate function which will display the cardinality of the table is ______.
(a) sum()
(b) count(*)
(c) avg()
(d) sum(*)
Q6MCQ1 markComputer Networks
Which protocol out of the following is used to send and receive emails over a computer network?
(a) PPP
(b) HTTP
(c) FTP
(d) SMTP
Q7MCQ1 markPython Fundamentals
Identify the invalid Python statement from the following:
(a) d = dict()
(b) e = {}
(c) f = []
(d) g = dict{}
Q8MCQ1 markPython Fundamentals
Consider the statements given below and then choose the correct output from the given options:
myStr="MISSISSIPPI"
print(myStr[:4]+"#"+myStr[-5:])
(a) MISSI#SIPPI
(b) MISS#SIPPI
(c) MISS#IPPIS
(d) MISSI#IPPIS
Q9MCQ1 markPython Fundamentals
Identify the statement from the following which will raise an error:
(a) print("A"*3)
(b) print(5*3)
(c) print("15" + 3)
(d) print("15" + "13")
Q10MCQ1 markPython Fundamentals
Select the correct output of the following code:
event="G20 Presidency@2023"
L=event.split(' ')
print(L[::-2])
(a) 'G20'
(b) ['Presidency@2023']
(c) ['G20']
(d) 'Presidency@2023'
Q11MCQ1 markComputer Networks
Which of the following options is the correct unit of measurement for network bandwidth?
(a) KB
(b) Bit
(c) Hz
(d) Km
Q12MCQ1 markPython Fundamentals
Observe the given Python code carefully:
a=20
def convert(a):
    b=20
    a=a+b
convert(10)
print(a)
Select the correct output from the given options:
(a) 10
(b) 20
(c) 30
(d) Error
Q13MCQ1 markException Handling
State whether the following statement is True or False: While handling exceptions in Python, name of the exception has to be compulsorily added with except clause.
True
False
Q14MCQ1 markSQL
Which of the following is not a DDL command in SQL?
(a) DROP
(b) CREATE
(c) UPDATE
(d) ALTER
Q15Short1 markComputer Networks
Fill in the blank: _______ is a set of rules that needs to be followed by the communicating parties in order to have a successful and reliable data communication over a network.
Q16MCQ1 markFile Handling
Consider the following Python statement:
F=open('CONTENT.TXT')
Which of the following is an invalid statement in Python?
(a) F.seek(1,0)
(b) F.seek(0,1)
(c) F.seek(0,-1)
(d) F.seek(0,2)
Q17MCQ1 markFile Handling
Assertion (A): CSV file is a human readable text file where each line has a number of fields, separated by comma or some other delimiter.
Reason (R): writerow() method is used to write a single row in a CSV file.
(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
Q18MCQ1 markPython Fundamentals
Assertion (A): The expression "HELLO".sort() in Python will give an error.
Reason (R): sort() does not exist as a method/function for strings in Python.
(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
Q19Short2 marksComputer Networks
(A)(i) Expand the following terms: XML, PPP
(ii) Give one difference between circuit switching and packet switching.
OR
(B)(i) Define the term web hosting.
(ii) Name any two web browsers.
Q20Short2 marksPython Fundamentals
The code given below accepts five numbers and displays whether they are even or odd. Observe the following code carefully and rewrite it after removing all syntax and logical errors. Underline all the corrections made.
def EvenOdd()
    for i in range(5):
        num=int(input("Enter a number"))
        if num/2==0:
            print("Even")
        else:
        print("Odd")
EvenOdd()
Q21Short2 marksPython Fundamentals
(A) Write a user defined function in Python named showGrades(S) which takes the dictionary S as an argument. The dictionary S contains Name:[Eng,Math,Science] as key:value pairs. The function displays the corresponding grade obtained by the students according to grading rules: Average >=90: A, <90 but >=60: B, <60: C

OR

(B) Write a user defined function in Python named Puzzle(W,N) which takes the argument W as an English word and N as an integer and returns the string where every Nth alphabet of the word W is replaced with an underscore ("_").
Q22Short2 marksPython Fundamentals
Write the output displayed on execution of the following Python code:
LS=["HIMALAYA", "NILGIRI", "ALASKA", "ALPS"]
D={}
for S in LS:
    if len(S)%4 == 0:
        D[S] = len(S)
for K in D:
    print(K,D[K], sep = "#")
Q23Short2 marksPython Fundamentals
(A) Write the Python statement for each of the following tasks using built-in functions/methods only:
(i) To remove the item whose key is "NISHA" from a dictionary named Students.
(ii) To display the number of occurrences of the substring "is" in a string named message.

OR

(B) A tuple named subject stores the names of different subjects. Write the Python commands to convert the given tuple to a list and thereafter delete the last element of the list.
Q24Short2 marksSQL
(A) Ms. Veda created a table named Sports in a MySQL database, containing columns Game_id, P_Age and G_name. After creating the table, she realized that the attribute Category has to be added. Help her to write a command to add the Category column. Thereafter, write the command to insert the following record:
Game_id: G42, P_Age: Above 18, G_name: Chess, Category: Senior

OR

(B) Write the SQL commands to perform the following tasks:
(i) View the list of tables in the database, Exam.
(ii) View the structure of the table, Term1.
Q25Short2 marksPython Fundamentals
Predict the output of the following code:
def callon(b=20,a=10):
    b=b+a
    a=b-a
    print(b,"#",a)
    return b
x=100
y=200
x=callon(x,y)
print(x,"@",y)
y=callon(y)
print(x,"@",y)
Q26Long3 marksPython Fundamentals
Write the output on execution of the following Python code:
S="Racecar Car Radar"
L=S.split()
for W in L:
    x=W.upper()
    if x==x[::-1]:
        for I in x:
            print(I,end="*")
    else:
        for I in W:
            print(I,end="#")
    print()
Q27Long3 marksSQL
Consider the table ORDERS given below and write the output of the SQL queries that follow:
ORDNOITEMQTYRATEORDATE
1001RICE231202023-09-10
1002PULSES131202023-10-18
1003RICE251102023-11-17
1004WHEAT28652023-12-25
1005PULSES161102024-01-15
1006WHEAT27552024-04-15
1007WHEAT25602024-04-30

(i) SELECT ITEM, SUM(QTY) FROM ORDERS GROUP BY ITEM;
(ii) SELECT ITEM, QTY FROM ORDERS WHERE ORDATE BETWEEN '2023-11-01' AND '2023-12-31';
(iii) SELECT ORDNO, ORDATE FROM ORDERS WHERE ITEM = 'WHEAT' AND RATE>=60;
Q28Long3 marksFile Handling
(A) Write a user defined function in Python named showInLines() which reads contents of a text file named STORY.TXT and displays every sentence in a separate line. Assume that a sentence ends with a full stop (.), a question mark (?), or an exclamation mark (!).

OR

(B) Write a function, c_words() in Python that separately counts and displays the number of uppercase and lowercase alphabets in a text file, Words.txt.
Q29Long3 marksSQL
Consider the table Projects given below:
P_idPnameLanguageStartdateEnddate
P001School Management SystemPython2023-01-122023-04-03
P002Hotel Management SystemC++2022-12-012023-02-02
P003Blood BankPython2023-02-112023-03-02
P004Payroll Management SystemPython2023-03-122023-06-02

Based on the given table, write SQL queries for:
(i) Add the constraint, primary key to column P_id in the existing table Projects.
(ii) To change the language to Python of the project whose id is P002.
(iii) To delete the table Projects from MySQL database along with its data.
Q30Long3 marksStack
Consider a list named Nums which contains random integers. Write the following user defined functions in Python and perform the specified operations on a stack named BigNums.
(i) PushBig(): It checks every number from the list Nums and pushes all such numbers which have 5 or more digits into the stack, BigNums.
(ii) PopBig(): It pops the numbers from the stack, BigNums and displays them. The function should also display "Stack Empty" when there are no more numbers left in the stack.
Q31Long4 marksSQL
Consider the tables Admin and Transport given below:
Table Admin: S_idS_nameAddressS_type
S001SandhyaRohiniDay Boarder
S002VedanshiRohtakDay Scholar
S003VibhuRaj NagarNULL
S004AtharvaRampurDay Boarder

Table Transport: S_idBus_noStop_name
S002TSS10Sarai Kale Khan
S004TSS12Sainik Vihar
S005TSS10Kamla Nagar

Write SQL queries for the following:
(i) Display the student name and their stop name from the tables Admin and Transport.
(ii) Display the number of students whose S_type is not known.
(iii) Display all details of the students whose name starts with 'V'.
(iv) Display student id and address in alphabetical order of student name, from the table Admin.
Q32Long4 marksFile Handling
Sangeeta is a Python programmer working in a computer hardware company. She has to maintain the records of the peripheral devices. She created a csv file named Peripheral.csv, to store the details. The structure of Peripheral.csv is: [P_id, P_name, Price]
Sangeeta wants to write the following user defined functions:
Add_Device(): to accept a record from the user and add it to a csv file, Peripheral.csv.
Count_Device(): To count and display number of peripheral devices whose price is less than 1000.
Q33Long5 marksComputer Networks
Infotainment Ltd. is an event management company with its prime office located in Bengaluru. The company is planning to open its new division in Chennai named as - Vajra, Trishula and Sudershana.
Distances: Vajra to Trishula 350m, Trishula to Sudershana 415m, Sudershana to Vajra 300m, Bengaluru Office to Chennai 2000 km.
Computers: Vajra 120, Sudershana 75, Trishula 65, Bengaluru Office 250.
(i) Suggest and draw the cable layout to efficiently connect various locations in Chennai division.
(ii) Which block in Chennai division should host the server? Justify.
(iii) Which fast and effective wired transmission medium should be used to connect the prime office at Bengaluru with the Chennai division?
(iv) Which network device will be used to connect the digital devices within each location of Chennai division?
(v) A considerable amount of data loss is noticed between different locations of the Chennai division. Suggest a networking device that should be installed to refresh the data and reduce the data loss.
Q34Long5 marksFile Handling
(A)(i) Differentiate between 'w' and 'a' file modes in Python.
(ii) Consider a binary file, items.dat, containing records stored in the format: {item_id: [item_name, amount]}. Write a function, Copy_new(), that copies all records whose amount is greater than 1000 from items.dat to new_items.dat.

OR

(B)(i) What is the advantage of using with clause while opening a data file in Python? Also give syntax of with clause.
(ii) A binary file, EMP.DAT has the following structure: [Emp_Id, Name, Salary]. Write a user defined function, disp_Detail(), that would read the contents of the file EMP.DAT and display the details of those employees whose salary is below 25000.
Q35Long5 marksDatabase Concepts
(A)(i) Define cartesian product with respect to RDBMS.
(ii) Sunil wants to write a program in Python to update the quantity to 20 of the records whose item code is 111 in the table named shop in MySQL database named Keeper.
Username: admin, Password: Shopping, Host: localhost

OR

(B)(i) Give any two features of SQL.
(ii) Sumit wants to write a code in Python to display all the details of the passengers from the table flight in MySQL database, Travel.
Username: root, Password: airplane, Host: localhost
Q1MCQ1 markPython Fundamentals
State True or False: "Identifiers are names used to identify a variable, function in a program."
True
False
Q2MCQ1 markPython Fundamentals
Which of the following is a valid keyword in Python?
(a) false
(b) return
(c) non_local
(d) none
Q3MCQ1 markPython Fundamentals
Given the following Tuple:
Tup= (10, 20, 30, (10, 20, 30), 40)
Which of the following statements will result in an error?
(a) print(Tup[0])
(b) Tup.insert(2,3)
(c) print(Tup[1:2])
(d) print(len(Tup))
Q4MCQ1 markPython Fundamentals
Consider the given expression:
5<10 and 12>7 or not 7>4
Which of the following will be the correct output, if the given expression is evaluated?
(a) True
(b) False
(c) NONE
(d) NULL
Q5MCQ1 markPython Fundamentals
Select the correct output of the code:
S= "Amrit Mahotsav @ 75"
A=S.partition(" ")
print(A)
(a) ('Amrit Mahotsav','@','75')
(b) ['Amrit','Mahotsav','@','75']
(c) ('Amrit', 'Mahotsav @ 75')
(d) ('Amrit', ' ', 'Mahotsav @ 75')
Q6MCQ1 markFile Handling
Which of the following mode keeps the file offset position at the end of the file?
(a) r+
(b) r
(c) w
(d) a
Q7MCQ1 markPython Fundamentals
Fill in the blank: _____ function is used to arrange the elements of a list in ascending order.
(a) sort()
(b) arrange()
(c) ascending()
(d) asort()
Q8MCQ1 markPython Fundamentals
Which of the following operators will return either True or False?
(a) +=
(b) !=
(c) =
(d) *=
Q9MCQ1 markPython Fundamentals
Which of the following statement(s) would give an error after executing the following code?
Stud={"Murugan":100, "Mithu":95}  # Statement 1
print(Stud[95])                    # Statement 2
Stud["Murugan"]=99                 # Statement 3
print(Stud.pop())                  # Statement 4
print(Stud)                        # Statement 5
(a) Statement 2
(b) Statement 3
(c) Statement 4
(d) Statements 2 and 4
Q10MCQ1 markDatabase Concepts
Fill in the blank: _____ is a number of tuples in a relation.
(a) Attribute
(b) Degree
(c) Domain
(d) Cardinality
Q11MCQ1 markFile Handling
The syntax of seek() is: file_object.seek(offset[,reference_point]). What is the default value of reference_point?
(a) 0
(b) 1
(c) 2
(d) 3
Q12MCQ1 markSQL
Fill in the blank: _____ clause is used with SELECT statement to display data in a sorted form with respect to a specified column.
(a) WHERE
(b) ORDER BY
(c) HAVING
(d) DISTINCT
Q13MCQ1 markData Communication
Fill in the blank: _____ is used for point-to-point communication or unicast communication such as radar and satellite.
(a) INFRARED WAVES
(b) BLUETOOTH
(c) MICROWAVES
(d) RADIOWAVES
Q14MCQ1 markPython Fundamentals
What will the following expression be evaluated to in Python?
print(4+3*5/3-5%2)
(a) 8.5
(b) 8.0
(c) 10.2
(d) 10.0
Q15MCQ1 markPython Fundamentals
Which function returns the sum of all elements of a list?
(a) count()
(b) sum()
(c) total()
(d) add()
Q16MCQ1 markDatabase Concepts
fetchall() method fetches all rows in a result set and returns a:
(a) Tuple of lists
(b) List of tuples
(c) List of strings
(d) Tuple of strings
Q17MCQ1 markPython Fundamentals
Assertion (A): To use a function from a particular module, we need to import the module.
Reason (R): import statement can be written anywhere in the program, before using a function from that module.
(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
Q18MCQ1 markStack
Assertion (A): A stack is a LIFO structure.
Reason (R): Any new element pushed into the stack always gets positioned at the index after the last existing element in the stack.
(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
Q19Short2 marksPython Fundamentals
Atharva is a Python programmer working on a program to find and return the maximum value from the list. The code written below has syntactical errors. Rewrite the correct code and underline the corrections made.
def max_num (L) :
    max=L(0)
    for a in L :
        if a > max
        max=a
    return max
Q20Short2 marksComputer Networks
(a) Differentiate between wired and wireless transmission.
OR
(b) Differentiate between URL and domain name with the help of an appropriate example.
Q21Short2 marksPython Fundamentals
(a) Given is a Python list declaration:
Listofnames=["Aman","Ankit","Ashish","Rajan","Rajat"]
Write the output of: print(Listofnames[-1:-4:-1])

(b) Consider the following tuple declaration:
tupl=(10,20,30,(10,20,30),40)
Write the output of: print(tupl.index(20))
Q22Short2 marksDatabase Concepts
Explain the concept of "Alternate Key" in a Relational Database Management System with an appropriate example.
Q23Short2 marksComputer Networks
(a) Write the full forms of the following:
(i) HTML
(ii) TCP
(b) What is the need of Protocols?
Q24Short2 marksPython Fundamentals
(a) Write the output of the code given below:
def short_sub(lst,n):
    for i in range(0,n):
        if len(lst)>4:
            lst[i]=lst[i]+lst[i]
        else:
            lst[i]=lst[i]
subject=['CS','HINDI','PHYSICS','CHEMISTRY','MATHS']
short_sub(subject,5)
print(subject)
OR

(b) Write the output of the code given below:
a =30
def call(x):
    global a
    if a%2==0:
        x+=a
    else:
        x-=a
    return x
x=20
print(call(35),end="#")
print(call(40),end= "@")
Q25Short2 marksSQL
(a) Differentiate between CHAR and VARCHAR data types in SQL with appropriate example.
OR
(b) Name any two DDL and any two DML commands.
Q26Long3 marksSQL
(a) Consider the following tables - LOAN and BORROWER:
Table LOAN: LOAN_NOB_NAMEAMOUNT
L-170DELHI3000
L-230KANPUR4000

Table BORROWER: CUST_NAME | LOAN_NO
JOHN | L-171
KRISH | L-230
RAVYA | L-170

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

(b) Write the output of the queries (i) to (iv) based on the table WORKER:
W_IDF_NAMEL_NAMECITYSTATE
102SAHILKHANKANPURUTTAR PRADESH
104SAMEERPARIKHROOP NAGARPUNJAB
105MARYJONESDELHIDELHI
106MAHIRSHARMASONIPATHARYANA
107ATHARVABHARDWAJDELHIDELHI
108VEDASHARMAKANPURUTTAR PRADESH

(i) SELECT F_NAME, CITY FROM WORKER ORDER BY STATE DESC;
(ii) SELECT DISTINCT(CITY) FROM WORKER;
(iii) SELECT F_NAME, STATE FROM WORKER WHERE L_NAME LIKE '_HA%';
(iv) SELECT CITY,COUNT(*) FROM WORKER GROUP BY CITY;
Q27Long3 marksFile Handling
(a) Write the definition of a Python function named LongLines() which reads the contents of a text file named 'LINES.TXT' and displays those lines from the file which have at least 10 words in it.

OR

(b) Write a function count_Dwords() in Python to count the words ending with a digit in a text file "Details.txt".
Q28Long3 marksSQL
(a) Write the outputs of the SQL queries (i) to (iv) based on the relations COMPUTER and SALES given below:
Table COMPUTER: PROD_IDPROD_NAMEPRICECOMPANYTYPE
P001MOUSE200LOGITECHINPUT
P002LASER PRINTER4000CANONOUTPUT
P003KEYBOARD500LOGITECHINPUT
P004JOYSTICK1000IBALLINPUT
P005SPEAKER1200CREATIVEOUTPUT
P006DESKJET PRINTER4300CANONOUTPUT

Table SALES: PROD_IDQTY_SOLDQUARTER
P00241
P00322
P00132
P00421

(i) SELECT MIN(PRICE), MAX(PRICE) FROM COMPUTER;
(ii) SELECT COMPANY, COUNT(*) FROM COMPUTER GROUP BY COMPANY HAVING COUNT(COMPANY) > 1;
(iii) SELECT PROD_NAME, QTY_SOLD FROM COMPUTER C, SALES S WHERE C.PROD_ID=S.PROD_ID AND TYPE = 'INPUT';
(iv) SELECT PROD_NAME, COMPANY, QUARTER FROM COMPUTER C, SALES S WHERE C.PROD_ID=S.PROD_ID;

(b) Write the command to view all databases.
Q29Long3 marksPython Fundamentals
Write a function EOReplace() in Python, which accepts a list L of numbers. Thereafter, it increments all even numbers by 1 and decrements all odd numbers by 1.
Example: If L=[10,20,30,40,35,55]
Output will be: L=[11,21,31,41,34,54]
Q30Long3 marksStack
(a) A list contains following record of customer: [Customer_name, Room Type]
Write the following user defined functions to perform given operations on the stack named 'Hotel':
(i) Push_Cust() - To Push customers' names of those customers who are staying in 'Delux' Room Type.
(ii) Pop_Cust() - To Pop the names of customers from the stack and display them. Also, display "Underflow" when there are no customers in the stack.

OR

(b) Write a function in Python, Push(Vehicle) where, Vehicle is a dictionary containing details of vehicles - {Car_Name: Maker}. The function should push the name of car manufactured by 'TATA' (including all possible cases like Tata, TaTa, etc.) to the stack.
Q31Long5 marksComputer Networks
Quickdev, an IT based firm, located in Delhi is planning to set up a network for its four branches within a city with its Marketing department in Kanpur.
Branches: A, B, C, D
Distances: A to B 40m, A to C 80m, A to D 65m, B to C 30m, B to D 35m, C to D 15m, Delhi to Kanpur 300 km.
Computers: A 15, B 25, C 40, D 115.
(i) Suggest the most suitable place to install the server for the Delhi branch with a suitable reason.
(ii) Suggest an ideal layout for connecting all these branches within Delhi.
(iii) Which device will you suggest to be placed in each of these branches to efficiently connect all the computers within these branches?
(iv) Delhi firm is planning to connect to its Marketing department in Kanpur which is approximately 300 km away. Which type of network out of LAN, WAN or MAN will be formed? Justify.
(v) Suggest a protocol that shall be needed to provide help for transferring files between Delhi and Kanpur branch.
Q32Long5 marksDatabase Concepts
(a) What possible output(s) are expected to be displayed on screen at the time of execution of the following program:
import random
M=[5,10,15,20,25,30]
for i in range(1,3):
    first=random.randint(2,5)- 1
    sec=random.randint(3,6)- 2
    third=random.randint(1,4)
    print(M[first],M[sec],M[third],sep="#")
(b) The code given below deletes the record from the table employee.
Write the following statements to complete the code:
Statement 1 - to import the desired library.
Statement 2 - to execute the command that deletes the record with E_code as 'E101'.
Statement 3 - to delete the record permanently from the database.

import ____________ as mysql  # Statement 1
def delete():
    mydb=mysql.connect(host="localhost",user="root",passwd="root",database="emp")
    mycursor=mydb.cursor()
    ________________  # Statement 2
    ________________  # Statement 3
    print("Record deleted")
OR

(a) Predict the output of the code given below:
def makenew(mystr):
    newstr=""
    count=0
    for i in mystr:
        if count%2!=0:
            newstr=newstr+str(count)
        else:
            if i.lower():
                newstr=newstr+i.upper()
            else:
                newstr=newstr+i
        count+=1
    print(newstr)
makenew("No@1")
(b) The code given below reads records from the table employee and displays only those records who have employees coming from city 'Delhi'.
Statement 1 - to import the desired library.
Statement 2 - to execute the query that fetches records of employees coming from city 'Delhi'.
Statement 3 - to read the complete data of the query.

import ____________ as mysql  # Statement 1
def display():
    mydb=mysql.connect(host="localhost",user="root",passwd="root",database="emp")
    mycursor=mydb.cursor()
    ___________________________  # Statement 2
    details = __________________  # Statement 3
    for i in details:
        print(i)
Q33Long5 marksFile Handling
(a) Write one difference between CSV and text files.
Write a program in Python that defines and calls the following user defined functions:
(i) COURIER_ADD(): It takes the values from the user and adds the details to a csv file 'courier.csv'. Each record consists of a list with field elements as cid, s_name, Source, destination.
(ii) COURIER_SEARCH(): Takes the destination as the input and displays all the courier records going to that destination.

OR

(b) Why it is important to close a file before exiting?
Write a program in Python that defines and calls the following user defined functions:
(i) Add_Book(): Takes the details of the books and adds them to a csv file 'Book.csv'. Each record consists of a list with field elements as book_ID, B_name and pub.
(ii) Search_Book(): Takes publisher name as input and counts and displays number of books published by them.
Q34Long4 marksDatabase Concepts
The school has asked their estate manager Mr. Rahul to maintain the data of all the labs in a table LAB. Rahul has created a table and entered data of 5 labs.
LABNOLAB_NAMEINCHARGECAPACITYFLOOR
L001CHEMISTRYDaisy20I
L002BIOLOGYVenky20II
L003MATHPreeti15I
L004LANGUAGEDaisy36III
L005COMPUTERMary Kom37II

(i) Identify the columns which can be considered as Candidate keys.
(ii) Write the degree and cardinality of the table.
(iii) Write the statements to:
(a) Insert a new row with appropriate data.
(b) Increase the capacity of all the labs by 10 students which are on 'I' Floor.

OR (for part iii only)
(iii) Write the statements to:
(a) Add a constraint PRIMARY KEY to the column LABNO in the table.
(b) Delete the table LAB.
Q35Long4 marksFile Handling
Shreyas is a programmer who has been given a task to write a user defined function named write_bin() to create a binary file called Cust_file.dat containing customer information - customer number (c_no), name (c_name), quantity (qty), price (price) and amount (amt) of each customer.
The function accepts customer number, name, quantity and price. If quantity entered is less than 10, it displays the message 'Quantity less than 10..Cannot SAVE'. Otherwise the function calculates amount as price * quantity and then writes the record in the form of a list into the binary file.

(i) Write the correct statement to open a file 'Cust_file.dat' for writing the data of the customer.
(ii) Which statement should Shreyas fill in Statement 2 to check whether quantity is less than 10.
(iii) Which statement should Shreyas fill in Statement 3 to write data to the binary file and in Statement 4 to stop further processing if the user does not wish to enter more records.
Q1Short2 marksStack
"Stack is a linear data structure which follows a particular order in which the operations are performed."
What is the order in which the operations are performed in a Stack?
Name the List method/function available in Python which is used to remove the last element from a list implemented stack.
Also write an example using Python statements for removing the last element of the list.
Q2Short2 marksComputer Networks
(i) Expand the following: VoIP, PPP
(ii) Riya wants to transfer pictures from her mobile phone to her laptop. She uses Bluetooth technology to connect two devices. Which type of network (PAN/LAN/MAN/WAN) will be formed in this case?
Q3Short2 marksDatabase Concepts
Differentiate between the terms Attribute and Domain in the context of Relational Data Model.
Q4Short2 marksDatabase Concepts
Consider the following SQL table MEMBER in a SQL Database CLUB:
M_IDNAMEACTIVITY
M1001AminaGYM
M1002PratikGYM
M1003SimonSWIMMING
M1004RakeshGYM
M1005AvneetSWIMMING

Predict the output of the following code:
MYCUR = DB.cursor()
MYCUR.execute("USE CLUB")
MYCUR.execute("SELECT * FROM MEMBER WHERE ACTIVITY= 'GYM' ")
R=MYCUR.fetchone()
for i in range(2):
    R=MYCUR.fetchone()
    print(R[0], R[1], sep = "#")
Q5Long2 marksSQL
Write the output of SQL queries (a) to (d) based on the table VACCINATION_DATA given below:
VIDNameAgeDose1Dose2City
101Jenny272021-12-252022-01-31Delhi
102Harjot552021-07-142021-10-14Mumbai
103Srikanth432021-04-182021-07-20Delhi
104Gazala752021-07-31NULLKolkata
105Shiksha322022-01-01NULLMumbai

(a) SELECT Name, Age FROM VACCINATION_DATA WHERE Dose2 IS NOT NULL AND Age > 40;
(b) SELECT City, COUNT(*) FROM VACCINATION_DATA GROUP BY City;
(c) SELECT DISTINCT City FROM VACCINATION_DATA;
(d) SELECT MAX(Dose1), MIN(Dose2) FROM VACCINATION_DATA;
Q6Long2 marksSQL
Write the output of SQL queries (a) and (b) based on the following two tables DOCTOR and PATIENT:
Table DOCTOR: DNODNAMEFEES
D1AMITABH1500
D2ANIKET1000
D3NIKHIL1500
D4ANJANA1500

Table PATIENT: PNOPNAMEADMDATEDNO
P1NOOR2021-12-25D1
P2ANNIE2021-11-20D2
P3PRAKASH2020-12-10NULL
P4HARMEET2019-12-20D1

(a) SELECT DNAME, PNAME FROM DOCTOR NATURAL JOIN PATIENT;
(b) SELECT PNAME, ADMDATE, FEES FROM PATIENT P, DOCTOR D WHERE D.DNO = P.DNO AND FEES > 1000;
Q7Short2 marksDatabase Concepts
Differentiate between Candidate Key and Primary Key in the context of Relational Database Model.

OR

Consider the following table PLAYER:
PNONAMESCORE
P1RISHABH52
P2HUSSAIN45
P3ARNOLD23
P4ARNAV18
P5GURSHARAN42

(a) Identify and write the name of the most appropriate column from the given table PLAYER that can be used as a Primary key.
(b) Define the term Degree in relational data model. What is the Degree of the given table PLAYER?
Q8Long3 marksStack
Write the definition of a user defined function PushNV(N) which accepts a list of strings in the parameter N and pushes all strings which have no vowels present in it, into a list named NoVowel.
Write a program in Python to input 5 words and push them one by one into a list named All. The program should then use the function PushNV() to create a stack of words in the list NoVowel so that it stores only those words which do not have any vowel present in it, from the list All. Thereafter, pop each word from the list NoVowel and display the popped word. When the stack is empty display the message "EmptyStack".

OR

Write the definition of a user defined function Push3_5(N) which accepts a list of integers in a parameter N and pushes all those integers which are divisible by 3 or divisible by 5 from the list N into a list named Only3_5.
Write a program to input 5 integers into a list named NUM. The program should then use the function Push3_5() to create the stack of the list Only3_5. Thereafter pop each integer from the list Only3_5 and display the popped value. When the list is empty, display the message "StackEmpty".
Q9Short3 marksSQL
(i) A SQL table ITEMS contains the following columns: INO, INAME, QUANTITY, PRICE, DISCOUNT. Write the SQL command to remove the column DISCOUNT from the table.
(ii) Categorize the following SQL commands into DDL and DML: CREATE, UPDATE, INSERT, DROP
Q10Short3 marksSQL
Rohan is learning to work upon Relational Database Management System (RDBMS) application. Help him to perform following tasks:
(a) To open the database named "LIBRARY".
(b) To display the names of all the tables stored in the opened database.
(c) To display the structure of the table "BOOKS" existing in the already opened database "LIBRARY".
Q11Long4 marksSQL
Write SQL queries for (a) to (d) based on the tables PASSENGER and FLIGHT given below:
Table PASSENGER: PNONAMEGENDERFNO
1001SureshMALEF101
1002AnitaFEMALEF104
1003HarjasMALEF102
1004NitaFEMALEF103

Table FLIGHT: FNOSTARTENDF_DATEFARE
F101MUMBAICHENNAI2021-12-254500
F102MUMBAIBENGALURU2021-11-204000
F103DELHICHENNAI2021-12-105500
F104KOLKATAMUMBAI2021-12-204500
F105DELHIBENGALURU2021-01-155000

(a) Write a query to change the fare to 6000 of the flight whose FNO is F104.
(b) Write a query to display the total number of MALE and FEMALE PASSENGERS.
(c) Write a query to display the NAME, corresponding FARE and F_DATE of all PASSENGERS who have a flight to START from DELHI.
(d) Write a query to delete the records of flights which end at Mumbai.
Q12Long4 marksComputer Networks
(i) Differentiate between Bus Topology and Tree Topology. Also, write one advantage of each of them.

OR

Differentiate between HTML and XML.

(ii) What is a web browser? Write the names of any two commonly used web browsers.
Q13Long4 marksComputer Networks
Galaxy Provider Ltd. is planning to connect its office in Texas, USA with its branch at Mumbai. The Mumbai branch has 3 Offices in three blocks located at some distance from each other for different operations - ADMIN, SALES and ACCOUNTS.
Distances: ADMIN Block to SALES Block 300m, SALES Block to ACCOUNTS Block 175m, ADMIN Block to ACCOUNTS Block 350m, MUMBAI Branch to TEXAS Head Office 14000 km.
Computers: ADMIN Block 255, ACCOUNTS Block 75, SALES Block 30, TEXAS Head Office 90.

(a) Suggest the most appropriate networking device to be placed along the path of the wire connecting one block office with another to refresh the signal and forward it ahead.
(b) Which hardware networking device will you suggest to connect all the computers within each block?
(c) Which service/protocol will be most helpful to conduct live interactions of employees from Mumbai Branch and their counterparts in Texas?
(d) Draw the cable layout (block to block) to efficiently connect the three offices of the Mumbai branch.
Q1MCQ1 markPython Fundamentals
Which of the following is NOT a valid variable name in Python?
(i) 5Radius (ii) Radius_ (iii) _Radius (iv) Radius
(i) 5Radius
(ii) Radius_
(iii) _Radius
(iv) Radius
Q2MCQ1 markPython Fundamentals
Identify the keywords from the following:
(i) break (ii) check (iii) range (iv) while
Q3Short1 markPython Fundamentals
Name the Python module which contains the definition of the following functions:
(i) cos() (ii) randint()
Q4Short2 marksPython Fundamentals
Rewrite the following code after removing all the syntax errors (if any). Underline each correction done.
import math
A = input('Enter a word',W)
if W = 'Hello':
    print(W)
Q5Short2 marksPython Fundamentals
Find the output of the following:
def ChangeVal(M):
    for I in range(len(M)):
        if M[I]%5 == 0:
            M[I] //= 5
        if M[I]%3 == 0:
            M[I] //= 3
    print(M[I], end='#')
ChangeVal([25, 8, 75, 12])
Q6Short3 marksPython Fundamentals
Find the output of the following:
def Call(P=40, Q=20):
    P = P + Q
    Q = P - Q
    print(P, '@', Q)
    return P
R = 200
S = 100
R = Call(R, S)
print(R, '@', S)
S = Call(S)
Q7Short2 marksPython Fundamentals
What are the possible outputs of the following code? Also specify the minimum and maximum values that can be assigned to the variable End.
import random
Colours = ['VIOLET', 'INDIGO', 'BLUE', 'GREEN', 'YELLOW', 'ORANGE', 'RED']
End = random.randint(2, 5)
Beg = random.randint(0, 2)
for I in range(Beg, End):
    print(Colours[I], end='&')
Q8Short1 markPython Fundamentals
Name the immutable object(s) from the following:
List, Tuple, String, Dictionary
Q9Short1 markPython Fundamentals
Write a statement in Python to declare a dictionary whose keys are 1, 2, 3 and values are Reena, Rakesh, Zareen respectively.
Q10MCQ1 markPython Fundamentals
What is the data type of the variable Vowels declared as:
Vowels = ('A', 'E', 'I', 'O', 'U')
(i) List
(ii) String
(iii) Tuple
(iv) Dictionary
Q11Short1 markPython Fundamentals
Find the output of the following:
for i in range(2, 7, 2):
    print(i * '$')
Q12Short1 markPython Fundamentals
Find the output of the following:
def Update(X):
    X += 5
    print('X =', X)
X = 20
Update(X)
print('X =', X)
Q13Short2 marksFile Handling
Differentiate between the "w" and "r" file modes used in Python.
Q14Short2 marksFile Handling
Write a function Show_words() in Python to read the content of a text file 'NOTES.TXT' and display the entire content in capital letters.
Q15Long3 marksPython Fundamentals
Write a recursive function RecsumNat(N) in Python to find the sum of first N natural numbers.
Q16Long4 marksStack
Write the definition of a function PushS(List) to add a new element and PopS(List) to delete an element from a List of numbers, implementing stack operations (LIFO). Also handle underflow condition in PopS.
Q17MCQ1 markComputer Networks
A network that connects computers spread across different cities is called ___.
Q18Short1 markComputer Networks
Name the tool used to check the speed of the internet.
Q19Short1 markComputer Networks
Name the device that uses packet switching technique to connect different networks.
Q20Short1 markComputer Networks
Name the tool/utility used to determine the path taken by a packet to reach its destination.
Q21Short2 marksComputer Networks
Write the full forms of the following:
(i) POP (ii) VoIP (iii) NFC (iv) FTP
Q22Short2 marksData Communication
Match the following generations of mobile technology with their features:
1G, 2G, 3G, 4G
Q23Short3 marksComputer Networks
Differentiate between HTTP and HTTPS protocols.
Q24Long4 marksComputer Networks
An NGO is setting up its centres in different parts of a city with 4 buildings — ADMIN, ACCOUNTS, HELPCENTRE and LOUNGE. Distances: ADMIN to ACCOUNTS 55m, ADMIN to HELPCENTRE 150m, ADMIN to LOUNGE 30m, ACCOUNTS to HELPCENTRE 125m, ACCOUNTS to LOUNGE 80m, HELPCENTRE to LOUNGE 175m. Number of computers: ADMIN-30, ACCOUNTS-20, HELPCENTRE-120, LOUNGE-10.
(a) Suggest the most suitable topology for the network.
(b) Suggest where to place the server.
(c) Suggest the type of network for connecting offices across cities.
(d) Suggest the most suitable medium for the backbone of the network.
Q25Short1 markSQL
Name the SQL command to add an attribute/column in an existing table.
Q26MCQ1 markSQL
Which aggregate function is used to count the total number of records in a table?
Q27Short1 markSQL
Which clause is used to arrange the records in ascending or descending order in SQL?
Q28Short1 markDatabase Concepts
Write the full forms of:
(i) DDL (ii) DML
Q29Short2 marksDatabase Concepts
Consider a table EMPLOYEES with columns: EMPNO, NAME, DEPARTMENT, SALARY, CITY.
(i) What is the degree and cardinality of the table if it has 5 columns and 10 rows?
(ii) Define Primary Key.
Q30Long3 marksSQL
Write the output of the following SQL queries based on the tables CUSTOMERS (CUS_ID, NAME, CITY) and PURCHASES (PUR_ID, CUS_ID, ITEM, PUR_DATE):
(a) SELECT COUNT(DISTINCT CITY) FROM CUSTOMERS;
(b) SELECT MAX(PUR_DATE) FROM PURCHASES;
(c) SELECT NAME, ITEM FROM CUSTOMERS C, PURCHASES P WHERE C.CUS_ID = P.CUS_ID;