COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI Data Models COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI
Schemas and Instances • Similar to types and variables in programming languages • Schema – the logical structure of the database – Physical schema: database design at the physical level – Logical schema: database design at the logical level • Instance – the actual content of the database at a particular point in time
Database Schema • Is the description of a database • It is specified during the database design and is not expected to change frequently. • It is represented as a diagram called schema diagram. – A schema diagram displays the structure of each record type but not the actual instance of a record. • Each object in a schema is called a schema construct.
Database Instance • A Database state or instance is the data in the database at a particular moment of time. • Every update operation changes the database from one state to another.
Data models • Integrated collection of concepts for describing data, relationships between data, and constraints on the data in an organization • Data Model comprises: – A structural part – A manipulative part – Possibly a set of integrity rules • Purpose – To represent data in an understandable way
Types of Data models Hierarchical model Network model Relational model Object relational model Object oriented model
Data models 1- Hierarchical model: organizes data in a tree structure Parent child relationship 2- Network model:
Data models 3- Relational model: Each row is unique Each column has a unique name Column values must be of same kind 4- object relational model: complex objects such as time-series and geospatial data diverse binary media such as audio, video, images, and applets
Data models 5- Object oriented model: database functionality to object programming languages
Multi-user DBMS Architectures • Teleprocessing • File-Server • Client-Server
Teleprocessing • Traditional architecture • Single mainframe with a number of terminals attached • Trend is now towards downsizing
File server • File-Server is connected to several workstations across a network • Database resides on file-server • DBMS and applications run on each workstation • Disadvantages includes: – Significant network traffic – Copy of DBMS on each workstation – Concurrency, recovery and integrity control more complex
Client Server • Server holds the database and the DBMS • Client manages user interface and runs applications • Advantages include: – Wider access to existing database – Increased performance – Reduction in communication costs – Increased consistency
Keys • A key is a combination of one or more columns that is used to identify rows in a relation • A composite key is a key that consists of two or more columns • A super key is a combination of columns that uniquely identifies any row within a relational database management system (RDBMS) table.