Free tutorials & notes in Hindi & English · Clean code examples 🧰 Free PDF & Image Tools →
Notes › Information Technology (402) › Ch 11: Queries in Base
Class X · Part B – Unit 3: Database Management System — Base · Hindi + English

Ch 11: Queries in Base

What is a Query?

Query: a question asked from a database. Based on given criteria, specific records are retrieved from one or more tables and displayed in tabular form (fields as columns, records as rows).

A query lets you pull out exactly the data you need instead of reading the whole table — for example, "show all students who scored more than 90".

Three ways to create a query: 1) Using a Wizard   2) In Design View   3) In SQL View.

Creating a Query using the Wizard

StepWhat you set
1. Field selectionChoose the fields to display.
2. Sorting orderAscending / descending on chosen fields.
3. Search conditionsUp to three conditions ("Match all" / "Match any").
4. Detail or summaryFull data or grouped/summarised.
5. AliasesFriendlier column headings.
6. OverviewCheck the summary and click Finish.
Exam point: the query wizard allows a maximum of three conditions. An Alias is just a friendlier column heading.

Creating a Query in Design View

Create Query in Design View > add the table(s) > double-click fields into the grid. For each field you can set:

RowPurpose
AliasA friendly heading for the column.
SortAscending or descending order.
CriterionThe condition the records must meet.
VisibleWhether the field shows in the result (on by default).

Run the query with F5 or the Run Query button.

Relational operators for criteria: <, >, <=, >=, != and =.

Functions on Numerical Data

In the Function row you can apply: Group, Sum, Average, Count, Minimum, Maximum. For example, Group by category and take the Average of the points.

SQL View

SQL View: the query can be written directly in SQL (Structured Query Language) — useful for advanced or custom queries not possible in the wizard or design grid.

Summary

  • A query retrieves the exact desired records from one or more tables using criteria.
  • Three ways: Wizard, Design View, SQL View.
  • Wizard allows up to 3 conditions; Alias renames a column heading.
  • Relational operators set the criteria; functions (Sum, Average, Count, Min, Max, Group) work on numerical data.

Quick check: 3 MCQs (tap an option)

Q1. The query wizard allows at most how many search conditions?

Q2. Which key runs a query in Base?

Q3. A friendlier column heading in a query is called a/an:

Query क्या है?

Query: database से पूछा गया एक सवाल। दिए गए criteria के आधार पर एक या ज़्यादा tables से specific records निकाले जाते हैं और tabular रूप (fields = columns, records = rows) में दिखते हैं।

Query से आप पूरी table पढ़ने के बजाय ठीक वही data निकालते हैं जो चाहिए — जैसे "90 से ज़्यादा अंक वाले सभी students दिखाओ"।

Query बनाने के तीन तरीके: 1) Wizard से   2) Design View में   3) SQL View में।

Wizard से Query बनाना

Stepक्या set करते हैं
1. Field selectionदिखाने वाले fields चुनिए।
2. Sorting orderचुने fields पर ascending / descending।
3. Search conditionsज़्यादा-से-ज़्यादा तीन conditions ("Match all" / "Match any")।
4. Detail or summaryपूरा data या grouped/summarised।
5. AliasesFriendly column headings।
6. OverviewSummary जाँचकर Finish कीजिए।
Exam point: query wizard में ज़्यादा-से-ज़्यादा तीन conditions लगती हैं। Alias सिर्फ़ एक friendly column heading है।

Design View में Query बनाना

Create Query in Design View > table(s) जोड़िए > fields को grid में double-click कीजिए। हर field के लिए set कर सकते हैं:

Rowकाम
AliasColumn का friendly heading।
SortAscending या descending।
Criterionवो condition जो records पूरी करें।
VisibleField result में दिखे या नहीं (default on)।

Query चलाइए F5 या Run Query button से।

Criteria के relational operators: <, >, <=, >=, != और =।

Numerical Data पर Functions

Function row में लगा सकते हैं: Group, Sum, Average, Count, Minimum, Maximum। जैसे category से Group करके points का Average निकालना।

SQL View

SQL View: query सीधे SQL (Structured Query Language) में लिखी जा सकती है — advanced या custom queries के लिए उपयोगी जो wizard/design grid में संभव नहीं।

सारांश

  • Query criteria से एक या ज़्यादा tables से ठीक चाहे records निकालती है।
  • तीन तरीके: Wizard, Design View, SQL View।
  • Wizard में ज़्यादा-से-ज़्यादा 3 conditions; Alias column heading बदलता है।
  • Relational operators criteria set करते हैं; functions (Sum, Average, Count, Min, Max, Group) numerical data पर काम करते हैं।

झटपट जाँच: 3 MCQs (option पर tap करें)

Q1. Query wizard अधिकतम कितनी search conditions देता है?

Q2. Base में query कौन सी key चलाती है?

Q3. Query में आसान column heading को कहते हैं:

Frequently Asked Questions

What is a query in a database?

A query is a question asked from a database. Based on the given criteria, it retrieves specific records from one or more tables and displays them in a table of rows and columns.

What are the three ways to create a query in LibreOffice Base?

A query can be created using a Wizard, in Design View, or in SQL View where you write the SQL statement directly.

How many conditions does the query wizard allow?

The query wizard allows up to three search conditions, combined with either Match all or Match any.

What is an alias in a query?

An alias is a friendlier heading given to a column in the query result, so the output is easier to read than the raw field name.

How was this lesson?

Your feedback helps us make the content better.

Write a review or suggestion (optional)

After approval, your name and city may appear publicly with your review. Please do not write your email or phone number.

▶ CodingEasily on YouTube

Learn with video lessons in easy Hindi

Featured video: RDBMS Part 3 – Class XI Commerce IT

▶ Subscribe – it’s free