Database & SQL Engineering / SQL & RELATIONAL FUNDAMENTALS / SQL-001

SQL Workbench

Explore concept graph

Praktik dan verifikasi mandiri

Project — SQL Workbench

Konsep 1 / 3

Recognize relational tables, rows, primary keys and foreign keys before issuing queries.

Model a distinct transfer T-202 with two new accounts and explain which columns must be keys, foreign keys and exact decimal values.

Kasus yang berbeda dari contoh: Use two different accounts and a different transfer identifier instead of T-100.

Bukti yang bisa kamu periksa

  • A schema diagram plus DDL showing two FKs and a clearly bounded numeric transfer amount.

Jika ingin lanjut

Build the schema and seed rows deterministically in a fresh PostgreSQL database.

Jika terputus: Start with primary keys that identify rows, then foreign keys that link rows.

Konsep 2 / 3

Run a bounded DDL/DML/TCL script via psql twice without duplicating sample data.

In a separate fresh database, add a third valid transfer ID with fixed nominal amount, rerun the modified init script twice and prove the original two fixture IDs were not duplicated.

Kasus yang berbeda dari contoh: A new seed record and fresh database rather than the provided two-transfer example.

Bukti yang bisa kamu periksa

  • psql execution output from an empty database and a second run; inspection counts and schema metadata.

Jika ingin lanjut

Write six SELECT queries and verify the expected schema and rows.

Jika terputus: Check the target database first, then create tables, seed rows and prove repeatability.

Konsep 3 / 3

Run six bounded SQL inspection queries and classify the observed schema/data results.

Run the queries against a different isolated PostgreSQL database initialized with an extra valid transfer, predict the changed transfer count and IDR aggregate, and explain which outputs must remain constant.

Kasus yang berbeda dari contoh: A changed but valid test dataset requiring updated count/amount expectations instead of rereading the unchanged fixture.

Bukti yang bisa kamu periksa

  • Six actual psql SELECT outputs for the new database, prediction and observed difference from the original fixture.
  • Proof that table/key structure stays correct when a valid additional row is inserted.

Jika ingin lanjut

Use these observed relational facts before learning filtering, joins, aggregates and transaction isolation in subsequent SQL units.

Jika terputus: Verify the target schema and table names, then inspect rows, constraints and totals.

Buat database disposable baru; jalankan init.sql dari nol, lalu enam query inspeksi. Laporkan nilai aktual, schema/search_path dan apakah FK benar-benar terpasang. Jalankan ulang init.sql dan bandingkan hasil.

SQL Workbench — six queries and repeatable init.sql

Buat PostgreSQL sandbox dengan accounts dan transfers, jalankan satu init.sql dari database kosong tanpa GUI, tulis dan eksekusi enam query inspeksi, lalu buktikan struktur serta sample rows tetap benar setelah replay.

Latihan manual — jalankan sendiri di lingkunganmu. Kriteria di bawah adalah pemeriksaan mandiri, bukan penilaian otomatis.

Kriteria selesai

  • Sertakan DDL untuk schema cs101_sql001, accounts dan transfers dengan PK dan dua FK yang benar-benar enforced.
  • Run init.sql dari database baru menggunakan psql; catat status sukses dan nama database target.
  • Jalankan enam SELECT terpisah dan catat output aktual: schema, nama tabel, jumlah accounts/transfers, jumlah FK dan total IDR.
  • Jalankan init.sql ulang lalu tunjukkan tidak ada duplikasi row dan keenam hasil tetap identik.
  • Ulang pada database disposable kedua yang kosong untuk membuktikan tidak ada ketergantungan stale state.
  • Jelaskan mengapa IF NOT EXISTS dan ON CONFLICT DO NOTHING bukan jaminan schema migration ataupun payload reconciliation.
  • Bedakan bukti integration PostgreSQL yang sungguhan dari source-check/generator receipt. Jangan memakai koneksi production.

Kriteria verifikasi mandiri

  • Dapat menjelaskan tabel, row, PK/FK dan representasi nominal NUMERIC yang sesuai.
  • Memahami schema qualification/search_path serta kategorisasi DDL, DML, DQL dan TCL.
  • Dapat menjalankan init.sql berulang pada database kosong tanpa GUI dan tanpa row duplikat.
  • Menyediakan enam query beserta hasil nyata dari PostgreSQL, bukan prediksi yang tidak dieksekusi.