Home

Designed for school students & undergraduate entrance aspirants preparing for board exams, NEET, JEE and more.

JEE (Mains & Adv)NEET (UG)CBSE BoardISC BoardUP BoardCUET

Built for graduates & professionals targeting competitive exams — UPSC, CAT, GMAT, GRE, IELTS, banking & more.

GREGMATCATUPSCIBPSIELTSTOEFLSATACT

Core school & undergraduate subjects aligned with CBSE, ISC, UP Board, NEET and JEE syllabi.

PracticeMock TestsResources
PYQ HomecbseComputer Science2025 • CBSE 2025, Compartment, Set 4

CBSE 2025, Compartment, Set 4 Solutions
CBSE Computer Science (2025)

Question Paper

49 Questions
Q11 Marks
MCQ

Which of the following is a mapped data type?

Computational Thinking And Programming 2View Solution
Q21 Marks
MCQ

Assertion (A): Foreign key column of a table cannot have NULL entries. Reason (R): Primary key column of a table cannot have NULL entries.

Choose the correct option:

Database ManagementView Solution
Q31 Marks
MCQ

What is the value of the following expression?

[Code Block]

Computational Thinking And Programming 2View Solution
Q41 Marks
MCQ

What is the output of the following expression?

[Code Block]

Computational Thinking And Programming 2View Solution
Q51 Marks
Subjective

What will be the output of the following code segment?

[Code Block]

Computational Thinking And Programming 2View Solution
Q61 Marks
MCQ

Which of the following devices is essential to set up a wired LAN?

Computer NetworksView Solution
Q71 Marks
MCQ

Which of the following is not a valid relational operator used with WHERE clause in SQL?

Database ManagementView Solution
Q81 Marks
MCQ

What is the default format of date in MySQL?

Database ManagementView Solution
Q91 Marks
MCQ

If the dictionary D1 is defined as:

[Code Block]

then which of the following statements is incorrect and hence will result in an error?

Computational Thinking And Programming 2View Solution
Q101 Marks
MCQ

Which of the following list methods accepts exactly 2 parameters?

Computational Thinking And Programming 2View Solution
Q111 Marks
Subjective

Assuming that D1 and D2 are Python dictionaries, write the statement using built-in functions/methods:

To update dictionary D2 with the elements of D1.

Computational Thinking And Programming 2View Solution
Q121 Marks
MCQ

A text file song.txt contains the following contents in it: Life goes on as it never ends

What will be the output of the following code snippet?

[Code Block]

Computational Thinking And Programming 2View Solution
Q131 Marks
MCQ

What will be the output of the following code segment?

[Code Block]

Computational Thinking And Programming 2View Solution
Q141 Marks
Subjective

Assuming that D1 and D2 are Python dictionaries, write the statement using built-in functions/methods:

To generate a tuple of keys of D2.

Computational Thinking And Programming 2View Solution
Q151 Marks
MCQ

Assertion (A): Every object in Python is assigned a unique identity (ID). Reason (R): ID remains the same for the lifetime of that object.

Choose the correct option:

Computational Thinking And Programming 2View Solution
Q161 Marks
TRUE-FALSE

State whether the following statement is True or False. In Python, the print() evaluates the expression before displaying it on the screen.

Computational Thinking And Programming 2View Solution
Q171 Marks
MCQ

Identify the output of the following code segment:

[Code Block]

Computational Thinking And Programming 2View Solution
Q182 Marks
Subjective

What is the difference between = and == in Python? Give an example of each.

Computational Thinking And Programming 2View Solution
Q191 Marks
Subjective

Assuming that D1 and D2 are Python dictionaries, write the statement using built-in functions/methods:

To delete all the elements of D1.

Computational Thinking And Programming 2View Solution
Q201 Marks
MCQ

Ginni has created a table, SCORES in MySQL to store runs scored by players in a cricket match. The table contains the following records:

Which of the following statements will give 10 as output?

Database ManagementView Solution
Q211 Marks
Subjective

Assuming that D1 and D2 are Python dictionaries, write the statement using built-in functions/methods:

To generate a list of values of D1.

Computational Thinking And Programming 2View Solution
Q222 Marks
MCQ

Identify the correct possible output(s) of the following code segment. Also write the minimum and the maximum possible values of the variable b.

[Code Block]

Computational Thinking And Programming 2View Solution
Q233 Marks
Subjective

Write a function in Python to display the line which has the maximum number of vowels from a text file, "Novel.txt".

Computational Thinking And Programming 2View Solution
Q242 Marks
Subjective

The code provided below is intended to input a positive integer from the user and display the total number of its factors. However, there are syntax and logical errors in the code. Rewrite the code after removing all the errors. Underline all the corrections made.

[Code Block]

Computational Thinking And Programming 2View Solution
Q251 Marks
Subjective

Write any one difference between CHAR and VARCHAR data types in MySQL.

Database ManagementView Solution
Q263 Marks
Subjective

Write a Python function that displays all the lines ending with a dot (.) from a text file "Colors.txt". For example, if the file contains: White is a mix of seven colors. What are these seven colors ? VIBGYOR - violet, indigo, blue, green, orange and red. When we mix all these colors we just get one light which is the WHITE light.

Then the output should be : White is a mix of seven colors. VIBGYOR - violet, indigo, blue, green, orange and red.

(Hint: You will have to ignore trailing white spaces to check the last character)

Computational Thinking And Programming 2View Solution
Q271 Marks
Subjective

Write an SQL command to remove a column named ADDRESS, from a table named CUSTOMER.

Database ManagementView Solution
Q282 Marks
Subjective

Give an example of each of the following: \n (i) An expression using any one identity operator. \n (ii) An arithmetic expression which uses any one augmented assignment operator.

Computational Thinking And Programming 2View Solution
Q293 Marks
Subjective

A stack named KeyStack contains records of some computer keyboards. Each record is represented as a list containing Make, Keys, Connectivity. The Make and Connectivity are strings, and Keys is an integer. For example, a record in the stack may be ("Hitech", 105, "USB").

Write the following user-defined functions in Python to perform the specified operations on KeyStack: (I) push_key (KeyStack, new_key): This function takes the stack KeyStack and a new record new_key as arguments and pushes this new record onto the stack. (II) pop_key (KeyStack): This function pops the topmost record from the stack and returns it. If the stack is already empty, the function should display the message "Underflow". (III) isEmpty(KeyStack): This function checks whether the stack is empty. If the stack is empty, the function should return True, otherwise the function should return False.

Computational Thinking And Programming 2View Solution
Q303 Marks
Subjective

Write the following user-defined functions in Python: (I) push_vowels (S, St): Here s is a string and st is a list representing a stack. The function should push all the vowels of the string s onto the stack st. For example, if the string s is "Easy Concepts", then the function push_vowels() should push the elements "E", "a", "o", "e" onto the stack. (II) pop_one (St): The function should pop an element from the stack st, and return this element. If the stack is empty, then the function should display the message "Stack Underflow", and return None. (III) display_all(St): The function should display all the elements of the stack st, without deleting them. If the stack is empty, the function should display the message "Empty Stack".

Computational Thinking And Programming 2View Solution
Q311 Marks
Subjective

In a particular examination, there are 50 candidates with roll numbers from 997601 to 997650. The data of these candidates is stored in a table in a database. What is the domain of the column which stores the roll numbers of the candidates?

Database ManagementView Solution
Q323 Marks
Subjective

Write the output on execution of the following Python code :

[Code Block]

Computational Thinking And Programming 2View Solution
Q334 Marks
Subjective

Consider the table STAFF given below :

Write the suitable SQL queries to perform the following tasks: (I) To display the average salary of each department. (II) To insert the following record in the table, STAFF. STAFF ID: S333 STAFF NAME: GURMEET SALARY: 15000 DEPARTMENT: ADMIN DESIGNATION: CLERK (III) To display the unique designations from the table. (IV) To display all the details of the staff whose name is of four letters.

Database ManagementView Solution
Q344 Marks
Subjective

Consider the table STAFF given below :

Write the output for the queries given below: (I) SELECT STAFF_NAME FROM STAFF WHERE SALARY BETWEEN 25000 AND 30000; (II) SELECT * FROM STAFF WHERE DEPARTMENT = "MATHS" AND SALARY > 25000; (III) SELECT STAFF_NAME, STAFF_ID FROM STAFF WHERE DEPARTMENT LIKE "%S"; (IV) SELECT MAX(SALARY) FROM STAFF;

Database ManagementView Solution
Q354 Marks
Subjective

Suman is an intern at a software startup. The company has assigned her a task to create a CSV file named CLUB.CSV, to store the records of the Club members. After discussing with Club Incharge, Suman has planned to store the following content of members in the file CLUB.CSV: [Mno, Name, Mobile, Fee]

Where

  • Mno: Member Number
  • Name: Name of the Member
  • Mobile: Member's Mobile Number
  • Fee: Fee amount

Assuming you are asked to help Suman in her assignment, write a Python code for performing the following tasks with the help of user-defined functions: NewMembers(): to accept records of members from the user and add them to the file CLUB.CSV. PriorityMember(): to find and display those members from the file CLUB.CSV, who are paying Fee more than 35000.

Computational Thinking And Programming 2View Solution
Q363 Marks
Subjective

Write the output on execution of the following Python code :

[Code Block]

Computational Thinking And Programming 2View Solution
Q374 Marks
Subjective

Assume that you are working for ABC Corporation (ABCC). ABCC allots contracts to different contractors for some of its works. The data of Contracts and Contractors are kept in the tables Work and Contractor respectively. Following are a few records from these two tables of ABCC's database.

Note: The tables contain many more records than shown here. As an employee of ABCC, you are required to write the SQL queries for the following: (I) To display all the records from the Work table in alphabetical order of W_Name. (II) To display the names of contractors where W_Amt is more than 15000. (III) To display the structure of Work table. (IV) To count total number of records present in Work table.

Database ManagementView Solution
Q384 Marks
Subjective

Assume that you are working for ABC Corporation (ABCC). ABCC allots contracts to different contractors for some of its works. The data of Contracts and Contractors are kept in the tables Work and Contractor respectively. Following are a few records from these two tables of ABCC's database.

Note: The tables contain many more records than shown here. As an employee of ABCC, you are required to write the SQL queries for the following: (I) To display all the records from the Work table in alphabetical order of W_Name. (II) To display the names of contractors where W_Amt is more than 15000. (III) To display the structure of Work table. (IV) To delete the records of contractors whose phone number is not known.

Database ManagementView Solution
Q395 Marks
Subjective

Keshav is the IT Head in a hospital. He needs to manage the records of all the doctors in the hospital. For this, he wants to store the following information of each doctor in a file:

  • D_ID: An integer to store Doctor ID.
  • D_Name: A string to store doctor's name.
  • D_Dept: A string to store the Department of the doctor. (Surgery, Radiology, etc.)
  • Experience: An integer to store doctor's experience (in years)

For example, a doctor's information may be: [1256, "R. Gupta", "Cardiology", 15]

As an applicant for the post of a Programmer, you have to answer the following questions in this context: (I) Write one difference of storing this data in a binary file over a CSV file. (II) Assume that the data is stored in a binary file, named DOCTORS.DAT, and each record is stored as a list. Write a function, in Python, to read and display all the records from the file DOCTORS.DAT. (III) Write a function addDoctor(), in Python, which accepts a doctor's data from the user and writes it in the file DOCTORS.DAT.

Computational Thinking And Programming 2View Solution
Q401 Marks
Subjective

Write any two DDL commands.

Database ManagementView Solution
Q411 Marks
Subjective

Write one difference between Primary key and Unique constraint.

Database ManagementView Solution
Q421 Marks
Subjective

Write an SQL command to add a column named ADDRESS, of type VARCHAR(20) in a table named CUSTOMER.

Database ManagementView Solution
Q431 Marks
TRUE-FALSE

State if following statement is True or False: If T is a tuple and L is a list, then T+L is a valid statement in Python.

Computational Thinking And Programming 2View Solution
Q444 Marks
Subjective

Nutan Kumar is using Python connectivity with MySQL for maintaining data for a table named MEDICINES in a database PHARMACY. The table has the following attributes:

  • MId (Medicine number) : string
  • Mname (Medicine Name) : string
  • Expiry (Expiry Date) : Date
  • Status (Active/Discard) : string

Consider the following to establish connectivity between Python and MySQL:

  • Username: root
  • Password: tiger
  • Host: localhost

Help Nutan to write the definition of a user-defined function named ChangeStatus() in Python to change the Status of the Medicines whose Expiry is before "2022-12-31" as "DISCARD".

Database ManagementView Solution
Q451 Marks
MCQ

Which network device serves as the entry and exit point of a network, as all data coming in or going out of a network must first pass through it ?

Computer NetworksView Solution
Q462 Marks
Subjective

(a) Expand the following terms: POP, TCP (b) Write any one difference between a hub and a switch used in computer networks.

Computer NetworksView Solution
Q472 Marks
Subjective

(a) Write any one difference between HTTP and HTTPS. (b) Write names of any two wireless transmission media.

Computer NetworksView Solution
Q485 Marks
Subjective

'CKNG Auto' is a big car-selling agency having its Head Office in Delhi. It is planning to set up a new branch in Patiala. The Patiala branch will have four blocks - ADMIN, SALES, SERVICE and INSURANCE. You, as a network expert, need to suggest the best network-related solutions for them to resolve the issues/problems mentioned in points (I) to (V), keeping the following parameters in mind.

Distance of Delhi Head Office from Patiala branch = 250 km

Number of computers in each block is as follows:

(I) Suggest the most appropriate location of the server inside the Patiala branch. Justify your choice.\n (II) What kind of network (PAN/LAN/MAN/WAN) will be formed by interconnecting all the computers inside a block ?\n (III) Draw the most effective cable layout to connect all four blocks of Patiala branch.\n (IV) Which device should be used to provide Internet connection to all the computers in the Patiala branch ?\n (V) (a) Which is the best wired medium to connect server of Patiala office to the head office at Delhi ?\n OR \n (b) Is there a need for repeater(s) in Patiala branch ? Why, or why not?

Computer NetworksView Solution
Q491 Marks
MCQ

Which of the following IP addresses is valid ?

Computer NetworksView Solution

Paper Overview

Total Marks

70

Time

3 Hrs

Content Weightage

Computational Thinking And Programming 255%
Database Management32%
Computer Networks13%

Question Pattern

  • MCQ17
  • Subjective30
  • TRUE FALSE2

Decoding the 2025 CBSE Computer Science Paper

The 2025 Computer Science examination paper (CBSE 2025, Compartment, Set 4) is a crucial resource for understanding the examiner's mindset. By analyzing the content weightage above, you can see exactly which units carried the most focus and required deep conceptual understanding.

Click on any question to view its detailed, step-by-step solution. We provide the official marking scheme breakdown, ensuring you know exactly where marks are awarded for formulas, substitution, and final answers.

Edvaya Target App Icon

Edvaya Target

Board & Competitive Exams Made Easy

Edvaya Target is built for students preparing for JEE (Main & Advanced), NEET UG, and Board Exams (CBSE, ISC & State Boards) — using a practice-first approach that actually works.

Get it on Google Play

We Value Your Privacy

Edvaya uses cookies to enhance your learning experience, analyze platform usage, and provide personalized content. You can customize your preferences or accept all cookies to continue.

By continuing, you agree to our Cookie Policy and Privacy Policy