Presentation is loading. Please wait.

Presentation is loading. Please wait.

Your Name Here See Page Notes for Info about Hyperlinks.

Similar presentations


Presentation on theme: "Your Name Here See Page Notes for Info about Hyperlinks."— Presentation transcript:

1 Your Name Here See Page Notes for Info about Hyperlinks

2 Designing an Interactive Web Site Components of the BigHit Online Web Site Data Modeling for BigHit Online –Evaluating the E-R Diagram –Improving the ER Diagram –Using Weak Entity Classes for Many-To-Many Relationship Types –Modeling Shopping Carts and Wish Lists –Modeling to Support Searching for Movies –Final Evaluation of the Conceptual Model Relational Model for BigHit Online Creating a SQL Server Database Web Site Design, Pages, and Flow –Login and Customer Information –Shopping Carts, Searching, and Selecting Items –Checkout and Receipt

3 Components of the BigHit Online Web Site Statement of purpose –BigHit Video Inc. wants to create an information system for online sales of in both DVD and videotape format. People will be allowed to register as customers of the online site and to update their stored information. Information must be maintained about customers’ shipping addresses, e-mail addresses and credit cards. In a single sale, customers will be allowed to purchase any quantity of videos. The items in a single sale will be shipped to a single address and will have a single credit card charge. –A customer will be provided with a virtual shopping cart to store items to be purchased. As each item is selected, it is added to the shopping cart. When the customer finishes shopping, he will be directed to a checkout area where he can purchase all of the items in the shopping cart. At this time, payment and shipping information is entered. Once the sale is complete, the shopping cart will be deleted and the customer will be sent a receipt by e- mail.

4 User-side Requirements The customer side of the Web site must provide these major capabilities: –Customer information: Allow customers to create and edit their own profiles To login and logout –Shopping: Allow customers to search for movies to buy Select movies and place them in a shopping cart View and modify the contents of the shopping cart –Checkout: Allow customers to purchase items in the shopping cart Specify shipping and method of payment Receive both an online and an e-mail receipt –Inquiry: Allow customers to inquire about the status of orders See records of their past purchases Comment on services

5 Business-side Requirements The business side of the Web site provides employees with the information services they need: –Orders: Evaluate orders and Record their status as it changes –Inventory: Evaluate the inventory on hand Add new movies Update movie prices Update the quantities as new movies arrive –Business activity: Analyze the purchasing behavior of customers Evaluate the popularity of movies

6 ER Diagram from Chapter 4

7 Evaluating the E-R Diagram Can an employee evaluate a sale to determine how many items it includes and how much it costs? –Yes and no Can a shipping clerk tell where to ship the items of a sale? –no Is there any way for an employee to record information about packaging and shipping? –no Can an employee determine inventory information such as quantity on hand of particular items? –yes Can a manager extract information about purchasing behavior of customers? –yes Can a manager determine the rate of sales of movies? –yes

8 Improving the ER Diagram Add attribute videoType to Includes relationship types –Represent whether a shopping cart item or sale item is DVD or videotape Add status to Sale class, and qtyShipped to Includes between Sale and Movie –Represent status of shipment What other attributes are needed?

9 Using Weak Entity Classes for Many-To-Many Relationship Types We know that many-to-many relationship types are not directly representable in relational schemas –It is appropriate to modify the ER diagram to eliminate them Create a new weak entity class for each many-to-many relationship type

10 Modeling Shopping Carts and Wish Lists Entity class ShoppingCart is used to represent the customer’s interest in buying items –Modeling almost identical to Sale –No qtyShipped, no billing information, no shipping address Buying process is intended to be –Customer is identified to the system –Customer searches for items –Customer adds items to cart –Customer modifies cart items: delete or change quantity –Customer goes to checkout to buy items in cart A wish list is similar to a shopping cart –Provides a way for a user to remember items for later purchase –May have longer lifetime than a shopping cart –May be shown to other users to allow gift purchases

11 Modeling to Support Searching for Movies The BigHit Online Web site does not have movie searching –Click on “search” and presented with comedy movies Searching should be based on title, genre, date –Also based on people who are involved in production –Also based on similarity and reviews (not shown)

12 Final Evaluation of the Conceptual Model See Figure 13.7

13 Relational Model for BigHit Online Direct translation of ER diagram to relational schema

14 Some SQL to Create Tables create table ShoppingCart ( cartId varchar(16) not null primary key, startDate datetime not null, status varchar(16) not null, lastUpdate datetime nut null, foreign key cartId to Customer(accountId) ) create table CartItem ( cartId varchar(16) not null, line int not null, movieId int not null references Movie(movieId), quantity int not null, videoType char(4) not null, cost money not null, foreign key cartId references ShoppingCart(cartId), primary key (cartId, line) )

15 Creating a SQL Server Database Microsoft Office Professional (with Access) includes SQL Server database –Called MSDE (Microsoft Data Engine) –Separate install from CD directory Once installed, –Open Access database –Choose upsizing wizard –Follow directions Viola!

16 Web Site Design, Pages, and Flow Fundamental design –Navigation through buttons on header of every page No predefined path through pages –Identify the major pages required for user interaction –Identify the SQL statements required to produce each page Typical purchase scenario –Customer logs in –Searches for videos –Adds videos to the shopping cart –Modifies the contents of the shopping cart –Goes to checkout –Reviews purchase –Confirms purchase What’s left out?

17 Login and Customer Information Welcome page includes fields for accountId and passwordWelcome page Checking for login requires –Select * from Customer where accountId=lower(‘JoJo’) JoJo is the accountId entered by customer in Figure 13.13 Once the user has logged in, the information from the select statement is used to produce the customer information pagecustomer information page

18 Shopping Carts, Searching, and Selecting Items Create new shopping cart –insert into ShoppingCart (cartId, startDate, status, lastUpdate) values ('jojo', getdate(),'new', getdate()) Display items in shopping cart –select * from ShoppingCart where cartId = 'jojo' –select line, c.movieId, title, quantity, videoType, cost, quantity*cost as totalCost from cartItem c, Movie m where c.movieId=m.movieId and cartId='jojo' order by title Add items to shopping cart –insert into CartItem (cartId, line, movieId, videoType, quantity,cost) values ('jojo','1','189','dvd',2,39.95) –insert into CartItem (cartId, line, movieId, videoType, quantity,cost) values ('jojo','2',' 987','vhs', 3, 9.99) Search for comedy movies –select * from Movie where genre like '%comedy%' order by title

19 Checkout and Receipt Create new Sale entity –select max(salesId) from Sale // returns 66, e.g. –insert into Sale (salesId,accountId,saleDate,status,totalCost) values (66,'jojo',getdate(),'sold',0) Move items from shopping cart into SaleItem –insert into SaleItem select 66, line, movieId, quantity, videoType, cost, 'pending' from CartItem where cartId='jojo' and quantity<>0 Update total cost in sale –select sum(quantity*cost) from SaleItem where salesId=66 –update Sale set totalCost=112.87 where salesId=66 Update inventory –update Movie set dvdQty=dvdQty-2 where movieId=189 –update Movie set tapeQty=tapeQty-3 where movieId=987 Delete items from shopping cart –delete from cartitem where cartId='jojo' –delete from shoppingcart where cartId='jojo' Produce receipt page (see p. 348)


Download ppt "Your Name Here See Page Notes for Info about Hyperlinks."

Similar presentations


Ads by Google