Database Schema:
- Definition: The database schema is like the blueprint or design of a database. It outlines how the data is organized, what types of data can be stored, and the relationships between different pieces of data.
- Stability: Once designed, the schema doesn’t change frequently. It’s a stable framework that guides how data is stored and accessed.
- Representation: A schema can be visually represented using a schema diagram. This diagram usually shows the names of different data entities (like tables) and their attributes.
Example: Schema Diagram for a Student Database
Student (Name, Student_number, Class, Branch)
Course (Course_name, Course_number, Department)
Database Instances:
- Definition: The data in the database at a specific moment is called a database state or snapshot. This represents the current set of data in the database.
- Variability: Database states can change as we add, delete, or modify records. Each state reflects the current situation of the data.
- Multiple States: Different actions, like inserting a new record or updating an existing one, lead to different states. So, you can have many states of the database while following the same schema.