Anda di halaman 1dari 10

Topic:

Wine Store Database

*) System Requirements:

Before we built the wine store, our client told us what it should do and what features they wanted. Let's take a look at the scope and aims of the wine store that would typically be gathered from interviews, studying workflow, and so on. The wine store sells wines from wineries that are located in regions throughout Australia. The wine store is open to the public: anonymous users have limited access to the application, and users can make purchases if they become members. The wine store carries thousands of wines, and the details of each wine include its name, vintage (year of release), the winery that makes it, grape varieties, and, in some cases, an expert review of the wine. The wine store doesn't do much more than manage members, wines, and ordering. It doesn't have a reporting module, an administration interface, or any content management features. It is not designed to be a fully functional application but only to illustrate most of the fundamental techniques discussed throughout the book.

*) Entities and their attributes:

Wine
wine id wine name Year Descrip tion

Wine Type
Wine type id wine type

Items
item id qty price

Inventory
Inventory id Cost date handed on hand

Winery
Winery id Winery name

Orders
Order id Date Credit card Expiry date Instructo rs

Users
User name Password

Customer
cust id first name surname Birth code

Grape Variety
Variety id Variety

Region Countries
Region id Region name Country id Country

Titles
Title id Title

addres
city Zip code state phone

*) The Wine Store entity-relationship model (ER model):


This model is derived from the system requirements listed and is derived following the process described above also includes a description used in the figure.

*)

Explanation:
The wine store model can be summarized as follows: A customer at the online wine store 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 is 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 or more distinct wines. Each wine is made by one winery. Each winery is located in one region. Each wine has one or more grape variety entries. For example, a wine of wine name "Archibald" might be made of the grape variety entries "Sauvignon" and "Cabernet." The order of the 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.

*)

Wine Store database Relational model:

In this we have mapped our Wine store Entity relationship model (ER model) into relational model As:

Wine: Wine id Wine name year Description Wine type id --------------Cw1 Fw1 Lw1 Winery id ------------1 2 3

W1 W2 W3 Wine type: Wine type id Cw1 Fw1 Lw1

Apple wine Elderberry wine Beer

2012 2012 2011

Country wine Local wine French wine

Wine type Country wine French wine Local wine

Items: Item id Itm1 Itm2 Itm3 Itm4 Inventory: Inventory id Ivt1 Ivt2 Ivt3 Ivt4 Date added 4-06-2011 2-12-2010 6-03-2012 9-02-2012 cost 4500$ 6500$ 6800$ 8540$ On hand 1000$ 1000$ 1000$ 1000$ Wine id -----------W1 W2 W3 W4 qty 6 4 1 3 price 45000$ 652$ 452$ 2001$ Wine id -----------W1 W2 W3 W4 Order id ------------Ord1 Ord2 Ord3 Ord4

Winery: Winery id 1 2 3 4 Orders: Order id Ord1 Ord2 Ord3 Ord4 Users: User name Abdullah Qamar John Red Smith Parker Ahmed ibm Password ******* ******** ******* ******** Date 4-06-2011 2-12-2010 6-03-2012 9-02-2012 Credit card 2398-8162 6510-6258 0751-3830 3212-8624 Expiry date 12-12-2013 12-12-2013 12-03-2013 12-02-2013 Instructors Smith John Khan Sami Cust id ---------Cst1 Cst2 Cst3 Cst4 Winery name Orlando Lindemans Penfolds Hardy Brothers Region id --------------1 2 1 1

Customer: Cust id First name Sur addres name City zip state phone Birth code code Country Title id id ---------Crt1 Crt2 Crt3 Crt4 -------Tle1 Tle2 Tle3 Tle4 User name --------Abdulah Qamar John Red Smith Parker Ahmed ibm

Cst1 Cst2 Cst3 Cst4

Khan Raja Ali Sami

Noor John Ibm Ms

Pkr87 Str25 Krt65 Lrt85

Isb Rwp Lbn Kgp

460 382 850 142

Pak Pak Eur Afr

6520 3820

Brt1 Brt2

46051 Brt3 56804 Brt4

Grape Variety: Variety id Vrd1 Vrd2 Vrd3 Vrd4 Variety Acolon Aspiran limnio Blatina

Region: Region id 1 2 3 Region name Barrosa Valley Yarra Valley Margaret River

Countries: Country id Crt1 Crt2 Crt3 Crt4 Country Pakistan Europe Egypt Libyan

Titles: Title id Tle1 Tle2 Tle3 Tle4 Title


Red grapes

Blue grapes Green grapes Sour grapes

Blending Grape Variety: Wine id W1 W2 W3 W4 Variety id Vrd1 Vrd2 Vrd3 Vrd4

Anda mungkin juga menyukai