Back to the 2021 paper

Unit 1: Database System Architecture

20217m

Consider a two-dimensional integer array of size name that is to be used in your favourite programming language. Using the array as an example, illustrate the difference (i) between the three levels of data abstraction and (ii) between a schema and instances.

Worked SolutionAI Assisted

Using 2D array int A[10][20] as example:

(i) Three levels of data abstraction:

  • Physical level: How array stored in memory - row-major contiguous bytes, address = base + (i*20 + j)*sizeof(int), disk blocks. User unaware.
  • Logical level: How we conceptualize - 2D matrix A[i][j] with rows/cols, data types, operations. Programmer works here.
  • View level: Specific view - e.g., user sees only upper triangle or specific rows via view/projection, hiding rest. Different users see different subsets.

Example mapping to DB: physical = storage structures, logical = tables schema, view = user-specific virtual tables.

(ii) Schema vs Instances:

  • Schema: Overall definition/structure - e.g., int A[10][20]; defines dimensions, type, constraints. Analogous to CREATE TABLE. Does not change frequently (logical schema). Physical schema is storage details.
  • Instances: Actual data content at a point in time - e.g., values stored: A[0][0]=5, A[0][1]=7 ... snapshot. Changes frequently on updates. Like table rows at time t.

If array reinitialized, schema same but instances change.

Similar questions

Budget AppAndroid App

Pocketly on Android

Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.