Back to the full dot-point answer
NSWSoftware EngineeringQuick questions
Module 2: Programming for the Web
Quick questions on Databases and SQL explained: HSC Software Engineering Module 2
13short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.
What is schema design?Show answer
Each table represents one kind of thing. Columns are attributes. Rows are individual records.
What is jOIN?Show answer
Combine rows from two tables on a matching column:
What is aggregates and GROUP BY?Show answer
Common aggregate functions: COUNT, SUM, AVG, MIN, MAX.
What is uPDATE?Show answer
Always include a WHERE clause. UPDATE notes SET title = 'X' without WHERE updates every row.
What is dELETE?Show answer
Same warning as UPDATE: never run without WHERE except deliberately.
What is transactions?Show answer
Group multiple statements into one atomic operation:
What is aCID?Show answer
Relational databases guarantee:
What is calling SQL from application code?Show answer
Always use parameterised queries:
What is worked schema?Show answer
A booking site needs users, events and bookings.
What is storing passwords in a column?Show answer
Hash them (see hashing-and-password-storage).
What is concatenating user input into queries?Show answer
Always use parameterised queries.
What is confusing INNER JOIN and LEFT JOIN?Show answer
INNER returns only matching rows. LEFT returns every row from the left side, with NULL where there is no match.
What is forgetting indexes?Show answer
Queries that filter on a column with millions of rows are slow without an index. Index foreign keys and any column you regularly filter on. :::