Sonzaschool
Back

O-Level · Secondary 4

ICT

Creating Queries

about 5 minutes to read

Discussions
Topics in this sectionDatabase Queries and Relationships2 topics

Creating Queries in Databases

When you work with large amounts of data stored in tables, you often need to find only specific information rather than looking at everything at once. A query is a question you ask a database that tells it exactly what data you want to see. Queries let you retrieve, sort, and filter information from one or more tables, helping you make sense of raw data quickly.

Imagine you have a database of customers at a market stall in Juba. The database contains a table with columns for customer name, city, amount spent, and product purchased. A query allows you to ask questions like:

  • "Show me only customers who live in Wau"
  • "List all purchases sorted from highest to lowest amount"
  • "Find every customer who bought sorghum and spent more than 5,000 SSP"

Instead of scrolling through hundreds of rows, a query extracts exactly what you need.

Question

In a clinic database in Wau, you want to see only the names of patients who live in the city of Wau. Which SQL clause is used to filter this data?

Sign in to submit your answer and have it count toward your mastery.

Sign in to practice

Tutor

Stuck? Ask me anything about this topic.

Sign in to ask the Sonza AI Tutor about this question.

Sign in to ask

Discussions

No questions yet

Sign in to ask
Loading discussions…