Data Management and Programming Concepts
Data Management and Programming Concepts tests how data is organized, queried, and manipulated, plus the building blocks of programs. Expect relational-model questions, simple SQL, and pseudocode tracing.
Core rules
- A database is an organized collection of data; a DBMS is the software that manages it. In the relational model, tables contain rows (records) and columns (fields).
- A primary key uniquely identifies each row and cannot be null. A foreign key is a column that references a primary key in another table, enforcing relationships.
- Normalization reduces redundancy and update anomalies. First normal form requires atomic values; second removes partial dependencies; third removes transitive dependencies.
- SQL: SELECT columns FROM table WHERE condition ORDER BY column; INSERT adds rows; UPDATE changes them; DELETE removes rows; JOIN combines related tables.
- ACID properties: atomicity (all or nothing), consistency (valid states), isolation (concurrent transactions do not interfere), durability (committed changes survive failure).
- A data warehouse supports analysis and reporting; an operational database supports daily transactions. Data mining finds patterns in large data sets.
- Programming constructs: variables and data types; sequence, selection (if/else), and iteration (loops); functions with parameters and return values; arrays for indexed collections.
- Object-oriented concepts: class as a blueprint, object as an instance, encapsulation hides state, inheritance reuses a parent class, polymorphism lets one interface serve different types.
- Error types: syntax errors violate language rules; runtime errors occur during execution; logic errors produce wrong results without crashing.
Worked example
Trace this pseudocode: total = 0; for i = 1 to 4; total = total + i * i; output total. Iterations: i=1 adds 1, i=2 adds 4, i=3 adds 9, i=4 adds 16. Total becomes 30. Reasoning: multiplication happens before addition, and the loop runs four times inclusive. An off-by-one error, such as stopping at 3, would output 14.
Traps
- Confusing primary and foreign keys.
- Using DELETE to remove a table; DROP removes the table structure.
- Confusing assignment (=) with equality (==) in languages that distinguish them.
- Missing the final iteration in a loop trace.
- Treating a logic error as a syntax error.