SQL & PostgreSQL
Joins, window functions, transactions, and query optimization.
What are primary keys, foreign keys and constraints?
Keys identify records and relationships, while constraints tell the database which stored states are allowed. A primary key identifies each row, a foreign key validates a relationship, and other constraints enforce required or unique values and conditions. Database enforcement protects data even when different application paths write concurrently.
What are 1NF, 2NF and 3NF?
Normalization organizes tables so each fact is stored in an appropriate place and changes do not create inconsistent copies. The first three normal forms progressively address repeating groups, dependence on only part of a key, and indirect dependence through other non-key facts. This reduces update, insert and delete anomalies.
Difficulty is an editorial estimate. Completion means you chose to mark a question as understood.