DELETE, TRUNCATE, and DROP in terms of transaction logging, speed, and rollback ability?CASE expression and how would you use it inside a SELECT or ORDER BY clause?DDL, DML, DCL, and TCL, and what does each include?SELECT * generally discouraged in production queries?SELECT happen after WHERE and GROUP BY, and how does this affect using aliases?MERGE statement (upsert), and when would you use it?CHAR vs VARCHAR or the right numeric type?Self-Join, and in what real-world scenario would you use one?JOIN and UNION.JOINs and how do they handle non-matching rows?INNER JOIN and an OUTER JOIN (LEFT/RIGHT/FULL).INNER JOIN and a LEFT JOIN. When would you use a CROSS JOIN or a SELF JOIN in a real-world application?UNION and UNION ALL, and when would you prefer one over the other?CROSS JOIN, and what are the performance risks?INTERSECT and EXCEPT set operators, and how do they differ from a JOIN?ON and USING clauses in a JOIN, and what is a NATURAL JOIN?Nested Loop Join, a Hash Join, and a Merge Join. When would the query optimizer choose one over the others?SQL?ON DELETE CASCADE and ON DELETE SET NULL in terms of data integrity.CHECK, DEFAULT, and NOT NULL constraints, and how do they help enforce data integrity?NULL value?ON DELETE CASCADE in foreign keys, and what are the risks of using them in a complex schema?UUID or Auto-increment ID (Surrogate) versus a Social Security Number or Email (Natural) as a Primary Key?CASCADE, SET NULL, and RESTRICT?UUID versus an auto-incrementing integer as a primary key in a distributed system?WHERE and HAVING, and why can't you use an aggregate function like SUM() in a WHERE clause?GROUP BY and HAVING clauses do, and what are the common aggregate functions like COUNT, SUM, AVG, MIN, and MAX?DISTINCT keyword work, and what are the performance considerations of using it?COUNT(*) differ from COUNT(column) and COUNT(DISTINCT column)?ROLLUP, CUBE, and GROUPING SETS, and when would you use them?Subquery and a Common Table Expression (CTE)? When would you prefer a Recursive CTE?IN and EXISTS, and which is generally more efficient?ANY and ALL operators do in a subquery comparison, and can you give an example?CTE, and when would you choose one over the other?2NF and 3NF. Why might a high-scale production system choose to denormalize certain tables?1NF, 2NF, and 3NF?3NF and BCNF. At what point does a system become 'over-normalized,' and when would you intentionally denormalize a schema?4NF (and 5NF), and what kind of anomaly does it address that BCNF does not?view, and what conditions must a view meet to allow inserts and updates through it?trigger in a relational database, and what are some appropriate use cases and pitfalls of using them?stored procedure and a user-defined function in SQL?cursor, and why is it generally discouraged in favor of set-based operations?Stored Procedures versus the Application Layer, considering maintainability, version control, and database portability?clustered and non-clustered indexes in how data is stored on disk, and why can you only have one clustered index?index seek?EXPLAIN plan, and what is the difference between an Index Seek and an Index Scan?EXPLAIN plan to diagnose a slow-running query?index seek, and when might a full scan actually be preferable?WHERE YEAR(date) = 2024 often prevent index usage?ACID properties and why they are important for a relational database.COMMIT, ROLLBACK, and SAVEPOINT work together?MVCC allow a database to handle concurrent reads and writes without locking the entire table? What are the storage implications of keeping multiple versions of a row?Dirty Read, a Non-repeatable Read, and a Phantom Read, and which isolation levels prevent which?Read Committed' and 'Repeatable Read' in terms of the anomalies they prevent.two-phase commit (2PC) and in what scenario would you need it?Read Committed and Serializable?OLTP and an OLAP database workload?ETL play?OLTP transaction database differ from an OLAP reporting/analytics data warehouse using a star schema?COALESCE and NULLIF do, and how do they help handle NULL values?SQL injection attack, and how do parameterized queries or prepared statements actually solve the problem at the protocol level?NULL values?RANK(), DENSE_RANK(), and ROW_NUMBER()?GRANT and REVOKE commands to secure a microservice's access to a database following the principle of least privilege?OFFSET/LIMIT and keyset (seek) pagination?LAG() and LEAD() window functions work, and what problems do they solve?ROWS/RANGE BETWEEN), and how would you compute a running total or moving average?