Relation Instance The current values (relation instance)of a relation are specified by a table An element t of r is a tuple,represented by a row in a table attributes (or columns) customer name customer street customer_city Jones Main Harrison Smith North Rye tuples Curry North Rye (or rows) Lindsay Park Pittsfield customer Database System Concepts-5th Edition,Oct 5,2006 27 ©Silberschat乜,Korth and Sudarshan
Database System Concepts - 5 2.7 ©Silberschatz, Korth and Sudarshan th Edition, Oct 5, 2006 Relation Instance The current values (relation instance) of a relation are specified by a table An element t of r is a tuple, represented by a row in a table Jones Smith Curry Lindsay customer_name Main North North Park customer_street Harrison Rye Rye Pittsfield customer_city customer attributes (or columns) tuples (or rows)
Relations are Unordered Order of tuples is irrelevant(tuples may be stored in an arbitrary order) Example:account relation with unordered tuples account_number branch_name balance A-101 Downtown 500 A-215 Mianus 700 A-102 Perryridge 400 A-305 Round Hill 350 A-201 Brighton 900 A-222 Redwood 700 A-217 Brighton 750 Database System Concepts-5th Edition,Oct 5,2006 28 ©Silberschat乜,Korth and Sudarshan
Database System Concepts - 5 2.8 ©Silberschatz, Korth and Sudarshan th Edition, Oct 5, 2006 Relations are Unordered Order of tuples is irrelevant (tuples may be stored in an arbitrary order) Example: account relation with unordered tuples
Database A database consists of multiple relations Information about an enterprise is broken up into parts,with each relation storing one part of the information account:stores information about accounts deposifor:stores information about which customer owns which account customer:stores information about customers Storing all information as a single relation such as bank(account number,balance,customer_name,..) results in repetition of information e.g.,if two customers own an account(What gets repeated?) the need for null values e.g.,to represent a customer without an account Normalization theory(Chapter 7)deals with how to design relational schemas Database System Concepts -5th Edition,Oct 5,2006 2.9 ©Silberschat乜,Korth and Sudarshan
Database System Concepts - 5 2.9 ©Silberschatz, Korth and Sudarshan th Edition, Oct 5, 2006 Database A database consists of multiple relations Information about an enterprise is broken up into parts, with each relation storing one part of the information account : stores information about accounts depositor : stores information about which customer owns which account customer : stores information about customers Storing all information as a single relation such as bank(account_number, balance, customer_name, ..) results in repetition of information e.g.,if two customers own an account (What gets repeated?) the need for null values e.g., to represent a customer without an account Normalization theory (Chapter 7) deals with how to design relational schemas
The customer Relation customer_name customer_steet customer_city Adams Spring Pittsfield Brooks Senator Brooklyn Curry North Rye Glenn Sand Hill Woodside Green Walnut Stamford Hayes Main Harrison Johnson Alma Palo alto Jones Main Harrison Lindsay Park Pittsfield Smith North Rye Turner Putnam Stamford Williams Nassau Princeton Database System Concepts-5th Edition,Oct 5,2006 2.10 ©Silberschat乜,Korth and Sudarshan
Database System Concepts - 5 2.10 ©Silberschatz, Korth and Sudarshan th Edition, Oct 5, 2006 The customer Relation
The depositor Relation customer_name account_number Hayes A-102 Johnson A-101 Johnson A-201 Jones A-217 Lindsay A-222 Smith A-215 Turner A-305 Database System Concepts-5th Edition,Oct 5,2006 2.11 ©Silberschat乜,Korth and Sudarshan
Database System Concepts - 5 2.11 ©Silberschatz, Korth and Sudarshan th Edition, Oct 5, 2006 The depositor Relation