Unit 6: Database Management

icon picker
6.2 Database Operations

Last edited 575 days ago by Makiel [Muh-Keel].

Database Operation

The database operation is an activity through which users and applications access and manipulate data in relational databases.
When users or applications send requests (known as queries) to a database, the result is found and sent back as a response to the origination of the request
Structured query language (SQL) code includes queries to identify what data should be retrieved or how the data should be manipulated.
The DBMS complements the SQL code by providing a mechanism to send the code to and from the database server.

Selection Operation

What It Does: It's like choosing certain items from a big box based on specific rules.
Creating a New Table: Imagine you have a big box full of different toys. Now, you take out some of these toys based on what you like (like only red toys) and put them in a new box. This new box is like the new table created by the selection operation.
User's Role: You decide which toys (rows) to pick from the big box (the original table).
Selection Criterion: This is like the rule you use to pick toys. For example, you might only want toys that are red or are cars.
Testing Each Row: You look at each toy (row) in the big box and decide if it fits your rule. If it does, it goes into the new box.
Using Conditions: The conditions (like "toy is red AND is a car") are like the rules you set for choosing the toys. You use these to decide if a toy should go into your new box.

Union Operations

The Union Operation combines distinct fields from multiple tables that have the same set of attributes and data types. For example, if one column accepts integers and another accepts variable characters, they would not be compatible for a union.
image.png

Joint Operation

In database systems, a Joint Operation is used to combine rows from two or more tables, based on a related column between them.
Basic Concept of Join: A join operation is akin to taking two spreadsheets and lining them up side by side where they have matching information.
Imagine one spreadsheet has employee names and their department IDs, while another has department IDs and names.
A join would combine these two based on the department ID so that you can see both the employee names and their department names together.
Matching Criterion: The join is performed on a specific criterion, typically where a field in one table matches a field in another.
This field is often a key, such as a primary key or a foreign key, that provides a logical connection between the two tables.
Resultant Table: The resultant table after a join contains the rows with columns from both tables. However, it only includes rows where the match condition is satisfied.
For instance, if you're joining on department IDs, only those employees whose department ID in the first table can be found in the second table will appear in the joined table.
image.png

More Databases

NoSQL Database

NoSQL Databases offer a flexible, scalable, and versatile approach to data management, particularly in environments where the nature of data is constantly changing or where data is distributed across multiple servers.

Key-Value Stores

Every item in the database is stored as an attribute name (or "key") along with its value.
Key-value stores are highly partitionable and allow for horizontal scaling, making them ideal for handling large amounts of data distributed across many machines.

Document Databases

These databases store data in documents similar to JSON (JavaScript Object Notation) objects. Each document contains pairs of fields and values.
The document model is more flexible than the traditional column-based model and is well-suited for handling heterogeneous data, data with a variable structure, and large-scale web applications.
Alternative to Traditional Relational Databases:
Traditional relational databases are structured and require a predefined schema (like tables with fixed columns).
This structure is excellent for consistency and integrity of data, but it can be limiting in terms of scalability and handling unstructured data.
NoSQL databases, on the other hand, are more flexible in terms of data models.
They typically allow for a dynamic schema, which is beneficial when dealing with various data types and structures, or when rapid development and iterations are necessary.
Usefulness in Distributed Data Environments:
NoSQL databases are particularly adept at handling large sets of distributed data.
They are designed to scale out by distributing data across many servers, unlike traditional databases that are often scaled up by enhancing the capabilities of a single server.
This distributed nature of NoSQL databases provides high availability and fault tolerance.
They are capable of handling high volume, high velocity, and varied data, making them suitable for big data applications, real-time analytics, and web applications that experience heavy traffic.
image.png

Data Lakes

A Data Lake is a system of data stored in raw format. It is usually a single store of all enterprise data as well as information derived from data during reporting, transactions, or other activities.
Data lakes can include both structured data, such as tables, and unstructured data, such as audio and video recordings.

Distributed Database

A Distributed Database consists of data residing on different machines. For instance, an international corporation might store and maintain local employer records at local sites, yet link those records via a network to create a single, distributed database.

Database Administration

Database management and administration are important functions in any organization that is dependent on one or more databases. It refers to the whole set of activities that ensure all databases are highly available, secure, and scalable.
A majority of the database administration (DBA) responsibilities fall into these categories:
Database security—ensuring that only authorized users have access to the database and fortifying it against unauthorized access
Database tuning—optimizing performance of database systems
High availability—making replicas (copies) of databases available from various locations; if one copy is unavailable due to outage, the alternate location can continue database services
Business continuity—continuing core business operations effectively, even with the disruption of some auxiliary services
Backup and recovery—planning for and executing adequate backup and recovery procedures
Reporting—writing complex queries and generating reports for users
Designing and developing database applications—writing code to interact with the database resources
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.