Download Class 12 Computer Science Practice Worksheets
Explore structured practice materials through the CBSE Class 12 Computer Science SQL Worksheet Set 02. Tailored for Class 12 learners, utilizing these Computer Science worksheets ensures thorough preparation and strengthens problem-solving accuracy before final school evaluations.
Access SQL Practice Papers and Solutions
Access the complete worksheet PDF for Class 12 Computer Science below. Regular practice with these targeted academic tasks builds familiarity with standard question patterns and helps secure higher marks in final school examinations.
Question 1. Define degree and cardinality of a table.
Answer: Degree of a table: The total number of attributes (columns) present in a table is known as its degree.
Cardinality of a table: The total number of tuples (rows) present in a table, excluding the header row, is known as its cardinality.
In simple words: Degree counts the columns, and cardinality counts the rows.
Exam Tip: Remember that degree starts with D for Dimensions/Columns, and cardinality starts with C for Count of rows.
Question 2. Differentiate between DML and DDL.
Answer: DDL stands for Data Definition Language. It is used to define, modify, or delete database structure and schema objects (e.g., CREATE, ALTER, DROP).
DML stands for Data Manipulation Language. It is used to retrieve, store, modify, delete, insert, and update data inside database tables (e.g., SELECT, INSERT, UPDATE, DELETE).
In simple words: DDL manages the table structure, while DML manages the data inside the tables.
Exam Tip: Always give examples of commands (like CREATE for DDL and INSERT for DML) to secure full marks.
Question 3. Consider the following tables ACTIVITY and COACH and answer the questions.
Table: ACTIVITY
| Acode | Activity Name | Stadium | Participants Number | Prize Money | Schedule Date |
|---|---|---|---|---|---|
| 1001 | Relay | Star Annex | 16 | 10000 | 23-Jan-2004 |
| 1002 | High Jump | Star Annex | 10 | 12000 | 12-Dec-2003 |
| 1003 | Shot Put | Super Power | 12 | 8000 | 14-Feb-2004 |
| 1005 | Long Jump | Star Annex | 12 | 9000 | 01-Jan-2004 |
| 1008 | Discuss Throw | Super Power | 10 | 15000 | 19-Mar-2004 |
Table: COACH
| PCode | Name | Acode |
|---|---|---|
| 1 | Ahmed Hussain | 1001 |
| 2 | Rvinder | 1008 |
| 3 | Janila | 1001 |
| 4 | Naaz | 1003 |
Write the SQL commands for the following statements:
(1) To display the names of all activities with their Acodes in descending order.
Answer: SELECT ActivityName, Acode FROM ACTIVITY ORDER BY Acode DESC;
In simple words: Select the activity name and code columns, then sort the output in descending order of Acode.
Exam Tip: Always use DESC explicitly for descending order; ASC is default.
(2) To display the sum of PrizeMoney for the activities played in each of the Stadium separately.
Answer: SELECT Stadium, SUM(PrizeMoney) FROM ACTIVITY GROUP BY Stadium;
In simple words: Group rows by stadium and calculate the total prize money for each group.
Exam Tip: Whenever phrases like "for each" appear, use GROUP BY.
(3) To display the coach's name and Acodes in ascending order of Acode from the table Coach.
Answer: SELECT Name, Acode FROM COACH ORDER BY Acode ASC;
In simple words: Retrieve coach names and codes, sorted by code from lowest to highest.
Exam Tip: ORDER BY defaults to ascending if ASC or DESC is omitted, but writing ASC is safe practice.
(4) To display the contents of the Activity Table whose ScheduleDate earlier than 01/01/2004 in ascending order of ParticipantsNum.
Answer: SELECT * FROM ACTIVITY WHERE ScheduleDate < '01-Jan-2004' ORDER BY ParticipantsNum ASC;
In simple words: Fetch all columns for rows where the date is before January 1, 2004, ordered by participants.
Exam Tip: Match date formats exactly with how they are stored in the table.
Give the output of the following SQL queries:
(1) SELECT COUNT(DISTINCT ParticipantNum) FROM ACTIVITY;
Answer:
COUNT(DISTINCT ParticipantNum)
----------------------------
3
In simple words: Counts unique participant values (16, 10, 12), which gives 3 distinct values.
Exam Tip: DISTINCT filters out duplicate values before counting.
(2) SELECT MAX(ScheduleDate), MIN(ScheduleDate) FROM ACTIVITY;
Answer:
MAX(ScheduleDate) | MIN(ScheduleDate)
-------------------------------------
19-Mar-2004 | 12-Dec-2003
In simple words: Finds the latest date and earliest date among all scheduled activities.
Exam Tip: Aggregate functions MAX and MIN work on date types chronologically.
(3) SELECT Name, ActivityName FROM ACTIVITY A, COACH C WHERE A.Acode=C.Acode AND A.ParticipantsNumber=10;
Answer:
Name | ActivityName
----------------------------
Ahmed Hussain | High Jump
Janila | High Jump
Rvinder | Discuss Throw
In simple words: Joins coach and activity tables where participant count is 10 and Acodes match.
Exam Tip: Carefully trace Cartesian products and apply conditions step-by-step.
(4) SELECT DISTINCT(ParticipantsNumber) FROM ACTIVITY;
Answer:
ParticipantsNumber
------------------
16
10
12
In simple words: Returns unique values from the participant numbers column without duplicates.
Exam Tip: DISTINCT eliminates duplicate rows in projection results.
Question 4. Consider the following tables GAMES and PLAYER and answer the questions.
Table: GAMES
| Gcode | Game Name | Type | Number | Prize Money | Schedule Date |
|---|---|---|---|---|---|
| 101 | Carrom Board | Indoor | 16 | 5000 | 23-Jan-2004 |
| 102 | Badminton | Outdoor | 10 | 12000 | 12-Dec-2003 |
| 103 | Table Tennis | Indoor | 12 | 8000 | 14-Feb-2004 |
| 105 | Chess | Indoor | 12 | 9000 | 01-Jan-2004 |
| 108 | Lawn Tennis | Outdoor | 10 | 25000 | 19-Mar-2004 |
Table: PLAYER
| PCode | Name | Gcode |
|---|---|---|
| 1 | Nabi Ahmed | 101 |
| 2 | Ravi Sahai | 108 |
| 3 | Jatin | 101 |
| 4 | Naveen | 103 |
Write the SQL commands for the following statements:
(1) To display the names of all GAMES with their Gcodes.
Answer: SELECT GameName, Gcode FROM GAMES;
In simple words: Select the game name and game code columns from the GAMES table.
Exam Tip: Keep column selection order as requested in the prompt.
(2) To display the details of those GAMES which are having PrizeMoney more than 7000.
Answer: SELECT * FROM GAMES WHERE PrizeMoney > 7000;
In simple words: Retrieve all columns for games where prize money exceeds 7000.
Exam Tip: Use asterisk (*) when all details/columns are requested.
(3) To display the content of the GAMES table in ascending order of ScheduleDate.
Answer: SELECT * FROM GAMES ORDER BY ScheduleDate ASC;
In simple words: Fetch all records from GAMES and sort them chronologically by schedule date.
Exam Tip: ORDER BY ASC correctly organizes dates from earliest to latest.
(4) To display the sum of PrizeMoney from each type of Game.
Answer: SELECT Type, SUM(PrizeMoney) FROM GAMES GROUP BY Type;
In simple words: Group games by their type (Indoor/Outdoor) and calculate total prize money for each group.
Exam Tip: Aggregate functions like SUM require GROUP BY on the categorical column.
Give the output of the following SQL queries:
(1) SELECT COUNT(DISTINCT Number) FROM GAMES;
Answer:
COUNT(DISTINCT Number)
----------------------
3
In simple words: Counts unique values in the Number column (16, 10, 12), resulting in 3.
Exam Tip: DISTINCT removes duplicate counts.
(2) SELECT MAX(ScheduleDate), MIN(ScheduleDate) FROM GAMES;
Answer:
MAX(ScheduleDate) | MIN(ScheduleDate)
-------------------------------------
19-Mar-2004 | 12-Dec-2003
In simple words: Displays the latest and earliest dates present in the GAMES table.
Exam Tip: MIN and MAX functions work seamlessly on date data types.
(3) SELECT Name, GameName FROM GAMES G, PLAYER P WHERE G.Gcode=P.Gcode AND PrizeMoney>10000;
Answer:
Name | GameName
------------------------
Ravi Sahai | Lawn Tennis
In simple words: Joins player and game tables where prize money is greater than 10000 and matching Gcodes are found.
Exam Tip: Verify foreign key relationships and numerical thresholds carefully.
(4) SELECT DISTINCT(Gcode) FROM PLAYER;
Answer:
Gcode
-----
101
108
103
In simple words: Retrieves unique game codes from the PLAYER table without duplicates.
Exam Tip: DISTINCT eliminates repeating Gcodes assigned to multiple players.
Free study material for Computer Science
SQL Printable Worksheets and Exercises for Class 12 Computer Science
Daily Practice Questions for Class 12 Computer Science
Review targeted practice exercises for Class 12 Computer Science SQL. Curated to match official CBSE guidelines, these printable problem sets support daily revision and improve overall test readiness.
Detailed Answers for Class 12 Computer Science SQL
Built using official NCERT guidelines for Class 12 Computer Science, these practice sheets provide reliable academic support. Cross-reference your completed work with our detailed solutions to learn standard answer-writing formats for CBSE exams.
Complete Your Chapter Revision
Consistent engagement with these exercises builds familiarity with recurring exam themes. If specific areas within SQL cause trouble, utilize our dedicated NCERT solutions for Class 12 Computer Science to clear up doubts immediately.
FAQs
You can download the latest chapter-wise printable worksheets for Class 12 Computer Science SQL for free from StudiesToday.com. These have been made as per the latest CBSE curriculum for this academic year.
Yes, Class 12 Computer Science worksheets for SQL focus on activity-based learning and also competency-style questions. This helps students to apply theoretical knowledge to practical scenarios.
Yes, we have provided solved worksheets for Class 12 Computer Science SQL to help students verify their answers instantly.
Yes, our Class 12 Computer Science test sheets are mobile-friendly PDFs and can be printed by teachers for classroom.
For SQL, regular practice with our worksheets will improve question-handling speed and help students understand all technical terms and diagrams.