Database Concepts
- Get link
- X
- Other Apps
Database Concepts
1. Introduction to Databases
What is a Database?
- A database is an organized collection of data or information.
- It allows users to easily retrieve, search, and manage information whenever required because data is stored in a predefined and structured manner.
Core Functions of a Database
A well-structured database provides facilities to:
- Retrieve required information easily.
- Take appropriate actions or make decisions based on the stored data.
- Reorganize information according to new requirements.
- Generate reports and extract new insights based on the data.
2. Key Concepts: Data vs. Information
It is important to understand the difference between raw data and meaningful information.
| Feature | Data | Information |
|---|---|---|
| Definition | Facts or details about any object, person, or group. | Data that has been processed, organized, and structured to make it meaningful and useful. |
| Nature | Raw, unorganized facts. Refers to stored values in a database. | Processed data. Refers to the meaning or conclusions drawn from stored values. |
| Examples | A person's name, the weight or price of an item, the ages of students in a class. | The average score of a class (calculated from the raw data of individual student scores). |
3. Types of Databases
Databases are primarily classified into three main types:
- Network Database: Data is represented as a collection of records, and the relationships between the data are shown using links.
- Hierarchical Database: Data is organized in a tree-like structure using "nodes". These nodes are connected to each other via links.
- Relational Database: Also known as a Structured Database. Data is stored in the form of Tables. This is the most common and widely used database type.
4. The Need for Computerized Databases
Manual (hand-written) databases face several challenges, which are solved by using computerized database systems.
| Feature | Manual (Hand-written) Database | Computerized Database |
|---|---|---|
| Updating Data | Very difficult to add new data or modify existing data. | Easy to update, add, or edit data using a computer. |
| Data Retrieval | Hard to find data based on specific conditions. | Desired information can be extracted in seconds. |
| Storage Capacity | Takes up physical space and is hard to manage. | Can store a massive amount of data effortlessly. |
| Speed & Efficiency | Very slow and time-consuming. | High processing speed; generating and printing complex reports takes only minutes. |
| Cost | High maintenance and storage cost over time. | Costs significantly less compared to manual databases. |
5. Components of a Database (Database Objects)
A database is made up of different components, with each component referred to as an Object.
1. Table
- The fundamental building block of a relational database where data is actually stored.
- Made up of intersecting rows and columns that form Cells.
- Various operations are performed on tables: storing, filtering, retrieving, and editing data.
2. Field (Columns)
- Every vertical column in a table is called a Field.
- Each field has a specific name that identifies it and dictates the type of data it holds.
- Examples: Student Name, City, Country, Telephone Number.
3. Record (Rows)
- Every horizontal row in a table is called a Record.
- A record is a complete collection of data across all fields belonging to a single entity (like one specific person or object).
- Example: In a friend's contact table, the entry
(Hradesh, 7869)represents one single record.
4. Queries
- A command given to the database to extract specific data based on rules or conditions.
- Example: Searching for a list of friends who only live in a specific city.
- The data extracted as an answer to a query is called a Dynaset.
5. Forms
- A graphical window or interface used to view, modify, and add new data easily.
- Forms are generally used to view and edit one record at a time, making data entry much simpler than working directly in a table.
6. Reports
- A formatted, printed layout of a dynaset or queried data.
- Used to group, analyze, and present data on paper in a professional format.
6. Application Areas of Databases
Databases are used extensively across various industries:
- Banking: Managing customer details, account information, and loans.
- Universities: Storing student information, grades, and course registrations.
- Airlines: Managing flight schedules and passenger reservations.
- Credit Cards: Tracking purchases and generating monthly transaction reports.
- Telecommunications: Keeping monthly records of calls and generating bills.
- Sales: Storing information about customers, products, and purchases.
- Finance: Managing data regarding sales and purchases.
- Human Resources (HR): Managing employee records, salaries, and taxes.
7. Database Management System (DBMS)
- Definition: A DBMS is specialized software required to create, maintain, and manage computerized databases.
- Purpose: It is a computer-based record-keeping system designed to efficiently store and manage records securely.
8. Core Features of a DBMS
A Database Management System (DBMS) provides a user-friendly environment to store, manage, and retrieve data efficiently. Popular examples include MySQL, INGRES, and MS-ACCESS.
Key operations performed by a DBMS include:
- Creating a new database.
- Inserting or adding new data.
- Editing and updating current data.
- Deleting data temporarily or permanently.
- Searching and retrieving specific information.
- Organizing data systematically.
- Designing and printing attractive, meaningful reports.
9. Architecture of DBMS
The architecture of a DBMS is divided into three levels to separate how data is physically stored from how it is viewed by the user.
| Level Name | Alternative Name | Key Functions & Characteristics |
|---|---|---|
| 1. Internal Level | Physical Level | Describes the physical storage structure of the database. Determines how data is actually stored, arranged, and indexed on the hard drive. |
| 2. Conceptual Level | Logical Level | Represents the entire database structure. Acts as a bridge between the physical and external levels. Describes data types and the relationships between different data elements. |
| 3. External Level | View Level | Deals with how individual users interact with the data. Shows only the specific part of the database that the user needs, hiding the rest. Allows multiple users to access the same database simultaneously without interference. |
10. Advantages of DBMS
Using a computerized DBMS offers significant benefits over manual or traditional file systems:
- Reduction in Data Repetition (Redundancy): All data is kept in one central place, ensuring that a piece of information is stored only once, eliminating duplicate entries.
- Data Consistency: Because data is centralized, the chance of having two different values for the same information is eliminated. Data becomes inconsistent only when it is stored in multiple places and updated in just one.
- Data Sharing: Multiple users and programs can access and use the same data simultaneously, saving immense time and development effort.
- Security of Data: DBMS protects data from unauthorized access and illegal modifications. Only authorized users are granted permission to access the data.
- Data Integrity: Ensures the overall completeness, accuracy, and consistency of data. It guarantees that data remains correct and up-to-date across all records.
11. Limitations of DBMS
Despite its advantages, implementing a DBMS comes with certain challenges and costs:
- High Hardware & Software Costs: Running a DBMS requires high-speed processors and high-capacity memory, which are expensive.
- Complexity: The software is highly complex. Failing to understand the system properly can lead to serious operational failures for an organization.
- Cost of Staff Training: Because the software is complex, organizations must spend a large amount of money on training employees to use it effectively.
- Need for Technical Staff: Organizations must hire highly paid, trained technical experts like Database Administrators (DBA) and Application Programmers, increasing operational costs.
- Risk of Database Failure: Since all data is centralized, a power failure or storage device crash can lead to the loss of highly valuable data and halt the entire system.
12. Relational Databases (RDBMS)
- Definition: A Relational Database stores data in the form of 2-Dimensional Tables (rows and columns).
- These tables are formally known as Relations.
- RDBMS (Relational Database Management System): The specific type of software required to maintain a relational database.
- Key Feature: A single relational database can store multiple tables, and these tables can be linked (related) to one another.
Important Relational Terminology
To master relational databases, you must know these four core terms:
- 1. Relation (Table): A table that represents a sequential file.
- Rows represent records, and Columns represent fields.
- Rules: All records in a relation are of the same type, have the same number of fields, contain a unique identifier, and are arranged in a specific order.
- 2. Tuple (Record): Every individual row or record in a relation is called a Tuple.
- Example: In a parts table,
(P2, Bolt, Green, 15, Paris)is one complete tuple.
- Example: In a parts table,
- 3. Attribute (Field): Every individual column in a relation is called an Attribute.
- Example:
P#(Part Number),P Name,Colour, andWeightare all attributes.
- Example:
- 4. Domain: A specific pool or set of valid values from which a column (attribute) gets its actual data.
(Note: In relational algebra, Tables = Relations, Rows = Tuples, Columns = Attributes).
13. Important Properties of a Relation (Table)
In relational databases, two very important terms define the size and structure of a table:
- Cardinality: The total number of tuples (records/rows) in a relation. (Example: If a table has 5 rows, its cardinality is 5).
- Degree: The total number of attributes (fields/columns) in a relation. (Example: If a table has 4 columns, its degree is 4).
14. Database Keys
Since it is impossible to remember the record numbers of every single entry in a database, we use specific fields called Keys to identify records uniquely.
Types of Keys in a Database
| Key Type | Definition & Features | Exam-Relevant Facts |
|---|---|---|
| 1. Primary Key | An attribute (field) used to uniquely identify each tuple (record) in a relation. | Cannot accept a NULL value. Example: Roll Number, Employee ID. |
| 2. Candidate Key | Sometimes a table has multiple fields that possess unique identifying properties. Each of these potential keys is a Candidate Key. | A relation can have one or more candidate keys. Example: Both S# (Student ID) and SNAME (Student Name) if names are unique. |
| 3. Alternate Key | The candidate key(s) that are not selected as the Primary Key. | Also known as the Secondary Key. Example: If S# is the Primary Key, then SNAME becomes the Alternate Key. |
| 4. Foreign Key | A field (or group of fields) that provides a link between the data of two separate tables. | Its value is derived from the Primary Key of another table. A table can have multiple foreign keys connecting it to different tables. |
| 5. Unique Key | A field used to uniquely identify each tuple in a table. | Unlike a Primary Key, a Unique Key can accept a NULL value. |
15. Database Languages
The commands used to interact with a database are divided into two main categories:
1. Data Definition Language (DDL)
- Purpose: Used to define the characteristics of database objects (like the overall structure, table, and views).
- Action: Deals with the structure of the database, not the actual data inside it.
2. Data Manipulation Language (DML)
- Purpose: Used to manipulate and process the database objects defined by the DDL.
- Action: Used for inserting (adding), deleting, modifying (updating), and retrieving information from the tables.
16. Entity-Relationship (E-R) Model
The E-R Model is used to graphically represent database entities and the relationships between them. The visual diagram is called an E-R Diagram.
Core Components of an E-R Diagram:
- 1. Entity: Represents real-world objects about which data is collected (e.g., Customer, Items). In an E-R diagram, it is represented by a Rectangular Box.
- 2. Attributes: Describe the properties or characteristics of an entity (e.g., Name, Address, Price). In an E-R diagram, attributes are represented by Elliptical (Oval) Boxes.
- 3. Relationship: Shows the logical connection between entities (e.g., Customer buys Items). In an E-R diagram, it is represented by a Diamond-shaped Box.
Entity Sets
An entity set is a collection of entities that share the same properties or characteristics.
- Strong Entity Set: An entity set that possesses a Primary Key.
- Weak Entity Set: An entity set that does not have enough attributes to form a Primary Key.
17. Important Database Terminology (Fast Facts)
- Database Administrator (DBA): A trained computer professional responsible for authorizing access, coordinating, and monitoring database usage. The DBA also acquires the necessary hardware and software.
- Schema: The logical structure of the database.
- Instance: The specific collection of data/information stored in the database at a particular moment in time.
- Data Mining: The process of analyzing data from different perspectives to extract useful information. It is also known as Data or Knowledge Discovery.
- Dr. E.F. Codd: The pioneer who presented the 12 rules for Relational Database Management Systems in the year 1970.
- Data Model: A set of conceptual tools used to describe data, relationships, constraints, and semantics. The three main types are Relational, Network, and Hierarchical Data Models.
Summary / Revision Notes
💡 Quick Takeaways for Exam Prep:
- Database: Organized collection of data for easy search and retrieval.
- Data vs Info: Data = raw facts (e.g., ages). Info = processed data (e.g., average age).
- Three DB Types: Network (links/records), Hierarchical (tree/nodes), Relational (tables).
- Relational DBs: Store data in Tables (rows & columns).
- Database Objects:
- Field: Columns (e.g., "Name").
- Record: Rows (e.g., "John, NY, 12345").
- Table: Collection of fields and records.
- Query: Command to search/filter specific data.
- Form: Screen used to enter/view one record at a time.
- Report: Formatted printout of database information.
- DBMS: Software used to create and maintain databases efficiently.
- Advantages over Manual DB: Extremely fast, stores massive amounts of data, easy to update, and highly cost-effective.
- 3-Tier Architecture:
- Internal: Physical storage.
- Conceptual: Logical structure & relationships.
- External: User-specific views.
- DBMS Pros: Eliminates duplicate data (repetition), ensures accuracy (consistency/integrity), allows multi-user access (sharing), and enforces strong security.
- DBMS Cons: Expensive hardware/software, highly complex, requires costly staff training, necessitates hiring specialized IT staff, and centralized failure can crash the whole system.
- Relational Databases: Store data in 2D Tables.
- Golden Terminology Matching (Crucial for MCQs):
- Relation = Table.
- Tuple = Row / Record.
- Attribute = Column / Field.
- Domain = Set of allowed values for a column.
- Cardinality vs. Degree: Cardinality = Total Rows. Degree = Total Columns.
- Keys Mastery:
- Primary Key: Unique, strictly NO NULLs.
- Unique Key: Unique, but Allows NULLs.
- Candidate Key: Any field capable of being a primary key.
- Alternate (Secondary) Key: The "runner-up" candidate key not chosen as primary.
- Foreign Key: The connector field between two linked tables.
- Languages: DDL is for Structure; DML is for Data manipulation.
- E-R Diagram Shapes (Crucial for MCQs):
- Rectangle = Entity.
- Ellipse/Oval = Attribute.
- Diamond = Relationship.
- Strong vs. Weak Entity: Strong has a primary key; Weak does not.
- Fast Definitions:
- Schema = Logical structure.
- Instance = Data at a specific snapshot in time.
- Data Mining = Knowledge Discovery.
- Get link
- X
- Other Apps
Comments
Post a Comment