9.18.17

Remember these 4 database models: Chronological order) 1)Hierarchical - Tree goes down to 1 branch. A folder can have only 1 parent folder but many children folder. The Company IBM and their product, called DL1/DLI. Very first dms. 2) Network - like a hirearchy except for 1 major difference. It's an updside down tree. A Parent object can only have 1 parent object. Root wont have any, is very base. Branch can have many branches Box adding relationship here to meet is called network Box Relationship Box the above is hirearchy started using in late 70's/80's 3) Relational - Relational theory/Relational database model 4) Object Oriented - Self contained Prof related to class. Object world - look inside prof which will show attributes the symbols cardinalities... COD Codd - the person who came up with the relational - E.F Codd remember *Codd* - he came up with the relational, remember that. Table 3.1 1. A table is a two dimensional structure 2. each table row(tuple) represents a single entity 3. each table column represents an attribute, and each column has a distinct name. attributes go from left to right datamodel shows them going down. Datamodel shows left/right relational tables - every single database model - what principles and rules 4. Each intersection of a row and column represents a single data value 5. Each intersection of a row and column represents a single data value. 6. each column has a range of values known as the attribute domain. 7. the order of the rows and columns 8. each table must have an attribute or combination of attributes that uniquely identifies each row tuple is a row in a table, values for each of its attributes for one instance (of a class, of a prof, whatever) attribute domain is the values that are allowed yada yada UID, a unique identifier - referred to as primary key PK primary key with only 1 is simple, with many is concatinated (teacher calls is concat. book calls it comp. industry calls it compound) remember that. Keys Consist of one or more attributes that determine other attributes used to: ensure that each row in tabl is uniquely identifiable establish relationships among tables and to ensure the integrity of the data primary key (pk) attribute or combination of attributes that uniquely identifies any given row simple: one primary key concatinated/composite-more than 1 how do I find? by looking at primary key Determination State in which knowing the value of one attribute makes it possible to determine the value of another basis for establishing the role of a key based on the relationships among the attributes relationship between attributes Types of keys Null: Absence of any data value that could represent: an unknown attribute value a known, but missing, attribute value an inapplicable condition referential integrity: every reference to an entity instance by another entity instance is valid secondary key: key used strictly for data retreival purposes If you're putting a row in a child .... something something any foreign key field must agree with the primary key that is referenced by the foreign key if attribute within entity is null , don't match, not referential integrity sometimes valid not to enforce referential integrity Value here matches value (if its enforcing referential integrity) Figures 3.2 product can only have at max 1 vendor one vendor can have at most many products a vendor that has more than one product Ch.3 relationships be here early wednesday