Write about your understanding of databases. Explore the database advantages and write about database concepts such as primary and foreign keys


A database is an orderly collection of structured data that is commonly stored in a computer system. The database is typically managed by a database management system (DBMS). The combination of the data and the DBMS, along with the associated applications, is known as a database system or simply a database.

In modern databases, data is typically arranged in tables with rows and columns, enabling efficient processing and data querying. This data can be accessed, managed, modified, updated, controlled, and organized with ease. Structured Query Language (SQL) is used in m

ost databases for writing and querying data.


Advantages of Databases

  • Minimum data redundancy
  • Improved data security
  • Increased consistency
  • Lower updating errors
  • Reduced costs of data entry, data storage, and data retrieval
  • Improved data access using host and query languages
  • Higher data integrity from application programs

Concept of databases

A foreign key is a column or a set of columns in a table that refers to the primary key of another table. No special coding or configuration is required to indicate a foreign key.

For example, in the SalesOrderHeader table shown in the diagram below, the column "SalesOrderHeader.CurrencyRateID" is a foreign key because it is related to the "CurrencyRate.CurrencyRateID" column, which serves as the primary key of the CurrencyRate table.



To be considered a relational table, a table must contain a primary key. The primary key is composed of one or more columns whose data uniquely identifies each row in the table. The primary key can be thought of as an address, with each row being a mailbox and the primary key being the street address.

When a primary key consists of multiple columns, the data from each column is used to determine whether a row is unique. Several conditions must hold true for a primary key to be valid. Firstly, the columns must be unique, referring to the data within the rows and not the column names. Additionally, no value in the columns can be blank or NULL.

When defining a table, you must specify its primary key. Each table has only one primary key, and its definition is mandatory. The primary key for each table is stored in an index, which enforces the uniqueness requirement and allows foreign key values to refer back to corresponding primary key values.


Reference

essentialSQL (2015) What is the difference between a primary key and a foreign key?, CodeProject. CodeProject. Available at: https://www.codeproject.com/Articles/1001615/What-is-the-Difference-between-a-Primary-Key-and-a (Accessed: March 16, 2023).

nint, jack anine (2006) What is a database?, What Is a Database | Oracle United Kingdom. Available at: https://www.oracle.com/uk/database/what-is-database/#:~:text=A%20database%20is%20an%20organized,database%20management%20system%20( (Accessed: March 16, 2023).


Joshua, grace (2023) What is database? types, examples and advantages, Intellipaat Blog. Available at: https://intellipaat.com/blog/what-is-database/ (Accessed: March 16, 2023).

Comments

Popular posts from this blog

What is SEO and how is SEO used

Analyse the homepage for 2 E-commerce websites: including comparisons and features improvement

Understanding Meta tags: Definition, meta tag analysis of a webpage of choice and description of each meta tags