Skip to content
Question 80 of 95

Q.Rohan is learning to work upon Relational Database Management System (RDBMS) application. Help him to perform the following tasks:

(a) To open the database named "LIBRARY".
(b) To display the names of all the tables stored in the opened database.
(c) To display the structure of the table "BOOKS" existing in the already opened database "LIBRARY".
Karnataka PUCCBSE Class XII Board 2022Subjective· 3mImportance★★★★★
84% · 80/95 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Concept understanding — SQL Query Concepts

SQL Query Concepts — A First Look

Think of a library. You walk in, and instead of wandering through endless shelves, you go to the librarian and say: "Give me all the books by Tagore published after 1950, sorted by title." The librarian knows exactly where everything is, finds what you asked for, and hands you the list. That's what SQL does — but for data stored in a computer.

SQL stands for Structured Query Language. It is the language we use to talk to databases. A database is just a collection of related information stored in tables — like an Excel workbook with multiple sheets, but far more powerful and organised.

The core idea: tables and queries

A database stores data in tables. Each table has rows (records) and columns (fields). For example, a Students table might have columns like RollNo, Name, City, and Marks. Each row is one student's complete information.

A query is simply a question you ask the database. You write it in SQL, and the database returns an answer — usually a new table made from the data that matches your question.

Note

SQL is not a programming language like Python or Java. You don't tell the computer how to find the data. You only say what data you want. The database figures out the fastest way to get it.

The most common SQL command: SELECT

Almost every query begins with SELECT. It means "show me this data." The basic structure is:

SELECT column1, column2 FROM table_name WHERE condition;

Read it like a sentence: "Select these columns from this table where this condition is true."

If you want all columns, you write SELECT *. The asterisk is a shortcut meaning "everything."

Filtering with WHERE

The WHERE clause is your filter. It keeps only the rows that satisfy a condition. For example, if you want students from Delhi only, you write:

SELECT * FROM Students WHERE City = 'Delhi';

You can combine conditions using AND (both must be true) and OR (at least one must be true). This is exactly like everyday logic: "Show me students from Delhi AND who scored above 80."

Sorting with ORDER BY

Data often comes back in no particular order. To arrange it, use ORDER BY. You can sort ascending (smallest first, which is the default) or descending (largest first) using DESC.

SELECT Name, Marks FROM Students ORDER BY Marks DESC;

This gives you a ranked list — highest marks first.

Why SQL matters for commerce and humanities

You will never calculate a formula in SQL. That is not what it does. What SQL does is organise, filter, and retrieve information — and that is the foundation of every data-driven decision. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.