0% found this document useful (0 votes)
4 views

DBMS_Notes_Unit1_Unit2

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

DBMS_Notes_Unit1_Unit2

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Notes for Unit 1 and Unit 2 (Database Management System)

Unit 1: Introduction to Database Management System

--------------------------------------------------

1. Overview of DBMS:

- A Database Management System (DBMS) is software designed to manage and interact with

databases.

- Purpose: Efficiently store, retrieve, and manipulate data.

- Comparison of DBMS vs File System:

- DBMS provides data abstraction and independence, while file systems lack these features.

- DBMS supports complex queries and data security.

- File systems are prone to data redundancy and inconsistency.

2. Key Concepts of DBMS:

- Database System Concepts:

- A collection of interrelated data and a set of programs to access it.

- Architecture:

- Includes physical, conceptual, and external levels.

- Schema and Instances:

- Schema: The structure/blueprint of the database.

- Instances: Actual data stored at any given time.

- Data Independence:

- Logical and physical separation of data.

3. Database Languages:

- DDL (Data Definition Language): Used to define database schema (e.g., CREATE, ALTER).
- DML (Data Manipulation Language): For data retrieval and manipulation (e.g., SELECT,

INSERT, UPDATE).

4. Data Modeling with ER Model:

- Concepts of ER Model:

- Entities: Objects in the database.

- Attributes: Properties of entities.

- Relationships: Connections between entities.

- Notation for ER Diagrams:

- Symbols for entities, attributes, and relationships.

- Constraints:

- Mapping cardinality (1:1, 1:N, M:N).

- Keys:

- Super Key: A set of attributes uniquely identifying a record.

- Primary Key: A minimal super key.

- Candidate Key: Attributes qualifying to be a primary key.

- Generalization and Specialization:

- Generalization: Combining entities into a higher-level entity.

- Specialization: Dividing entities into subgroups.

- Aggregation:

- Treating relationships as higher-level entities.

- Reduction of ER Diagram to Tables:

- Process of transforming ER components into relational schemas.

- Extended ER Model:

- Incorporates features like inheritance and specialization.

Unit 2: Relational Data Model and SQL


-------------------------------------

1. Relational Data Model:

- Core Concepts:

- Data is stored in tables (relations) consisting of rows (tuples) and columns (attributes).

- Constraints:

- Entity Integrity: No null values for primary keys.

- Referential Integrity: Foreign keys must match primary keys in referenced tables.

- Domain Constraints:

- Values of an attribute must belong to a predefined domain.

- Relational Algebra:

- Operations like selection, projection, union, set difference, Cartesian product.

- Relational Calculus:

- Tuple and domain-oriented query languages.

2. Introduction to SQL:

- Characteristics and Advantages:

- SQL is a high-level query language for relational databases.

- Advantages include user-friendly syntax, portability, and support for large databases.

- SQL Data Types and Commands:

- Data types: INT, VARCHAR, DATE, etc.

- Commands:

- DDL Commands: CREATE, DROP, ALTER.

- DML Commands: SELECT, INSERT, UPDATE, DELETE.

- DCL Commands: GRANT, REVOKE.

- TCL Commands: COMMIT, ROLLBACK.

3. SQL Operators and Queries:


- Aggregate Functions:

- SUM, AVG, COUNT, MAX, MIN.

- Joins:

- INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN.

- Subqueries:

- Nested queries to perform complex operations.

- Union, Intersection, Minus:

- Combining results of multiple queries.

- Views and Indexes:

- Views: Virtual tables created from SQL queries.

- Indexes: Improve query performance.

- Cursors in SQL:

- Mechanism for row-by-row processing of query results.

You might also like