90 likes | 257 Views
Relational Databases. Overview Immediate access? Unnormalized, 1NF, 2NF, 3NF relational databases Operations for creating new relations-projection and join Indexes Operations for retrieving data from relations. Making Relations out of Relations. Two basic operations: projection and join
E N D
Relational Databases • Overview • Immediate access? • Unnormalized, 1NF, 2NF, 3NF relational databases • Operations for creating new relations-projection and join • Indexes • Operations for retrieving data from relations
Making Relations out of Relations • Two basic operations: projection and join • Projection: selection of the chosen attribute(s), followed by removal of duplicate tuples. • Join: Integration of two relations based on chosen attribute(s).
Projection • A EnrollmentList relation • Project EnrollmentList over Course = ? (Answer for ?) • Project EnrollmentList over Major and Stdname = ?
Join • Two relations: Student and Enrollment • Join Student and Enrollment over Name = ?
Indexes for Immediate Access • If primary key attributes do not perform well for some search functions, it may be appropriate to have an INDEX relation to help such searches. • Ex. Q: List the suppliers for which agent A2 is responsible.
Types of Query • Let A be an attribute, E be an entity, and V be some value • Six types of queries • A(E)=? (ask for the value of an attribute for an entity) • A(?)=V (or !=, >, >=, <, <=) (ask for entities) • ?(E)=V (or !=, >, >=, <, <=) (ask for attributes) • ?(E)=? (ask for all values of all attributes) • A(?)=? (ask for the value of an attribute for all entities) • ?(?)=V (ask for all attributes of all entities for a certain value)
Is immediate access necessary? • Types of access from the user’s viewpoint: • Operational access: need this to access data stores in order to continue the execution of system. • Informational access: need this to get information to make a better decision or performance.
Data Immediate-Access Diagram (DIAD) • One data store may be implemented with more than one database. • Relevant information may be stored in different databases. (How to retrieve them? –SELECT-FROM-WHERE) • DIAD shows the access relationships between these databases.