Module 8 · Integration

Check what you have learned

By the end you will be able to check what you have learned with five independent activities.

About 55 min

0 of 52 lessons

Before you start, you need

Project: query a library database · Practice: master window functions · Practice: modify data inside a transaction · Practice: design a table with rules and an index

How it works

Complete five activities: filters and ordering, joins and summaries, CTEs and window functions, data changes and table design. Each activity runs separately and stores its own result.

Start without hints. If you get stuck, try part of the query and look at what it returns. You can ask for help, but the result will be marked as solved with help.

There is no automatic overall score. Check the status of each block and see which skill you have shown. A correct revenue query does not replace the filtering, data-change or design activities.

If you need to revise, go back to the relevant lesson and then return to the exam. Marking the page as finished is a manual decision: it is not the same as solving its five activities.

Basic queries

Practice

Block 1: filters and ordering

Not started

Show name and stock for available products whose name contains the letter 'o'. Sort by stock descending and name ascending.

Expected result: 5 rows with the columns name, stock, in that order. Keep the row order requested.

View tables and data

Open this panel to see the full data.

Intermediate queries

Assessment by skill

Block 2: relationships and aggregation

Not started

Calculate the amount of non-cancelled orders per customer. Return name and the sum with the alias billing; keep only customers whose sum is above 100. Do not change any data.

Expected result: 6 rows with the columns name, billing, in that order. Row order does not matter.

View tables and data

Open this panel to see the full data.

Block 3: CTEs and window functions

Practice

Block 3: CTEs and window functions

Not started

Using a CTE, number employees per department by salary descending and id ascending. Return department and name for the first position in each group, sorted by department.

Expected result: 5 rows with the columns department, name, in that order. Keep the row order requested.

View tables and data

Open this panel to see the full data.

Advanced queries

Practice

Block 4: a committed change

Not started

Order 102 has been shipped. Open a transaction, change only its status to 'shipped', check id and status, and commit.

We check the full final state: the change you were asked to make and that every other row is untouched. Review the output of each statement too.

Every attempt resets the data, so include all the steps you need to check in a single attempt.

View tables and data

Open this panel to see the full data.

Block 5: design

Practice

Block 5: design

Not started

Create ratings so that each customer can rate a product from 0 to 10 only once, and prepare its index. Use the following columns and rules:

  • id: INTEGER PRIMARY KEY.
  • product_id: INTEGER NOT NULL REFERENCES products(id).
  • customer_id: INTEGER NOT NULL REFERENCES customers(id).
  • score: INTEGER NOT NULL with a CHECK that accepts 0 to 10, both included.
  • A customer can rate each product only once: the pair product_id and customer_id must be unique.
  • Create idx_ratings_product on product_id.

We check the requested structure, the valid rows, the default values and that invalid rows are rejected.

Every attempt resets the data, so include all the steps you need to check in a single attempt.

View tables and data

Open this panel to see the full data.

Result and next steps

Check the status of each activity: pending, solved with help or solved without help. If a skill needs work, go back to its lesson before trying the block again.

  • A correct query shows the skill its block tests.
  • Check rows, missing values and ordering, not just that the query runs.
  • Using hints is recorded as help.
  • Go back to the lesson for any skill you still need to practise.

Next: Choose a path or revise the skills you still need