Introduction to Database Systems and Management

Introduction to Databases (CC103 Intermediate Programming)

Course Information:

  • Institution: Quezon City University (QCU), College of Computer Studies, Information Technology Department.

  • Course Code/Title: CC103 Intermediate Programming / IPT102 – Integrative Programming and Technologies 2.

  • Schedule: Week 10-11.

  • Learning Outcomes: Upon completion of this module, students should be able to discuss databases and explain how data is manipulated within a database.

Overview of Databases

A database is defined as a structured collection of data organized and stored to allow for efficient retrieval and manipulation of information. It can be conceptualized as an electronic filing cabinet, providing a systemic way for users to quickly find and access specific data points. Databases are essential tools for businesses and organizations, serving as the backbone for managing information in areas such as:

  • E-commerce websites

  • Financial systems

  • Healthcare applications

All databases, regardless of their specific type, share two common requirements:

  1. The necessity to store data.

  2. A method of organizing that data to facilitate easy access and manipulation.

Core Types of Databases

1. Relational Databases

This is the most common database type. It utilizes a structured table format to store data.

  • Structure: Uses tables (relations) consisting of rows and columns.

  • Linking: Each table contains a unique key that links it to other tables.

  • Examples: Oracle, MySQL, and Microsoft SQL Server.

  • Language: The most popular type is the Structured Query Language (SQL) database.

2. Object-oriented Databases (OODBs)

These databases store data in the form of objects, mirroring the structure used in object-oriented programming (OOP) languages like Java and Python.

  • Strengths: Better support for complex data structures such as hierarchies and networks compared to traditional relational models.

  • Applications: Computer-aided design (CAD) systems, geographic information systems (GIS), and multimedia systems.

3. NoSQL Databases

NoSQL databases are non-relational and avoid the use of traditional table structures.

  • Data Format: They store data in flexible, unstructured formats.

  • Scalability: Designed for horizontal scalability, meaning capacity is increased by adding more servers rather than upgrading the hardware of a single server (vertical scalability).

  • Use Case: Ideal for big data and real-time web applications.

Detailed Components of Relational Databases

To manage data in a structured manner, relational databases rely on several key components:

  • Tables: The primary structures holding the data. Rows represent individual records, and columns represent specific fields or attributes.

  • Fields: The individual pieces of data within a record representing a single characteristic (e.g., a customer's name, phone number, or address).

  • Primary Keys: A unique identifier for every record in a table. These ensure record uniqueness and allow for precise referencing and updates.

  • Foreign Keys: A reference to a primary key located in a different table. These are used to establish and maintain relationships between disparate data sets.

  • Indexes: Specialized data structures that improve query performance by allowing the system to search for data more rapidly.

  • Constraints: Rules governing data entry to ensure validity and consistency. They are used to enforce data integrity, prevent duplicate entries, and uphold business logic.

Relational Database Management Systems (RDBMS)

An RDBMS is a software application designed to manage and organize data within a relational database. Famous examples include Oracle, MySQL, Microsoft SQL Server, PostgreSQL, and SQLite.

Functions and Features of an RDBMS:
  • Data Definition Language (DDL): Used to create, modify, and delete database objects like tables, indexes, and constraints.

  • Data Manipulation Language (DML): Used to perform actions on the data itself, such as inserting, updating, and deleting records.

  • Query Language: Used to retrieve specific data from tables based on defined criteria.

  • Transaction Management: Ensures data consistency and integrity, maintaining a stable state even during system failures.

  • Backup and Recovery: Facilitates the creation of database backups and the restoration of data in cases of corruption or loss.

Case Study: Object-Oriented Databases in Library Management

Consider the development of a Library Management System to compare relational and object-oriented approaches:

  • Relational Approach: Would require separate, distinct tables for "Books," "Borrowers," and "Loans."

  • Object-Oriented Approach:     * Book Object: Contains attributes like title, author, and publisher.     * Borrower Object: Contains attributes like name, address, and phone number.     * Loan Object: Acts as a connector between the Book and Borrower objects, containing attributes like loan date, return date, and overdue fees.

  • Benefit: This model simplifies the representation of complex relationships and streamlines queries such as "List all overdue books."

Comparative Examples of NoSQL Databases

Database Name

Type

Key Characteristics

MongoDB

Document-oriented

Stores data in JSON-like documents. Flexible, scalable, supports indexing, aggregation, and geospatial queries.

Redis

Key-value store

Known for high speed and flexibility. Supports strings, hashes, sets, pub/sub messaging, and Lua scripting.

Apache Cassandra

Column-family store

Designed for massive data across multiple servers. High availability and fault tolerance. Uses CQL (Cassandra Query Language).

Neo4j

Graph database

Manages relationships between data points. Uses Cypher query language for graph traversal. Used in social networks and fraud detection.

The Critical Role of Databases in Modern Computing

Data-Driven Decision-Making

Databases are vital for business and government decision-making. Analyzing data without a database presents significant challenges in organization and retrieval.

Scalability and Performance

Managing massive data volumes without a database is nearly impossible. Databases provide the framework for large-scale applications to maintain high performance under heavy loads.

Security and Privacy

Sensitive data carries high risks if stored without professional management. Databases offer critical security features:

  • Access Controls: Limiting who can view or edit data.

  • Encryption: Protecting data from unauthorized access.

Future Trends
  • New Technologies: Integration of blockchain and distributed databases.

  • Emerging Use Cases: Databases for the Internet of Things (IoT) and Machine Learning.

  • Ongoing Challenges: Database designers must adapt to evolving needs for speed, security, and complexity.

Supplemental Resources and References

External Links for Practical Application:

  • XAMPP and MySQL setup on Windows: [https://cloudinfrastructureservices.co.uk/how-to-create-a-database-on-windows-using-xampp-and-mysql/]

  • CS Virginia DB Setup: [https://www.cs.virginia.edu/~up3f/cs4750/supplement/DB-setup-xampp.html#section3]

  • GeeksforGeeks Database Operations: [https://www.geeksforgeeks.org/performing-database-operations-in-xampp/]

  • JavaTpoint MySQL Creation: [https://www.javatpoint.com/creating-mysql-database-with-xampp]

  • University of Pittsburgh OODB concepts: [https://people.cs.pitt.edu/~chang/156/19oodb.html]

  • C-Sharp Corner SQL Queries: [https://www.c-sharpcorner.com/article/handling-sql-queries-using-xampp-server/]