Database Models

Main IdeaExplanationExamplesKey Terms
Hierarchical ModelData is organized in a tree-like structure with parent-child relationships.File systems, IBM Information Management System (IMS)Tree Structure, Parent-Child
Network ModelData is organized as a graph where records can have multiple parent and child relationships.Integrated Data Store (IDS), IDMSGraph, Many-to-Many Relationships
Relational ModelData is stored in tables (relations) with rows and columns, and relationships are defined using keys.MySQL, PostgreSQL, OracleTables, Primary Key, Foreign Key
Object-Oriented ModelData is stored as objects, similar to object-oriented programming concepts, with attributes and methods.GemStone, ObjectDBObjects, Attributes, Methods
Document ModelData is stored as documents, typically in JSON or XML format, suitable for unstructured or semi-structured data.MongoDB, CouchbaseDocuments, JSON, Collections
Key-Value ModelData is stored as key-value pairs, often used for caching and fast lookups.Redis, DynamoDBKey-Value Pairs, Hashing
Columnar ModelData is stored in columns rather than rows, optimized for analytics and large-scale queries.Apache Cassandra, HBaseColumns, Column Families
Graph ModelData is stored as nodes and edges, representing relationships explicitly.Neo4j, Amazon NeptuneNodes, Edges, Relationships
Time-Series ModelData is organized and optimized for time-stamped data, useful for metrics or logs.InfluxDB, TimescaleDBTime-Stamps, Sequences
Spatial ModelData is designed for spatial data types like maps and geographic locations.PostGIS, ArcGISGIS, Spatial Indexing

Quick Notes:

  1. Hierarchical and Network Models are older models focusing on rigid structures.
  2. Relational Model is widely used and supports SQL.
  3. Object-Oriented and Document Models are ideal for modern applications.
  4. Graph and Time-Series Models are specialized for specific use cases like relationships and logs.

MCQ

Which database model organizes data in a tree-like structure with parent-child relationships?
A) Relational Model
B) Hierarchical Model
C) Network Model
D) Graph Model

Answer: B

In which database model are relationships defined using primary and foreign keys?
A) Network Model
B) Document Model
C) Relational Model
D) Key-Value Model

Answer: C

Which database model is best suited for applications requiring many-to-many relationships?
A) Hierarchical Model
B) Network Model
C) Key-Value Model
D) Columnar Model

Answer: B

In the Document Model, data is commonly stored in which formats?
A) CSV and TSV
B) JSON and XML
C) PDF and TXT
D) SQL and HTML

Answer: B

Which database model is best for unstructured or semi-structured data?
A) Relational Model
B) Document Model
C) Hierarchical Model
D) Network Model

Answer: B

For a social network application, which database model is most suitable to represent relationships?
A) Graph Model
B) Relational Model
C) Key-Value Model
D) Columnar Model

Answer: A

Which database model is optimized for analytics and large-scale queries?
A) Columnar Model
B) Key-Value Model
C) Time-Series Model
D) Object-Oriented Model

Answer: A

Which of the following database models is commonly used for caching due to its simplicity and speed?
A) Document Model
B) Relational Model
C) Key-Value Model
D) Graph Model

Answer: C

In the Hierarchical Model, each child node:
A) Can have multiple parents
B) Can have only one parent
C) Cannot have any parent
D) Has no restrictions on relationships

Answer: B

Which database model stores data as objects with attributes and methods?
A) Object-Oriented Model
B) Columnar Model
C) Document Model
D) Time-Series Model

Answer: A

Which database model is specifically designed to handle geographic and spatial data?
A) Time-Series Model
B) Spatial Model
C) Relational Model
D) Document Model

Answer: B

For metrics and logs organized by timestamps, which database model is most appropriate?
A) Graph Model
B) Time-Series Model
C) Network Model
D) Key-Value Model

Answer: B