Show answer & explanation
Correct answer: C
Python is case-sensitive; the built-in function is print (lowercase), not Print. Using Print is treated as an undefined name, which raises a NameError.
Show answer & explanation
Correct answer: C
Tim Berners-Lee, a British scientist, invented the World Wide Web in 1989-1990 while at CERN.
Show answer & explanation
Correct answer: D
Exception handling flow: an error is encountered (E), an exception object is created (D), the exception is raised (A), the program searches for an exception handler (C), and the handler executes the exception block (B). Order: E→D→A→C→B.
Show answer & explanation
Correct answer: D
In SQL LIKE, the valid wildcard characters are % (any number of characters) and _ (a single character). % is the valid choice here.
Show answer & explanation
Correct answer: B
Data redundancy = duplication of data (II); Data inconsistency = mismatch of data at different places (IV); Data isolation = separation of resource/data (III); Data dependency = updating structure requires modifying all programs (I). So A-II, B-IV, C-III, D-I.
Show answer & explanation
Correct answer: A
Correct sequence: create the database (B), use it (D), create the table (C), insert a record (A), then display records (E). So B D C A E.
Show answer & explanation
Correct answer: C
DDL commands include CREATE, ALTER, DROP, TRUNCATE. UPDATE is a DML command, not DDL.
Show answer & explanation
Correct answer: C
The schema is the overall design/structure of a database.
Show answer & explanation
Correct answer: C
A switch forwards data only to the intended recipient (using MAC addresses), unlike a hub which broadcasts to all nodes. So a switch is the best device.
Show answer & explanation
Correct answer: D
Append mode 'a' opens the file with the offset positioned at the end of the file. Modes r, w, w+ position the offset at the beginning.
Show answer & explanation
Correct answer: C
MID(str,6,7) extracts 7 characters starting at position 6. "SAVE ENVIRONMENT": position 6 is 'E' (S=1,A=2,V=3,E=4,space=5,E=6). 7 characters from position 6 = 'ENVIRON'.
Show answer & explanation
Correct answer: D
A Personal Area Network (PAN) connects devices within the personal range of a single user, such as a mobile connected to a laptop via USB.
Show answer & explanation
Correct answer: B
DROP TABLE <tableName>; removes the entire table structure and data from the database.
Show answer & explanation
Correct answer: C
Browser = Google Chrome (II); Multiport modem = Hub (IV); Protocol = SMTP (I); BCC = Blind carbon copy (III). So A-II, B-IV, C-I, D-III.
Show answer & explanation
Correct answer: C
mid(), substr() and substring() are valid SQL string functions used to extract substrings. middle() is not a valid SQL function, so it is the odd one out.
Show answer & explanation
Correct answer: D
Statement I describes the median (middle value when sorted), not the mode, so it is incorrect. Statement II correctly defines mode as the most frequently occurring value. So Statement I incorrect, Statement II true.
Show answer & explanation
Correct answer: A
In bubble sort, adjacent elements are repeatedly compared and swapped if out of order.
Show answer & explanation
Correct answer: B
A is correct (queue is an ordered linear structure). B is correct (a deque supports both stack and queue operations). C is wrong (queue is linear). D is wrong (queue is FIFO). E is wrong (a deque allows insertion/deletion at both ends). So A and B only.
Show answer & explanation
Correct answer: A
The default whence value for seek() is 0, which means the beginning of the file.
Show answer & explanation
Correct answer: B
readline() reads a single (next) line from the file. readlines() reads all lines into a list; read() reads the whole file; readnext() is not valid.
Show answer & explanation
Correct answer: C
A*B+C/D: A*B → AB*, C/D → CD/, then add the two → AB*CD/+.
Show answer & explanation
Correct answer: B
In read mode 'r', the file pointer is positioned at the beginning of the file.
Show answer & explanation
Correct answer: C
Since y=0, the function executes 'raise ZeroDivisionError', which raises that exception (and since it is uncaught, it is reported). The output/error is ZeroDivisionError.
Show answer & explanation
Correct answer: C
Full duplex allows simultaneous two-way communication. Half duplex allows both directions but not at the same time; simplex is one-way only.
Show answer & explanation
Correct answer: B
Advantages of DBMS: reduces redundancy (A), enables data sharing (B), and reduces inconsistency (D). C and E are disadvantages/incorrect. So A, B and D only.
Show answer & explanation
Correct answer: A
% matches zero, one or many characters (A correct). _ (underscore) matches exactly one single character (D correct). B, C, E are wrong. So A and D only.
Show answer & explanation
Correct answer: A
Need all details (*) where Gender is 'M' AND Membership > 10. Option A is correct. B selects only some columns and quotes the number; C uses 'Male' and <10; D uses OR.
Show answer & explanation
Correct answer: C
To get total customers per trainer, group the Customer table by TId and count. 'Select TId, count(*) from Customer group by TId;' is correct. B selects TName which is not in Customer and not in GROUP BY; A and D lack GROUP BY.
Show answer & explanation
Correct answer: B
Correct SQL clause order: SELECT ... FROM ... WHERE ... ORDER BY ... DESC. Option B is syntactically correct. A and C place ORDER BY before WHERE/HAVING; D has wrong ORDER BY syntax.
Show answer & explanation
Correct answer: A
Use UPDATE ... SET Membership=12 with WHERE matching either G101 OR G102 (a row's TId cannot equal both, so OR is required). Option A is correct. C uses AND (returns nothing); B/D use wrong syntax.
Show answer & explanation
Correct answer: D
Correct queries must join Customer and Trainer on TId and use the proper column name Cust_Name with a valid salary range. A (>=20000 and <=25000), B (between, no alias), and E (between with aliases) all use Cust_Name and a valid join/condition. C and D use the invalid column 'C_Name'. So A, B and E only.
Show answer & explanation
Correct answer: C
readlines() returns a list of strings, where each element is one line of the file.
Show answer & explanation
Correct answer: A
A MAC address is 48 bits (6 bytes) long.
Show answer & explanation
Correct answer: A
Both statements are true, and the reason (wireless networks connect without wires) correctly explains why Wi-Fi allows mobility. So A is the answer.
Show answer & explanation
Correct answer: B
In star topology, all nodes connect to a central controller/hub.
Show answer & explanation
Correct answer: C
WiMax stands for Worldwide Interoperability for Microwave Access.
Show answer & explanation
Correct answer: C
Guided (wired) media include optical fiber (B), twisted pair (D) and coaxial cable (E). Radio waves and microwaves are unguided. So B, D and E only.
Show answer & explanation
Correct answer: A
Binary search repeatedly examines the midpoint of a sorted list to halve the search space.
Show answer & explanation
Correct answer: B
statement-1: for i in range(n) (D); statement-2: temp=list3[i] (B); statement-3: while ... and temp<list3[j] (A); statement-4: j=j-1 (E); statement-5: list3[j+1]=temp (C). Sequence D→B→A→E→C.
Show answer & explanation
Correct answer: D
File object attributes include closed, mode and name. 'next' and 'tell' are methods, not attributes. So A, B and D only.
Show answer & explanation
Correct answer: C
Ascending order by StuID uses 'ORDER BY StuID ASC'. Option C is correct; the keyword is ASC, not 'ascending' (B is wrong), A orders by BookID, D is descending.
Show answer & explanation
Correct answer: C
A student may borrow the same BookID on different dates, and a book may be issued to different students; so BookID alone is not unique. The combination BookID + Issued_date uniquely identifies each issue record. So BookID, Issued_date.
Show answer & explanation
Correct answer: D
Books not returned have a NULL Return_date. So 'WHERE Return_date IS NULL' fetches those BookIDs.
Show answer & explanation
Correct answer: C
An alternate key is a candidate key not chosen as the primary key. StuAadhar is unique to each student (Aadhaar number), making it the alternate key. StuName, StuContact and StuClass can repeat.
Show answer & explanation
Correct answer: C
Group by Issued_date and filter aggregated counts using HAVING count(*) > 5. Option C is correct. A/D use WHERE with an aggregate (invalid), and B/D group by the wrong column.
Show answer & explanation
Correct answer: B
AdmNo (Admission Number) is unique for each student and has no missing value, so it is the primary key. Name can repeat or be blank; Class and Section repeat.
Show answer & explanation
Correct answer: A
Degree = number of attributes (columns) = 7; Cardinality = number of tuples (rows) = 5.
Show answer & explanation
Correct answer: C
Reading 9 chars: 'C','u','E','t','#','2','0','2','2'. C(upper)→c#; u(lower)→U#; E(upper)→e#; t(lower)→T#; '#' is neither upper/lower and int('#') errors—but per intended logic it falls to else → $#; '2'→int+1=3#; '0'→1#; '2'→3#; '2'→3#. Result: c#U#e#T#$#3#1#3#3#, matching option C (transcribed 'c' for e).
Show answer & explanation
Correct answer: C
The output contains rows present in TableA but not in TableB (Mehek, Lavanya, Abhay), which is the set difference TableA - TableB.
Show answer & explanation
Correct answer: D
readlines() returns a list of lines. The file has 2 lines, so len(line) = 2.
Show answer & explanation
Correct answer: C
s[:3] uses positional slicing returning the first 3 elements (indices 0,1,2): a 2, b 4, c 6.
Show answer & explanation
Correct answer: C
The 'header' parameter of read_csv controls which row is used as column headings (e.g., header=None to skip/ignore the heading row).
Show answer & explanation
Correct answer: B
CSV (Comma Separated Values) files store tabular data and are most suitably created/edited with a spreadsheet package (e.g., Excel, Calc).
Show answer & explanation
Correct answer: A
df['x']=... adds a column (A correct), so C is incorrect. df.loc['x']=... adds a row (D is correct in general), so B (says column) is incorrect. E correctly drops row 'x'. The incorrect statements are B, C and D.
Show answer & explanation
Correct answer: D
The result shows only classes with more than one student (12A=3, 12C=2; 12B with 1 is excluded) and a column alias 'No of students'. Option D groups by CLASS, aliases COUNT(*) as 'No of students', and filters HAVING count(*)>1.
Show answer & explanation
Correct answer: C
To sort by NAME descending and SCORE descending, each column needs its own DESC keyword separated by a comma: ORDER BY NAME DESC, SCORE DESC.
Show answer & explanation
Correct answer: B
Both statements are true: matplotlib is installed via 'pip install matplotlib' and pyplot is imported via 'import matplotlib.pyplot as plt'. However, importing pyplot is not the reason for installing matplotlib, so R does not explain A.
Show answer & explanation
Correct answer: B
E-waste = devices no longer in use (II); Reduce = minimize purchase to need (I); Reuse = use devices again and again (III); Recycle = re-using waste after modification (IV). So A-II, B-I, C-III, D-IV.
Show answer & explanation
Correct answer: C
Mosaic was the early web browser developed at NCSA (National Center for Supercomputing Applications).
Show answer & explanation
Correct answer: B
The index attribute is reassigned with df.index = [...]. So d1.index = ['student1', 'student2'].
Show answer & explanation
Correct answer: D
Pandas is the popular Python library for data analysis. Swift is a language, Django a web framework, OpenOffice an office suite.
Show answer & explanation
Correct answer: B
Adware displays advertisements to generate revenue for its developer.
Show answer & explanation
Correct answer: B
A hacktivist hacks to promote political or social change.
Show answer & explanation
Correct answer: A
substr(str,7,5) extracts 5 characters starting at position 7. 'Every cloud...': position 7 is 'c' (E=1,v=2,e=3,r=4,y=5,space=6,c=7). 5 chars = 'cloud'.
Show answer & explanation
Correct answer: A
pencil and eraser have 3 elements; pen has 4. The DataFrame has 4 columns, so missing values for the 3-element rows are filled with NaN. Row0=pencil(10,20,30,NaN), Row1=pen(11,16,17,18), Row2=eraser(40,50,70,NaN).
Show answer & explanation
Correct answer: C
The autopct parameter in pie() displays the percentage value of each slice as a label.
Show answer & explanation
Correct answer: A
plt.title('Nutritional Value') sets the chart title (Statement1) and plt.show() displays the chart (Statement2). So title, show().
Show answer & explanation
Correct answer: A
.loc[['KPL','WPM']] selects the rows labelled KPL and WPM with all columns. So output is the KPL and WPM rows with all month columns.
Show answer & explanation
Correct answer: C
Ergonomics deals with designing the workspace to suit the user and prevent posture-related problems; ergonomists recommend such arrangements.
Show answer & explanation
Correct answer: B
pd.merge() is used to combine/merge two dataframes in pandas.
Show answer & explanation
Correct answer: C
Bar charts can be customised with line style, line width, edge color and bar color. Marker is a property of line/scatter plots, not bars. So A, B, C and D only.
Show answer & explanation
Correct answer: A
First 5 even numbers are 2,4,6,8,10 = np.arange(2,12,2). Use pd.Series with these and the given index. Option A is correct. B uses np.range (invalid); C stops at 8 (only 4 numbers); D uses pd.arange (invalid).
Show answer & explanation
Correct answer: B
Select columns with a list d1[['name','stream']] and filter rows with the boolean mask [d1['name']=='Bhavya']. Option B is correct. A has wrong column-list syntax; C is incomplete; D uses '=' instead of '=='.
Show answer & explanation
Correct answer: B
In the date '2003-11-10', month 11 is November. monthname() returns the month name 'November'.
Show answer & explanation
Correct answer: A
The output combines all distinct rows from both tables, which is the Union (U) operation.
Show answer & explanation
Correct answer: B
Switches and hubs are distinct devices; a switch is not a hub and a hub is not a switch. Both statements are incorrect.
Show answer & explanation
Correct answer: C
In traffic flooding, the network is overwhelmed/congested, creating chaos that lets a hacker sneak in undetected.
Show answer & explanation
Correct answer: B
A is correct (pip install sqlalchemy). B is correct (create_engine establishes connection). E is correct (the string is a connection string). C is wrong (create_engine returns an engine object) and D is wrong (it takes a full connection string, not just a database name). So A, B and E only.
Show answer & explanation
Correct answer: C
shape = dimensions (III); T = transpose, interchange rows and columns (IV); index = labels (II); columns = names of columns (I). So A-III, B-IV, C-II, D-I.
Show answer & explanation
Correct answer: B
With fill_value=0, missing labels are treated as 0. a: 1+100=101; b: 2+20=22; x: 0+10=10; y: 0+20=20. So a 101, b 22, x 10, y 20.
Show answer & explanation
Correct answer: B
Web hosting is the service that publishes a website/web page on the internet as part of the World Wide Web.
Show answer & explanation
Correct answer: C
Per NCERT, net etiquettes (be ethical/respectful/responsible), communication etiquettes (be precise/polite/credible) and social media etiquettes (be secure/reliable) are standard. 'Digital etiquettes- Be Kind, Be considerate' is not the standard listed pair, so it is the incorrect pair.
Show answer & explanation
Correct answer: B
An internet troll deliberately posts inflammatory/off-topic messages to provoke and upset others.
Show answer & explanation
Correct answer: C
Active digital footprint is the data we intentionally create/leave, such as emails, posts and responses. Passive footprint is data collected without explicit action.
Show answer & explanation
Correct answer: A
The average of squared differences from the mean is the variance, df.var(). The square root of variance is the standard deviation, df.std(). So df.var(), df.std().
Original question paper source: National Testing Agency (NTA), CUET (UG) 2022. Reproduced for educational use. Answers & explanations by UniDrill.