CIS 112, Dr. Ladd
Individual observations made in a specific context.
In our context, information is generated by analyzing data.
How else might you store data?
“A Relational Model of Data for Large Shared Data Banks,” IBM Research Lab, 1970
Relational databases don’t depend on the way users will interface with the data, and all of the data can be easily referenced.
“A functional dependency is a relationship between two sets of attributes in a database, where one set (the determinant) determines the values of the other set (the dependent).”
(Building, Number) → (nBed, nBath)
(Building) → (StreetAddress)
This follows the form:
Determinants → Dependents
BUILDING(Building, StreetAddress)
APARTMENT(Building, Number, nBed, nBath)
This is a schema, and it follows the form:
TABLE(PrimaryKey, ForeignKey, Attribute)
Date | Item | Price | Quantity |
---|---|---|---|
8-11-2023 | Apple | $3.99 | 2 |
8-14-2023 | CokeZero | $4.99 | 3 |
8-14-2023 | Apple | $3.99 | 5 |
Which column or set of columns might form the primary key of this table?
Some data (like dates) are better kept together for ease of use and performance reasons, even if that means the database doesn’t follow every normal form. Returning the database to this state is called denormalization.
A bit (binary digit) stores a one or a zero. Data is stored in bytes, a series of 8 bits.
Minimize NULL values to use your storage wisely.
date | item | price | quantity |
---|---|---|---|
8-11-2023 | Apple | $3.99 | 2 |
8-14-2023 | CokeZero | $4.99 | 3 |
8-14-2023 | Apple | $3.99 | 5 |
Relationships can be strong or weak. Weak relationships are existence-dependent.