Day 12 of 14 35 minVIEWFUNCTIONTRIGGER
Put reusable logic inside the database. Save queries as views, write SQL and PL/pgSQL functions, and react to changes automatically with triggers.
By the end of today you can
- Create a view and query it like a table
- Write a SQL function and call it in queries
- Write a PL/pgSQL trigger function
- Attach a trigger that runs on every UPDATE
- Know when database logic helps and when it hides things
What's inside
- 3 sections
- 3 diagrams and mind maps
- 4 code examples you can run
- 4-question quiz
- 1Views: saved queries
- 2Functions: reusable calculations
- 3Triggers: run code on every change
Sign in free to read this lesson
Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.
Sign in free