In: Computer Science
Please read the business statement below and draw ER, NER.
Business Statement:
The project is about developing an auction Web site. The details
are as follows:
BA is an online auction Web site. People can buy and sell items in this Web site. Buyers are people who like to buy items, and sellers are people who like to sell items.
Each seller can sell items.
Each item has a bidding start time, an end time, and an owner. Sellers are owners of
their item. The start time and end time include the date as well.
Each seller has a first name, last name, contact information, and credit card information. They also have a user name and a password.
Contact information consists of an address, an email, and a telephone.
An address consists of a street number and name, city, state, and zip code.
Credit card information consists of owner name, card number, and expiration date.
Each item has a name, condition, an initial price, a description, quantity, one or more pictures, and an owner.
The condition could be New, Refurbished, or Explained. If the condition of an item is set to Explained, the seller should explain about the item condition in the item description.
Each buyer has a first name and last name, contact information, and credit card information. They also have a user name and a password.
When buyers’ login to Web site, they can go to the list of all available items and then go to the item detail page. Buyers can also search for an item. The application will search through item names for the search phrase.
Buyers can bid on items. Once a bid is made, buyers are accountable for their bid. In other words, buyers cannot simply remove their bid. If they change their mind, all they can do is to update their bid with the price of zero. Of course, they can do that before the auction expires.
After an auction expires, the buyer with the highest bid is the winner.
PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU
NER-Diagram:
Table Schema Diagram:
Table Schemas:
BA is an online auction Web site database:
create table creditCardInfo
(
credit_CardID int
IDENTITY(1000,1) NOT NULL,
credit_CardNo
varchar(16) UNIQUE NOT
NULL,
credit_ExptDate
date
NOT NULL,
credit_OwnerName
varchar(20)
NOT NULL,
PRIMARY KEY(credit_CardID));
create table Address
(
addressID int IDENTITY(1000,1) NOT NULL,
Street
varchar(50)
NOT NULL,
City
varchar(20)
NOT NULL,
State
char(2)
NOT NULL,
ZIP
char(10)
NOT NULL,
primary key (addressID));
create table contactInfo
(
contactID int IDENTITY (100,1) NOT
NULL,
telephone char(10) NOT NULL UNIQUE,
Email varchar(50) NOT NULL UNIQUE,
address_ID int ,
PRIMARY KEY(contactID),
FOREIGN KEY (address_ID) references Address(addressID));
create table seller
(
sellerID INT
IDENTITY(1000,1) NOT NULL,
sellerName
varchar(20) NOT NULL,
sellerUserName varchar(20) UNIQUE,
sellerPassword varchar(32) NOT NULL,
item_ID int NOT
NULL,
contact_ID int NOT NULL,
creditCardID int NOT NULL,
primary key(sellerID),
Foreign Key(contact_ID) references
contactInfo(contactID),
Foreign Key(creditCardID) references
creditCardInfo(credit_CardID));
create table item
(
itemID
int IDENTITY(1000,1) NOT NULL,
itemName
varchar(15)
NOT NULL,
Item_desc
varchar(255),
Item_initialPrice MONEY,
ItemQty
int,
ownerID
int
NOT NULL,
condition
varchar(20)
NOT NULL,
PRIMARY KEY (itemID),
FOREIGN KEY (ownerID) references seller
(sellerID));
create table buyer
(
buyerID
INT IDENTITY(1000,1) NOT NULL,
buyerName
varchar(20)
NOT NULL,
buyerUsername varchar(20)
UNIQUE NOT NULL,
buyerPassowrd
varchar(32)
NOT NULL,
contact_ID
int,
creditCardID int,
primary key(buyerID),
Foreign Key(contact_ID) references
contactInfo(contactID),
Foreign Key(creditCardID) references
creditCardInfo(credit_CardID));
create table buyerItem
(
buyer_ID int NOT NULL,
item_ID int NOT
NULL,
PRIMARY KEY(buyer_ID,item_ID),
FOREIGN KEY (buyer_ID) REFERENCES
buyer(buyerID),
FOREIGN KEY (item_ID) REFERENCES item(itemID));
create table picture
(
pictureID int IDENTITY (1,1) NOT
NULL,
pictureIMG VarBinary(max),
item_ID int,
PRIMARY KEY(pictureID),
FOREIGN KEY(item_ID) references item(itemID));
create table bid
(
bidID
int IDENTITY (1000,1) NOT NULL,
bid_startTime date DEFAULT GETDATE()NOT
NULL,
bid_endTime date
DEFAULT GETDATE()NOT NULL,
item_ID
int
NOT NULL,
PRIMARY KEY(bidID),
Foreign Key(item_ID) references
item(itemID));
create table buyerBid
(
buyer_ID int NOT NULL,
bid_ID int NOT
NULL,
PRIMARY KEY(buyer_ID,bid_ID),
FOREIGN KEY (buyer_ID) REFERENCES
buyer(buyerID),
FOREIGN KEY (bid_ID) REFERENCES bid(bidID));