Dbms Question w1
Dbms Question w1
Classification of Database:**
- **Database:** A database is an organized collection of structured information or data, typically stored
electronically in a computer system.
- **Relational Databases (RDBMS):** Use tables to store data (e.g., MySQL, PostgreSQL).
- **NoSQL Databases:** Use various data models such as document, key-value, column-family, or graph (e.g.,
MongoDB, Redis).
- **Hierarchical Databases:** Use a tree-like structure (e.g., IBM Information Management System).
- **Categories:**
- **Network Model:** Data is organized in a graph structure with nodes and connections (e.g., Integrated
Data Store).
- **Relational Model:** Data is organized in tables with rows and columns (e.g., SQL databases).
- **Types:**
- **Data Definition Language (DDL):** Defines the structure of the database (e.g., `CREATE`, `ALTER`, `DROP`).
- **Data Manipulation Language (DML):** Handles data manipulation (e.g., `SELECT`, `INSERT`, `UPDATE`, `DELETE`).
- **Data Control Language (DCL):** Manages permissions and access control (e.g., `GRANT`, `REVOKE`).
- **3-Schema Architecture:**
- **Conceptual Schema:** Defines the logical structure of the entire database, independent of physical details.
- **PostgreSQL:** Advanced features, supports complex queries and data types, greater extensibility.
- **Disadvantage:** Limited support for advanced features and complex queries compared to PostgreSQL.
- **One-to-One:** Each entity in the relationship corresponds to exactly one entity in another set.
- **Many-to-Many:** Entities in both sets can relate to multiple entities in the other set.
8. **Types of Integrity Constraints in DBMS with Example:**
- **Entity Integrity:** Ensures primary key uniqueness and non-null values (e.g., `student_id` must be unique).
- **Referential Integrity:** Ensures foreign keys match primary keys in other tables (e.g., `course_id` in
enrollment matches `course_id` in courses).
- **Domain Integrity:** Ensures data values fall within defined limits (e.g., `age` must be between 0 and 120).
- **User-Defined Integrity:** Custom rules specified by users (e.g., a product's `price` must be greater than
zero).