Understanding Database


(Winkler, 2020)


Defining Database

According to Lutkevich (2023), a database as a structured repository designed for convenient retrieval, organization, and maintenance of data. In the realm of computers, databases commonly store collections of data entries or documents containing details like sales records, customer profiles, financial data, and product specifications.

Lutkevich (2023) also states that databases serve the purpose of maintaining, preserving, and retrieving various types of data, encompassing details about individuals, locations, or objects. This data is compiled into a centralized repository to enable observation and analysis, essentially forming an orderly assembly of information.


Example: 

This figure illustrates a product table, which could serve as an example of a database, including 9 sections (product ID, product name, unit price, sale price, stock quantity, stock sold, total sale, profit). 


Advantages of Database

Improve business processes: As referred to in the figure above, databases make processes easier. Companies gather data on various business operations like sales, order processing, and customer service. They analyze this data to enhance operational efficiency, expand their enterprise, and boost revenue. 

Keep track of customers: Databases frequently house details about individuals, including customers or users. For instance, social media platforms employ databases to retain user information like names, email addresses, and user behaviour. This data is leveraged for content recommendations and enhancing the user experience.

Safeguard personal health information: Healthcare providers rely on databases to securely store personal health information, thereby supporting informed decision-making and the improvement of patient care.

Store personal data: Databases also serve as repositories for personal data. For example, individual users can employ personal cloud storage solutions to manage media, such as photos, within a controlled cloud environment.


Primary and Foreign Keys

"Tables are related to other tables with a primary key or foreign key relationship. Primary and foreign key relationships are used in relational databases to define many-to-one relationships between tables" (IBM, 2021).

In the same article published on the IBM website in 2021, it is also asserted that the essential connections established through primary key/foreign key relationships within tables in a star or snowflake schema often referred to as many-to-one relationships, delineate the routes through which interconnected tables are linked within the database. These linking paths serve as the foundation for constructing queries when working with historical data. For further details regarding many-to-one relationships, please refer to the section on Many-to-one relationships.



Primary Keys

A primary key is a column, or a combination of columns, within a table that serves the distinct purpose of identifying each individual row of data within that table. To illustrate, in the table provided below, CustomerNo, representing the unique ID assigned to various customers, functions as the primary key (Whitehorn, 2022).

Primary keys would be also defined as the element that consists of one or more columns in a table that possess the capability to distinguish each row within that table uniquely. The architecture of a relational database is crafted to ensure the singularity of primary key values, permitting just a solitary row with a particular primary key value in a given table (IBM, 2023).

Whitehorn (2022), use a table to illustrate primary keys:

CUSTOMERS
CustomerNoFirstNameLastName
1SallyThompson
2SallyHenderson
3HarryHenderson
4SandraWellington

Foreign Keys

Further Whitehorn (2022) defines foreign keys as essential columns that reference the primary key columns in different tables within a database. For instance, in the example provided, OrderNo serves as the primary key in the ORDERS table, while CustomerNo acts as a foreign key, linking to the primary key in the CUSTOMERS table.

ORDERS
OrderNoEmployeeNoCustomerNoSupplierPriceItem
1142Harrison$235Desk
241Ford$234Chair
3168Harrison$415Table
42112Ford$350Lamp
5342Ford$234Chair
62112Ford$350Lamp
7242Harrison$235Desk







References: 

Winkler, M (2020) Black and white plastic containers Available at: Black and white plastic containers photo – Free Grey Image on Unsplash (Accessed: 05/09/2023)

IBM (2021) IBM Available at: Primary and foreign keys - IBM Documentation (Accessed: 05/09/2023)

Lutkevich, B (2023) TechTarget Available at: What is a Database? | Definition from TechTarget (Accessed: 05/09/2023)

Whitehorn, M (2022) TechTarget Available at: DBMS keys: 8 types of keys defined | TechTarget (Accessed: 05/09/2023)





Comments

Popular Posts