40 likes | 188 Views
The winstore is summarized as follows. A customer at the online winestore purchases wines by placing one or more orders Each customer has exactly one set of user details Each customer has a title (such as “ Mr ” or “Dr”) and lives in a country. Each order contains one or more items
E N D
The winstore is summarized as follows • A customer at the online winestore purchases wines by placing one or more orders • Each customer has exactly one set of user details • Each customer has a title (such as “Mr” or “Dr”) and lives in a country. • Each order contains one or more items • Each item has a specific quantity of wine at a specific price • A wine is of a type such as “Red,” “White,” or “Sparkling • A wine has a vintage year; if the same wine has two or more vintages from different years, these are treated as two more distinct wines. • Each wine is made by one winery
The winstore is summarized as follows • Each winery is located in one region • Each wine has one or more grape_variety entries. For example, a sine of wine_name “Archibald” might be made of the grape-variety entries “Sauvignon” and “Cabernet.” The order of entries is important. For example, a “Cabernet Sauvignon” is different from a “Sauvignon Cabernet” • Each inventory for a wine represents the on-hand stock of a wine. If a wine is available at two prices, there are two inventories. Similarly, if the stock arrived at the warehouse at two different times, there are two inventories. • Each wine may have one or more inventories.
users(cust_id, user_name, password) customer(cust_id, surname, firstname, initial, title_id, address, city, state, zipcode, country_id, phone, birth_date) grape_variety(variety_id, variety) inventory(wine_id, inventory_id,on_hand, cost, date_added) items(cust_id, order_id, item_id,wine_id, qty, price) orders(cust_id, order_id, date, instructions, creditcard, expirydate region(region_id, region_name) wine_type(wine_type_id,wine_type) wine(wine_id, wine_name, wine_type, year, winery_id, description) wine_variety(wine_id, variety_id, id,) winery(winery_id, winery_name, region_id) countries(country_id, country)
grape_variety -variety_id (id) -variety inventory -wine_id (id) -inventory_id (id) -on_hand -cost -date_added N region -region_id (id) -region_name wine_variety -wine_id (id) -variety_id (id) -id users -user_name(id) -password 1 M M wine_type -wine_type_id (id) -wine_type wine -wine_id (id) -wine_name -wine_type -year -winery_id -description customer -cust_id (id) -surname -firstname -initial -title_id -address -city -state -zipcode -country-id -phone -birthdate winery -winery_id (id) -winery_name -region_id 1 M M 1 1 items -cust_id (id) -order_id (id) -item_id (id) -wine_id -qty -price M 1 orders -cust_id (id) -order_id (id) -date -instructions -creditcard -expirydate M M 1 countries -country_id (id) -country