- LPU MCA Semester 1
- CAP570
- 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.
| Model | Structure |
|---|---|
| Hierarchical | tree, each child has one parent |
| Network | graph of records, a record may have several parents |
| Relational | relations (tables) of rows and columns linked by keys |
| Entity-relationship | entities and relationships, used for design |
| Object-oriented | objects 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
Which statement about schema and instance is correct?
- The schema changes with every update, while the instance stays fixed
- The schema and the instance are two names for the same thing
- The schema changes rarely, but the instance changes with every insert, update or delete
- 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.
A designer wants to show users only some columns of a table without changing the table itself. Which schema level is being designed?
- Internal schema
- External schema
- Conceptual schema
- 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.