12th Standard CBSE Syllabus & Materials
12th Standard CBSE
CBSE 12th Economics Government Budget and the Economy Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Interface Python with MySQL - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Data Communication - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Data Structures - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Functions - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Python Revision Tour I - New Previous year Question Papers Study Material - QB365 Set A

Published on: 20/08/2026
Download CBSE Class 12th Standard CBSE Computer Science question papers, sample papers, important questions, and previous year solved papers in PDF format. Get free study materials, NCERT solutions, and exam preparation resources for Class 12th Standard CBSE Computer Science
Questions + Answers key
Take MCQ Computer Science Test

1.
Explain the use of 'Foreign Key' in a Relational Database Management System. Give example to support your answer.
2.
Explain the concept of "Alternate Key" in a Relational Database Management System with an appropriate example.
3.
Give an example of a table which has one Primary key and two alternate keys. How many Candidate keys will this table have?
4.
Mention atleast three limitations of DBMS.
5.
Why does the need of the database system arise? Give the reason.
6.
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 |
7.
What do you understand by primary key? Give a suitable example of primary key from a table containing some meaningful data.
8.
Describe the following terms:
(i) Domain
(ii) DB2
9.
Differentiate between an attribute and a tuple with an example.
10.
A table CUSTOMER has 10 columns but no row. Later, 10 new rows are inserted and 3 rows are deleted in the table. What is the degree and cardinality of the table CUSTOMER.
11.
What is the difference between degree and cardinality of a table? What is the degree and cardinality of the following table?
Eno | Name | Salary |
|---|---|---|
101 | John Fedrick | 45000 |
103 | Raya Mazumdar | 50600 |
12.
(a) Consider the table MOVIEDETAILS given below:
Table: MOVIEDETAILS
MOVIEID | TITLE | LANGUAGE | RATING | PLATFORM |
|---|---|---|---|---|
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 |
(i) Identify the degree and cardinality of the table.
(ii) Which field should be made the primary key? Justify your answer.
Or
(b) (i) Identify the candidate key(s) from the table MOVIEDETAILS.
(ii) Consider the table SCHEDULE given below.
Table: SCHEDULE
SLOTID | MOVIEID | TIMESLOT |
|---|---|---|
S001 | M010 | 10 AM to 12 PM |
S002 | M020 | 2 PM to 5PM |
S003 | M010 | 6 PM to 8 PM |
S004 | M011 | 9 PM to 11 PM |
Which field will be considered as the foreign key if the tables MOVIEDETAILS and SCHEDULE are related in a database?
13.
Write some advantages of DBMS over file system?
14.
Mention the various advantages of DBMS.
15.
List some commonly used DBMS software packages
16.
For the below given database STUDENT-PROJECT, answer the following:

(a) Name primary key of each table.
(b) Find foreign key(s) in table PROJECT ASSIGNED.
(c) Is there any alternate key in table STUDENT? Give justification for your answer.
(d) Can a user assign duplicate value to the field RollNo of STUDENT table? Justify.
17.
In a multiplex, movies are screened in different auditoriums. One movie can be shown in more than one auditorium. In order to maintain the record of movies, the multiplex maintains a relational database consisting of two relations viz.MOVIE and AUDI respectively as shown below: Movie(Movie_ID, MovieName, ReleaseDate) Audi(AudiNo, Movie_ID, Seats, ScreenType, TicketPrice)
(a) Is it correct to assign Movie_ID as the primary key in the MOVIE relation? If no, then suggest an appropriate primary key.
(b) Is it correct to assign AudiNo as the primary key in the AUDI relation? If no, then suggest appropriate primary key.
(c) Is there any foreign key in any of these relations?
18.
School uniform is available at M/s Sheetal Private Limited. They have maintained SCHOOL UNIFORM Database with two relations viz. UNIFORM and COST. The following figure shows database schema and its state.

(a) Can they insert the following tuples to the UNIFORM Relation? Give reasons in support of your answer.
(i) 7, Handkerchief, NULL
(ii) 4, Ribbon, Red
(iii) 8, NULL, White
(b) Can they insert the following tuples to the COST Relation? Give reasons in support of your answer.
(i) 7,S, 0
(ii) 9, XL, 100
19.
An organisation wants to create a database EMPDEPENDENT to maintain following details about its employees and their dependent. EMPLOYEE(AadharNumber, Name, Address, Department, EmployeelD)
DEPENDENT(EmployeelD, DependentName, Relationship)
(a) Name the attributes of EMPLOYEE, which can be used as candidate keys.
(b) The company wants to retrieve details of dependent of a particular employee. Name the tables and the key which are required to retrieve this detail. (c) What is the degree of EMPLOYEE and DEPENDENT relation?
20.
A school has a rule that each student must participate in a sports activity. So each one should give only one preference for sports activity. Suppose there are five students in a class, each having a unique roll number. The class representative has prepared a list of sports preferences as shown below.
Table : Sports Preferences
Roll_no | Preference |
|---|---|
9 | Cricket |
13 | Football |
17 | Badminton |
17 | Football |
21 | Hockey |
24 | NULL |
NULL | Kabaddi |
Answer the following:
(a) Roll no 24 may not be interested in sports. Can a NULL value be assigned to that student's preference field?
(b) Roll no 17 has given two preferences in sports. Which property of relational DBMS is violated here? Can we use any constraint or key in the relational DBMS to check against such violation, if any?
(c) Kabaddi was not chosen by any student. Is it possible to have this tuple in the Sports Preferences relation?
21.
What are the limitations of file system that can be overcome by a relational DBMS?
22.
Compared to a file system, how does a database management system avoid redundancy in data through a database?
23.
Give the terms for each of the following:
(a) Collection oflogically related records.
(b) DBMS creates file that contains description about the data stored in the database.
(c) Attribute that can uniquely identify the tuples in a relation.
(d) Special value that is stored when actual data value unknown for an attribute.
(e) An attribute which can uniquely identify tuples of the table but is not defined as primary key of the table.
(f) Software that is used to create, manipulate and maintain a relational database.
24.
Write down some differences between a primary key and candidate key.
25.
Explain database and DBMS in detail.
26.
For the given database of Q.10, STUDENT PROJECT, can we perform the following operations?
(a) Insert a student record with missing roll number value.
(b) Insert a student record with missing registration number value.
(c) Insert a submission-date. project detail without submission-date.
(d) Insert a record with registration ID IP-101-19 and ProjectNo 206 in table PROJECT-ASSIGNED.
27.
The school canteen wants to maintain records of items available in the school canteen and generate bills when students purchase any item from the canteen. The school wants to create a canteen database to keep track of items in the canteen and the items purchased by students. Design a database by answering the following questions:
(a) To store each item name along with its price, what relation should be used? Decide appropriate attribute names along with their data type. Each item and its price should be stored only once. What restriction should be used while defining the relation?
(b) In order to generate bill, we should know the quantity of an item purchased. Should this information be in a new relation or a part of the previous relation? If a new relation is required, decide appropriate name and data type for attributes. Also, identify appropriate primary key and foreign key so that the following two restrictions are satisfied:
(i) The same bill cannot be generated for different orders.
(ii) Bill can be generated only for available items in the canteen.
(c) The school wants to find out how many calories students intake when they order an item. In which relation should the attribute calories' be stored?
28.
Answer the following questions on the basis of following table:
Table: Student
Stud_id | Stud_name | Class | Fees |
1 | Aman | IX | 3000 |
2 | Anil | X | 3200 |
Table: Teacher
T_id | T_name | T_sal | Stud_id |
3210 | Mr. Kumar | 60000 | 1 |
3211 | Mr. Sethi | 70000 | 2 |
(i) What is the degree of Student table and Teacher table?
(A) 4,4
(B) 2,2
(C) 4,2
(D) 2,4
(ii) Which field should be the primary key for the Student table?
(A) Stud_id, Stud_name
(B) Stud_name
(C) Stud id
(D) Stud id, class
(iii) What is the cardinality of Student table and Teacher table?
(A) 4,4
(B) 3,2
(C) 4,2
(D) 2,2
(iv) What will be the foreign key for Teacher table?
(A) Stud_id, Stud_name
(B) Stud_name
(C) Stud_ id
(D) Stud_id, class
(v) Which field should be the primary key for the Teacher table?
(A) T_ id, Stud_id
(B) Stud_id
(C) T_id
(D) _id, T_name
1.
A foreign key is a field in one table that refers to the primary key of another table.
It is used to establish a relationship between two tables and maintain referential integrity.
Example Consider the following tables:
Table : Bank_Account
ACode | Name | Type |
|---|---|---|
A01 | Amrita | Savings |
A02 | Parthodas | Current |
A03 | Miraben | Current |
Table : Branch
ACode | City |
|---|---|
A01 | Delhi |
A02 | Mumbai |
A03 | Nagpur |
Here, ACode in the Bank_Account table is a foreign key which refers to the primary key ACode of the Branch table. Using this foreign key, the city of Amrita can be obtained from the Branch table.
2.
An Alternate Key in a Relational Database Management System (RDBMS) is a candidate key that is not chosen as the primary key. It is still unique and can be used to identify records, but it is secondary to the primary key.
Example In a table of employees, the Employee ID could be the primary key, while the Email address (which is also unique) would be an alternate key. Both can uniquely identify a record, but only primary key.
3.
A table with one primary key and two alternate keys will have three candidate keys.
For example:
StudentID (Primary Key) | (Alternate Key) | Phone Number (Alternate Key) | Name |
101 | 1234567890 | John | |
102 | 0987654321 | Sarah |
Here, StudentlD, Email, and PhoneNumber are all candidate keys (with StudentlD being the primary key).
4.
Some limitations of DBMS are given below:
(i) High Cost DBMS requires various software, hardware and highly intelligent people for operating and maintaining the database system. It increases its cost.
(ii) Database Failure If database is corrupted due to power failure or any other reason, our valuable data may be lost or whole system stops.
(iii) Data Quality With increased number of users accessing data directly. There are enormous opportunities for users to damage data. So, it is not easy to provide a strategy to support multiple users to update data simultaneously.
5.
The need of the database system arose in the early 1960s in response to traditional file processing system. To overcome the disadvantages of file processing system, the database system was designed. Some of the major disadvantage of file processing system are given below:
(i) Data redundancy
(ii) Data inconsistency
(iii) Lack of security features
(iv) Handling new queries is difficult.
6.
(i) Candidate Keys CID
(ii) Primary key CID
7.
A primary key is a set of one or more attributes that can uniquely identify tuples within the relation.
Example
TABLE: ITEM
ItemNo | Name | State | City |
|---|---|---|---|
11 | Pastry | 10 | Ajmer |
12 | Pizza | 15 | Delhi |
13 | Cake | 5 | Pune |
14 | Burger | 35 | Delhi |
The attribute ItemNo is a primary key in ITEM table as it contains unique value for each tuple in a relation.
8.
(i) Domain It is a set of possible values for an attribute. A domain is said to be atomic if elements of the domain are considered as indivisible units.
(ii) DB2 It is a Relational Database Management System (RDBMS), fully featured, high performance database capable of handling large quantities of data and concurrently serving many users.
9.
The columns of a table are referred to as attributes. An attribute is also known as field, which is reserved for a specific piece of data. The rows of a table are referred to as tuples.

10.
Degree = 10(No. of columns)
Cardinality = 10 - 3 = 7(No. of rows)
11.
Degree The number of attributes or columns in a table is called the degree of the table.
The degree of the given table is 3
Cardinality The number of rows or records in a table is called the cardinality of the table. The cardinality of the given table is 2.
12.
(a) (i) Degree is 5. Cardinality is 6.
(ii) MOVIEID should be made the primary key as it uniquely identifies each record of the table.
Or
(b) (i) MOVIEID is the candidate keys in table MOVIEDETAILS.
(ii) MOVIEID is the foreign key if the tables MOVIEDETAILS and SCHEDULE are related in a database.
13.
Advantages are:
(i) No redundant data
(ii) Data security
(iii) Easy access of data
(iv) Data consistency and integrity
14.
DBMS has the following advantages:
(i) Reduced data redundancy
(ii) Elimination of inconsistency
(iii) Data sharing
(iv) Data integrity
(v) Data security
(vi) Ease of application development
15.
Some commonly used DBMS software packages are:
(i) MySQL
(ii) Oracle
(iii) Postgre SQL
(iv) DB2
(v) MS-SQL
(vi) Sybase
16.
(a) STUDENT: RollNo
PROJECT: ProjectNo
PROJECT ASSIGNED: Registration_ID
(b) ProjectNo
(c) Yes, Registration_ID in STUDENT table could be an alternate key if its unique (which appears true from schema).
(d) No, RollNo being the primary key must be unique for each row.
17.
(a) Yes, assigning Movie_ID as the primary key in the MOVIE relation is correct, as it uniquely identifies each movie.
(b) No, assigning AudiNo alone as the primary key in the AUDI relation is not correct, as an auditorium can screen multiple movies. A composite key of AudiNo and Movie ID would be more appropriate to uniquely identify each record.
(c) Yes, Movie_ID in the AUDI relation is a foreign key referencing the Movie_ID in the MOVIE relation.
18.
(a) (i) Yes it can be inserted because UColor attribute allows NULL values and there is no NOT NULL Constraint on it.
(ii) No, it cannot be inserted because UCode=4 already exists in the UNIFORM table and primary key values must be unique.
(iii) No, it can not be inserted because UName attribute is defined as NOT NULL and NULL values is not allowed for it.
(b) (i) No, this tuple cannot be inserted because the cost = 0 violates the CHECK constraint (cost > 0)
(ii) No, this tuple cannot be inserted because UCode = 9 does not exist in the UNIFORM relation and hence foreign key constraint is violated.
19.
(a) Candidate keys for EMPLOYEE: AadharNumber, EmployeelD
(b) Tables: EMPLOYEE, DEPENDENT; Key: EmployeelD
(c) Degree of EMPLOYEE: 5, Degree of DEPENDENT: 3
20.
(a) No, a NULL value cannot be assigned because every student must give exactly one sports preference, and NULL violates this rule.
(b) Roll no17 violates the entity integrity constraint, as the same Roll_no appears more than once. This can be prevented by defining Roll_no as PRIMARY KEY, which ensures that each student gives only one preference.
(c) No, this tuple cannot exist because Roll_no is NULL, and a primary key attribute cannot have NULL values. Every preference must be associated with a valid student roll number.
21.
Limitations of File Systems Overcome by Relational DBMS:
(1) Data Redundancy Relational DBMS minimizes duplication through normalization.
(2) Data Integrity DBMS enforces constraints to maintain accurate data, unlike file systems.
(3) Data Access DBMS provides complex querying capabilities using SQL, while file systems require manual data handling.
(4) Concurrency Control DBMS supports multiple users accessing data simultaneously, ensuring data consistency.
(5) Data Security DBMS offers advanced security and user permissions features, including encryption, which file systems lack.
22.
A Database Management System (DBMS) avoids redundancy through normalization, which organizes data into tables to eliminate duplicate data and dependencies.
It enforces relationships and constraints, ensuring that data is stored once and referenced rather than duplicated, thereby maintaining data integrity and consistency.
23.
(a) Table
(b) Data Dictionary
(c) Primary key
(d) NULL
(e) Alternate key
(f) DBMS
24.
Differences between primary key and candidate key:
Primary Key | Candidate Key |
|---|---|
Uniquely identifies each record in a table. | A set of fields that can uniquely identify a record. |
Only one primary key is allowed per table. | A table can have multiple candidate keys. |
Cannot contain NULL values. | Candidate keys can also not contain NULL values. |
It is the main key chosen among candidate keys. | All candidate keys are eligible to be primary. |
Chosen from candidate keys to be the main key. | All candidate keys are eligible to become primary key. |
Used to define relationships with other tables. | Ensure uniqueness but may not be used in relationship. |
25.
Database The database is a shared collection of logically related data, designed to meet the information needs of an organization.
A database is a computer based record keeping system whose over all purpose is to record and maintains information.
The database holds not only the organization's operational data but also a description of this data. For this reason, a database is also defined as a self describing collection of integrated records.
The description of the data is known as the data dictionary or metadata (data about data). DBMS A Database Management System (DBMS) is a collection of programs that enables users to store, modify and extract information from a database as per the requirements. It acts as an interface between the application program and the operating system to access or manipulate the database.
A database management system is a piece of software that provides services for accessing a database, while maintaining all the required features of the data.
Commercially available database management system in the market are dbase, FoxPro, Oracle, MySQL and DB2 etc.
26.
(a) No. the Roll No attribute in the STUDENT table is marked as primary key and NOT NULL. Therefore, inserting a student record with a missing Roll No value would violate the NOT NULL constraint and is not allowed.
(b) No, because Registration_ID is a candidate key (alternate key) with a NOT NULL constraint in the schema, so it cannot be NULL.
(c) Yes, the SubmissionDate attribute in the PROJECT table does not have a NOT NULL constraint specified in the schema. Therefore, it is possible to insert a project detail without a SubmissionDate value.
(d) No, we cannot perform this operation. ProjectNo in PROJECT ASSIGNED table serves as a foreign key that references the primary key in the PROJECT table. Since ProjectNo "206" is not present in the PROJECT table, it cannot be inserted into the PROJECT ASSIGNED table.
27.
(a) Relation for items and prices:
• Relation CanteenItems
• Attributes ItemID (INT, Primary Key), ItemName (VARCHAR), Price (DECIMAL)
• Restriction Use a Unique constraint on ItemName to ensure each item is stored only once.
(b) Relation for purchases and billing:
• A new relation is required: PurchaseRecords
• Attributes: BillID (INT, Primary Key), ItemlD (INT, Foreign Key referencing CanteenItems), Quantity (INT) Restrictions:
(i) Primary Key BillID (to ensure unique bills).
(ii) Foreign Key ItemlD (to ensure items are available in the canteen).
(c) Storing calories
• The attribute Calories should be stored in the CanteenItems relation since it is related to each item.
• Attribute: Calories (INT).
28.
(i) (A) 4,4
(ii) (C) Stud_id
(iii) (D) 2,2
(iv) (C) Stud_id
(v) (C) T_id
12th Standard CBSE Syllabus & Materials
12th Standard CBSE
CBSE 12th Business Studies Planning Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Business Studies Business Environment Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Business Studies Principles of Management Important Questions And Answers Study Material - QB365 Set A
NCERT Books
Syllabus
Exam Pattern
Sample Question Papers
Previous year Question Papers
Important Notes
MCQ Practice test
NCERT Exemplers
Case study Questions
Image Based Questions
Passage based Questions
HOT Questions
Value Based Questions
Model Questions Papers
NCERT ( Book Back ) Questions
Assertion and Reason
Important Questions And Answers
CBSE 12th Standard CBSE Subjects
CBSE Standards