Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Practice › Class 12 › Computer Science

Databases and SQL: practice questions

Class 12 Computer Science. Ten questions with step-by-step answers, for CBSE and ICSE. Try each one before you open its answer.

Practise this with your AI tutorGo to the questions

Key ideas

  • SELECT, WHERE and COUNT.
  • These are the multi-step questions examiners like to set. Read each one twice, write down what you know, then plan before you calculate.
  • These go beyond the syllabus. Each one has a neat idea that makes it short; brute force is slow.

Read each question twice and say the answer out loud before you check it. For code or binary questions, work it out on paper step by step, the way a computer would.

Ten questions

  1. 1.Table students has ages 17, 14, 17, 14, 14, 12. SELECT COUNT(*) FROM students WHERE age > 13;

    Show the answer

    Think: Strictly greater than 13.

    Work: Count rows that pass the WHERE test.

    Answer: 5

  2. 2.Table students has ages 11, 11, 14, 11, 17, 11. SELECT COUNT(*) FROM students WHERE age > 15;

    Show the answer

    Think: Strictly greater than 15.

    Work: Count rows that pass the WHERE test.

    Answer: 1

  3. 3.Table students has ages 10, 18, 17, 11, 14, 14. SELECT COUNT(*) FROM students WHERE age > 14;

    Show the answer

    Think: Strictly greater than 14.

    Work: Count rows that pass the WHERE test.

    Answer: 2

  4. 4.Table students has ages 17, 12, 17, 18, 17, 18. SELECT COUNT(*) FROM students WHERE age > 15;

    Show the answer

    Think: Strictly greater than 15.

    Work: Count rows that pass the WHERE test.

    Answer: 5

  5. 5.Table students has ages 11, 11, 13, 10, 17, 15. SELECT COUNT(*) FROM students WHERE age > 12;

    Show the answer

    Think: Strictly greater than 12.

    Work: Count rows that pass the WHERE test.

    Answer: 3

  6. 6.Table students has ages 16, 10, 17, 18, 13, 11. SELECT COUNT(*) FROM students WHERE age > 13;

    Show the answer

    Think: Strictly greater than 13.

    Work: Count rows that pass the WHERE test.

    Answer: 3

  7. 7.Table students has ages 15, 12, 17, 14, 13, 11. SELECT COUNT(*) FROM students WHERE age > 13;

    Show the answer

    Think: Strictly greater than 13.

    Work: Count rows that pass the WHERE test.

    Answer: 3

  8. 8.Table students has ages 16, 13, 15, 15, 16, 18. SELECT COUNT(*) FROM students WHERE age > 14;

    Show the answer

    Think: Strictly greater than 14.

    Work: Count rows that pass the WHERE test.

    Answer: 5

  9. 9.Table students has ages 16, 14, 17, 15, 16, 17. SELECT COUNT(*) FROM students WHERE age > 15;

    Show the answer

    Think: Strictly greater than 15.

    Work: Count rows that pass the WHERE test.

    Answer: 4

  10. 10.Table students has ages 17, 11, 12, 18, 15, 12. SELECT COUNT(*) FROM students WHERE age > 15;

    Show the answer

    Think: Strictly greater than 15.

    Work: Count rows that pass the WHERE test.

    Answer: 2

Before you check an answer

  • Strictly greater than 13.
  • Strictly greater than 15.
  • Strictly greater than 14.
  • Strictly greater than 12.

Questions students ask

What does Databases and SQL in Class 12 Computer Science cover?
SELECT, WHERE and COUNT. These are the multi-step questions examiners like to set. Read each one twice, write down what you know, then plan before you calculate. These go beyond the syllabus. Each one has a neat idea that makes it short; brute force is slow.
How should I practise Databases and SQL?
Read each question twice and say the answer out loud before you check it. For code or binary questions, work it out on paper step by step, the way a computer would. Try all ten questions on this page, then open the chapter in Gradient tuition for step-by-step lessons, a live experiment and an AI tutor who explains where you went wrong.
Is this for CBSE or ICSE?
The questions follow the Class 12 Computer Science syllabus shared by CBSE and ICSE / ISC, and suit most state boards too.

Stuck on one of these?

Gradient tuition teaches Databases and SQL step by step, with experiments you can play with and an AI tutor who circles the part of the question you missed.

Open Databases and SQL in tuition
Searching and sortingComputer networks