1. LPU MCA Semester 1
  2. CAP570
  3. Unit 1

CAP570 · Unit 1: Basics of database

Database schemas and types of data models

10 practice questions · in the MTE and ETE syllabus

Key points

  • Schema is the structure, instance is the content at a moment
  • Schema uses DDL, data changes use DML
  • The relational model uses tables joined by keys
  • Views belong to the external level

The schema is the overall design of the database: tables, columns, types, keys and constraints. It changes rarely. The instance is the data stored at a particular moment and changes with every insert, update or delete. A schema is defined with DDL, while instances are changed with DML.

A data model is the set of concepts used to describe structure, relationships and constraints.

ModelStructure
Hierarchicaltree, each child has one parent
Networkgraph of records, a record may have several parents
Relationalrelations (tables) of rows and columns linked by keys
Entity-relationshipentities and relationships, used for design
Object-orientedobjects bundling data with methods

The three schema levels are the external schema (views), the conceptual schema (whole logical design) and the internal schema (storage). A view is a virtual table defined by a query, so it belongs to the external level.

Exam trap: inserting rows changes the instance, never the schema.

Try two questions

Question 1 · Tier 2, Understand

Which statement about schema and instance is correct?

  1. The schema changes with every update, while the instance stays fixed
  2. The schema and the instance are two names for the same thing
  3. The schema changes rarely, but the instance changes with every insert, update or delete
  4. The instance is defined with DDL statements, while the schema is changed with DML statements
Show the answer

C. A schema is a stable description, whereas the instance is the changing content.

Why not A: This swaps the two ideas.

Why not B: They are different concepts.

Why not D: The schema is defined with DDL; the instance is what DML changes.

Question 2 · Tier 3, Apply

A designer wants to show users only some columns of a table without changing the table itself. Which schema level is being designed?

  1. Internal schema
  2. External schema
  3. Conceptual schema
  4. Physical schema
Show the answer

B. External schemas, or views, expose tailored subsets of the data to user groups.

Why not A: The internal schema describes storage, not user views.

Why not C: The conceptual schema describes the full logical structure of the database.

Why not D: The physical schema covers storage structures and is not about user views.