90 likes | 217 Views
This article discusses the fundamental reasons for utilizing databases over simple file storage, addressing issues like redundancy and data integrity. It emphasizes the importance of normalization, transforming data into structured tables to prevent errors. Additionally, it outlines the concept of a data model, which serves as a blueprint for database design, showcasing table relationships and cardinality. Understanding cardinality, especially the common one-to-many relationships, is crucial for effective data management. Finally, the significance of a well-constructed data model is highlighted to avoid poor data quality and unintended consequences.
E N D
Why use a database? Putting all data into a single file simply doesn’t work because- • Redundancy • Insertion/deletion/update problems when all data is in a single file • Data integrity (data can’t be trusted)
Why must a database be “normalized?” Normalization is just a fancy word for “putting the data into tables that make sense and will not cause errors.”
What is a “data model” A data model is like an architectural blueprint for a database. It shows- • Table relationships • The numerical relationships between tables (called “cardinality”) • Table relationship rules (referential Integrity, cascading updates/deletes, etc.)
Why Cardinality? Cardinality is the numerical relationship between tables. It is need to show how the occurrence of one record in a table relates to other tables.
An Example of a 1 to Many relationship For example, a customer order may have many orders but a particular order can only refer to 1 customer. An order can only be associated with one customer but a particular customer can have many orders. This is shown as 1:M
Good News Most cardinalities (the numerical relationship between tables) in a database are- 1:M (one to many)
Any more Cardinalities? The one to one cardinality (1:1) is rarely needed but it is sometimes used for the following reasons- • Security of specific data • Performance (speed of database access)
How important is a data model? Very A poorly constructed data model will likely result in bad data and unintended actions occurring in the database.