Manifest Academy

Home › Curriculum › Technical Foundations › SQL for investigation and data analysis

PostgreSQL and SQL for Odoo · 16 min · PostgreSQL 16

SQL for investigation and data analysis

SELECT, JOIN, WHERE, GROUP BY, HAVING and window basics, used safely and read-only to investigate Odoo data.

In this lesson

Key points

Real-world example

The CFO asked why receivables in the balance sheet didn't match the aged receivable report. A SQL sum of amount_residual on receivable account lines grouped by partner revealed one 'unknown' partner with unposted opening entries. Posting them correctly through the UI reconciled both reports.

Questions and answers

What does LEFT JOIN … WHERE right.id IS NULL find?

Rows with no matching row on the right (orphans).

Which command shows a query plan with timings?

EXPLAIN ANALYZE.

Read the full lesson, worked example and quiz