E-R Diagram for the Banking Enterprise branch-citi account-number balance branch-name assets account account-branc branch depositor loan-branch customer borrower loan customer-name customer-cit loan-numbe amount customer-street Database System Concepts 3.11 OSilberschatz, Korth and Sudarshan
Database System Concepts 3.11 ©Silberschatz, Korth and Sudarshan E-R Diagram for the Banking Enterprise
Keys K is a superkey of R if values for K are sufficient to identify a unique tuple of each possible relation r(R) by"possible rwe mean a relation r that could exist in the enterprise we are modeling. Example: Icustomer-name, customer-street and Icustomer-name] are both superkeys of Customer, if no two customers can possibly have the same name K is a candidate key if K is minimal Example: Icustomer-name] is a candidate key for Customer, since it is a superkey(assuming no two customers can possibly have the same name), and no subset of it is a superkey Database System Concepts 3.12 OSilberschatz, Korth and Sudarshan
Database System Concepts 3.12 ©Silberschatz, Korth and Sudarshan Keys K is a superkey of R if values for K are sufficient to identify a unique tuple of each possible relation r(R) by “possible r” we mean a relation r that could exist in the enterprise we are modeling. Example: {customer-name, customer-street} and {customer-name} are both superkeys of Customer, if no two customers can possibly have the same name. K is a candidate key if K is minimal Example: {customer-name} is a candidate key for Customer, since it is a superkey (assuming no two customers can possibly have the same name), and no subset of it is a superkey
Determining Keys from E-R Sets Strong entity set. The primary key of the entity set becomes the primary key of the relation Weak entity set. The primary key of the relation consists of the union of the primary key of the strong entity set and the discriminator of the weak entity set. Relationship set. The union of the primary keys of the related entity sets becomes a super key of the relation For binary many-to-one relationship sets, the primary key of the"many"entity set becomes the relations primary key For one-to-one relationship sets, the relation's primary key can be that of either entity set For many-to-many relationship sets, the union of the primary keys becomes the relations primary key Database System Concepts 3.13 OSilberschatz, Korth and Sudarshan
Database System Concepts 3.13 ©Silberschatz, Korth and Sudarshan Determining Keys from E-R Sets Strong entity set. The primary key of the entity set becomes the primary key of the relation. Weak entity set. The primary key of the relation consists of the union of the primary key of the strong entity set and the discriminator of the weak entity set. Relationship set. The union of the primary keys of the related entity sets becomes a super key of the relation. For binary many-to-one relationship sets, the primary key of the “many” entity set becomes the relation’s primary key. For one-to-one relationship sets, the relation’s primary key can be that of either entity set. For many-to-many relationship sets, the union of the primary keys becomes the relation’s primary key
Schema Diagram for the Banking Enterprise branch account depositor customer branch-name account-number ke customer-name customer-name branch-city branch-name account-number customer-street assets balance cuStomer-city loan borrower loan-number customer-name branch-name loan-number amount 标 Database System Concepts 3.14 OSilberschatz, Korth and Sudarshan
Database System Concepts 3.14 ©Silberschatz, Korth and Sudarshan Schema Diagram for the Banking Enterprise
Query Languages Language in which user requests information from the database Categories of languages procedural non-procedural “ Pure"languages: Relational Algebra Tuple Relational Calculus Domain relational calculus Pure languages form underlying basis of query languages that people use Database System Concepts 3.15 OSilberschatz, Korth and Sudarshan
Database System Concepts 3.15 ©Silberschatz, Korth and Sudarshan Query Languages Language in which user requests information from the database. Categories of languages procedural non-procedural “Pure” languages: Relational Algebra Tuple Relational Calculus Domain Relational Calculus Pure languages form underlying basis of query languages that people use