Ch 11: Queries in Base
What is a Query?
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".
Creating a Query using the Wizard
| Step | What you set |
|---|---|
| 1. Field selection | Choose the fields to display. |
| 2. Sorting order | Ascending / descending on chosen fields. |
| 3. Search conditions | Up to three conditions ("Match all" / "Match any"). |
| 4. Detail or summary | Full data or grouped/summarised. |
| 5. Aliases | Friendlier column headings. |
| 6. Overview | Check the summary and click Finish. |
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:
| Row | Purpose |
|---|---|
| Alias | A friendly heading for the column. |
| Sort | Ascending or descending order. |
| Criterion | The condition the records must meet. |
| Visible | Whether the field shows in the result (on by default). |
Run the query with F5 or the Run Query button.
<, >, <=, >=, != 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
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?
Use Design View or SQL View for more.
Q2. Which key runs a query in Base?
F5 or the Run Query button.
Q3. A friendlier column heading in a query is called a/an:
Aliases rename columns only in the output.
Query क्या है?
Query से आप पूरी table पढ़ने के बजाय ठीक वही data निकालते हैं जो चाहिए — जैसे "90 से ज़्यादा अंक वाले सभी students दिखाओ"।
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. Aliases | Friendly column headings। |
| 6. Overview | Summary जाँचकर Finish कीजिए। |
Design View में Query बनाना
Create Query in Design View > table(s) जोड़िए > fields को grid में double-click कीजिए। हर field के लिए set कर सकते हैं:
| Row | काम |
|---|---|
| Alias | Column का friendly heading। |
| Sort | Ascending या descending। |
| Criterion | वो condition जो records पूरी करें। |
| Visible | Field result में दिखे या नहीं (default on)। |
Query चलाइए F5 या Run Query button से।
<, >, <=, >=, != और =।Numerical Data पर Functions
Function row में लगा सकते हैं: Group, Sum, Average, Count, Minimum, Maximum। जैसे category से Group करके points का Average निकालना।
SQL View
सारांश
- 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 देता है?
ज़्यादा के लिए Design View या SQL View।
Q2. Base में query कौन सी key चलाती है?
F5 या Run Query button।
Q3. Query में आसान column heading को कहते हैं:
Alias सिर्फ़ output में column का नाम बदलता है।
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.
