Completed

Class 12 CS – SQL & Database Test

Class 12 · Computer Science Mon, 28 Sep 2026 8:00 PM 60s / question 15 questions · 15 marks

Questions From This Challenge

Q1mcq1 mark
A relation STUDENT has 5 attributes and 32 tuples. What are its degree and cardinality?
Degree = 32, Cardinality = 5
Degree = 5, Cardinality = 32 ✓
Degree = 37, Cardinality = 32
Degree = 32, Cardinality = 37
Q2mcq1 mark
Which statement about a candidate key is correct?
It may contain duplicate values
It can uniquely identify each tuple ✓
It must always be a foreign key
It can contain NULL values
Q3mcq1 mark
A table STUDENT has RollNo, Name, Email and Class. RollNo and Email can each uniquely identify every record. If RollNo is selected as the primary key, what is Email?
Foreign key
Alternate key ✓
Composite key
Non-key attribute
Q4mcq1 mark
Which command correctly creates a table named STUDENT with RollNo as the primary key?
CREATE STUDENT (RollNo INT PRIMARY KEY, Name VARCHAR(30));
CREATE TABLE STUDENT (RollNo INT PRIMARY KEY, Name VARCHAR(30)); ✓
CREATE TABLE STUDENT (RollNo PRIMARY, Name VARCHAR(30));
CREATE DATABASE STUDENT (RollNo INT PRIMARY KEY, Name VARCHAR(30));
Q5mcq1 mark
Consider the following records in STUDENT: 101-Amit-85, 102-Riya-72, 103-Neha-91, 104-Karan-68 What is the output of: SELECT Name FROM STUDENT WHERE Marks BETWEEN 70 AND 90;
Amit Riya ✓
Riya Neha
Amit Karan
Riya Karan
Q6output1 mark
Consider the following records in STUDENT:
101-Amit-85, 102-Riya-72, 103-Neha-91, 104-Karan-68

What is the output of:

SELECT Name FROM STUDENT WHERE Marks > 70 AND Marks < 90;
Correct output: Amit Riya
Q7mcq1 mark
Consider the following records in STUDENT: 101-Amit-85, 102-Riya-72, 103-Neha-91, 104-Karan-68 What is the output of: SELECT Name FROM STUDENT WHERE Marks IN (68, 91);
Amit Riya
Neha Karan ✓
Riya Karan
Amit Neha
Q8mcq1 mark
Which command correctly changes the Marks of student 102 to 80?
UPDATE STUDENT SET Marks = 80 WHERE RollNo = 102; ✓
ALTER STUDENT SET Marks = 80 WHERE RollNo = 102;
MODIFY STUDENT Marks = 80 WHERE RollNo = 102;
UPDATE STUDENT Marks = 80 WHERE RollNo = 102;
Q9mcq1 mark
Consider the following records in EMPLOYEE: 1-Amit-45000, 2-Riya-52000, 3-Neha-48000, 4-Karan-52000 What is the output of: SELECT MAX(Salary) FROM EMPLOYEE;
45000
48000
52000 ✓
197000
Q10output1 mark
Consider the following records in EMPLOYEE:
1-Amit-45000, 2-Riya-52000, 3-Neha-48000, 4-Karan-52000

What is the output of:

SELECT AVG(Salary) FROM EMPLOYEE;
Correct output: 49250
Q11mcq1 mark
Consider the following records in STUDENT: 1-Amit-Delhi, 2-Riya-Mumbai, 3-Neha-Delhi, 4-Karan-Pune What is the output of: SELECT Name FROM STUDENT WHERE City IN ('Delhi','Pune');
Amit Neha Karan ✓
Amit Riya
Neha Karan
Amit Riya Neha Karan
Q12mcq1 mark
Consider the following records in STUDENT: 1-Amit-85, 2-Riya-72, 3-Neha-91, 4-Karan-68 What is the output of: SELECT Name FROM STUDENT WHERE Marks >= 85 ORDER BY Name;
Amit Neha ✓
Neha Amit
Amit Karan
Neha Riya
Q13mcq1 mark
Which command correctly adds an Email attribute to the STUDENT table?
ALTER TABLE STUDENT ADD Email VARCHAR(40); ✓
ALTER STUDENT ADD Email VARCHAR(40);
ALTER TABLE STUDENT INSERT Email VARCHAR(40);
UPDATE TABLE STUDENT ADD Email VARCHAR(40);
Q14mcq1 mark
Consider the following records in STUDENT: 1-Amit-NULL, 2-Riya-98765, 3-Neha-NULL, 4-Karan-87654 What is the output of: SELECT COUNT(Phone) FROM STUDENT;
2 ✓
3
4
0
Q15mcq1 mark
Consider the following records in STUDENT: 1-Amit, 2-Riya, 3-Anil, 4-Karan What is the output of: SELECT Name FROM STUDENT WHERE Name LIKE 'A%';
Amit Anil ✓
Amit Karan
Anil Karan
Riya Amit
Next Live Challenge
Mixed: DML + Retrieval - Combined Application
Class 12 · Computer Science Fri, 23 Oct 2026, 9:00 PM
View Live Challenges →

← Back to Live Challenge History · Practice MCQs

CodeBuddy
Hi there! 👋 I'm CodeBuddy, your KV Coders assistant.

To help me give you the most accurate answers, please select your class and subject below, or just type your question!
Buddy is typing...