Start learning
Explore Bezadome

Learn from the best to be the best.

Find your category

Agribusiness & Cooperative Management

Hospitality, Tourism & Events

Business & Entrepreneurship

Leadership & Career Development

Design, Media & Content Creation

Modern Workplace Skills

Procurement & Logistics

Fashion, Tailoring, Footwear & Accessories

Music, Dance & Sound

Computer & Digital Skills

Sales & Marketing

AI and Digital Productivity

Data and Business Analysis

Fitness, Movement & Wellbeing

Digital Marketing & Social Media

Human Resources & Workplace Safety

Project and Community Impact

Hair, Barbering, Beauty & Salon Services

Public Speaking, Communication & PR

Construction, Property & Facilities Operations

English for Life, Study, Work and Business

Household Services & Care

Customer Care & Service Operations

Energy & Mineral Industries

Finance, Bookkeeping & Money Management

Education, Tutoring & Training Design

Environment, Forestry & Sustainability

IT Support & Software Quality

Languages

Manufacturing & Quality Operations

Office Administration

Retail Operations

Healthcare Administration

Begin with a business question and a safe database copy

15 min estimated lesson time

View full course

Preview progress is not saved.

What this lesson teaches

SQL is a language for asking a relational database to return a precisely defined result.

Where you can use it The model question is “What is completed-order revenue by category in October?” Orders provide status and dates; lines provide quantity and unit price; products provide category.

Key terms in this lesson
Revenue
A teaching measure from completed order lines, not audited accounting revenue or cash collected.
Record
One entry about an item, person or event. Decide what each row represents before counting or combining data.
Field
One named piece of information captured for each record, such as a date or quantity.

Run a first read-only SQLite query

Practise on your own device or app

Use the supplied editable kit and a permitted SQLite editor such as DB Browser for SQLite.

Watch what to do

Start at 0:43 and follow the sample-data setup. Then switch to the course’s own SQLite file and run the practice query.

Course walkthrough · Set up sample data for SQL (opens in a new tab)

Keep this page open while you practise. Return here to compare your result.

Follow the worked example

Create a separate practice database from setup.sql. Open the query editor and run SELECT order_id, status FROM orders WHERE order_id = 101.

Try a changed example

Run the query again for order 104. Save the query separately and compare the result with the supplied practice data.

Check this exercise

Order 104 is completed. Your query shows the order and status. Explain why it cannot answer a question about recorded payment.

How you get feedback Compare your own work with the check.

Understand the method

SQL is a language for asking a relational database to return a precisely defined result. It is not a way to decide which business question matters. Start with the decision: a coordinator wants to know which product groups produced completed-order revenue during a stated month. Define completed, revenue, the date field and the unit of each row before writing code. A row may represent an order, an order line, a payment or a customer; these are different units and cannot be exchanged without changing the answer.

Use a disposable database for learning. A production account may contain customer contacts, employee records or financial information and may permit destructive commands. The course uses SQLite and anonymous supplied tables. The project needs no live business connection. Keep the setup SQL unchanged and save query files separately. If you make an unintended change, rebuild the disposable file from the supplied setup rather than editing production data.

Write a short analysis contract: decision, population, period, table grain, inclusion rule, intended columns and known limitations. This contract makes later tests possible. A plausible total is not enough; the result must answer the agreed question. Export only columns needed by the reader. A result that includes unnecessary personal information is not improved merely because the query runs successfully.

See the method in practice

The model question is “What is completed-order revenue by category in October?” Orders provide status and dates; lines provide quantity and unit price; products provide category. Payments are a different event and are not automatically joined. Revenue here is a teaching measure from completed order lines, not audited accounting revenue or cash collected.

-- Work only in the supplied disposable database.
SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;

Create your first practice database and prove it loaded

  1. Use an existing SQLite editor on your own computer. In DB Browser for SQLite, close any database already open. Keep the extracted setup.sql ready and choose a new filename such as bezadome-sql-practice.db for this exercise.
  2. Choose File, Import, Database from SQL file and select the extracted setup.sql. When asked where to save the database, use your new practice filename. The supplied script creates and fills its tables. Choose Write Changes if offered, then open Execute SQL.
  3. Run SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;. The result should contain lines, orders, payments and products.
  4. Run SELECT COUNT(*) FROM orders; and repeat for lines, payments and products. Write the four counts before analysing anything.
  5. If you see “table already exists,” you imported into an already populated file. Open a fresh disposable database and import once. If you see “no such table,” check which database is open and whether import completed. Save your query text separately from the supplied setup script.
Compare after trying

Expected counts are6orders,8lines,5payments and3products. The setup statement creates the example tables, so use it only for this fresh practice database. Your business analysis queries after setup should use SELECT. If no SQLite editor is available, complete the schema reasoning now and return to execution after a supported editor is available.

DB Browser project guidance on SQL import

Download these steps and worked examples — available in the full lesson. Open full course

Expert demonstration

Watch the sample database setup and first read queries. Then name the operational decision and write the question you want your practice database to answer. Use Bezadome’s separate practice copy and its read-only workflow; no need to install the video’s database.

Assigned clip 0:43–6:24

Learn SQL for Data Analysis in one hour — sample data setup — Chandoo (opens in a new tab)

Which table answers each part of the question?

Before running the query, what result would you check on a few original rows?

Question detail
Which orders were completed in October?
Practice table
Orders
Check
Filter on the stored date and completion status.
Question detail
What is each line worth?
Practice table
Order lines
Check
Use its quantity and unit price in the stated currency.
Question detail
Which category owns each line?
Practice table
Products
Check
Join each line by its product key, then summarise the matched records.
Check your reading

Manually match one completed order line to its product and work out its amount. Compare that row with the read-only query result.

Apply it to your project

Create a query brief for November completed-order revenue using the independent project database. Name the row grain of orders, lines and payments. State why a customer phone number is unnecessary.

Compare your reasoning after trying

The brief uses orders dated in November with status completed and line amounts quantity × unit_price. It distinguishes order revenue from payments and avoids customer contact data. No query should be run on a live system.

YOUR NEXT STEP

Explore the complete course.

Review the curriculum, requirements and enrolment options before you decide.

PASS ON A POSSIBILITY

Share this course

Help a friend or colleague discover their next skill.

Share on WhatsAppChoose who to share with in WhatsApp. You decide what to send.
Recommend to your team by email