	create table CurrentAuction(
				auctionId integer, 
				productId integer, 
				sellerLogin varchar(20),
				thresholdPrice integer,
				reservePrice integer,
				startDate date,
				closingDate date,
				minIncrement integer,
				location varchar(20)
			    );
				


create table Users(
		   userLogin varchar(20),
		   passwd varchar(20),
		   email varchar(40),
		   sex varchar(10),
		   dob date,
		   firstName varchar(20),
		   lastname varchar(20),
		   address varchar(200),
		   isSuspended varchar(2)
		);

   
	



create table CurrentBid(
			bidId integer,
			auctionId integer,
			bidderLogin varchar(20),
			bidValue integer,
			autobid varchar(1),
			maxAmount integer,
			bidTime date        -- See it  ===============
		      );

create table ParentChild(
			  parentName varchar(30),
			  childName varchar(30),
			  primary key(childname)
			);



-- I am changing the type attribute of picture from blob to varchar
create table Product(
		      productName varchar(40) , 	
		      productId integer,
		      imageURL varchar(40),
		      categoryName varchar(20) references ParentChild,
		      primary key(productId) 
		    );


create table ProductStringAttributes(
				      productId integer references Product ,
				      attributeName varchar(20),
				      attributeValue varchar(20)
				   );

create table ProductIntegerAttributes(
				     productId integer references Product,
				     attributeName varchar(20),
				     attributeValue integer
				    );


create table CategoryFeature(
			     categoryName varchar(30) references ParentChild,
			     featureName varchar(30) ,
			     featureType varchar(30)
			     );





create table BidHistory(
			bidId integer,
			auctionId integer,
			bidderLogin varchar(20),
			bidValue integer,
			autobid varchar(1),
			bidTime date            --see it =================
			);


create table Feedback(
		       auctionId integer,
		       winnerLogin varchar(20),
		       sellerLogin varchar(20),
		       rating varchar(10)
		     );


create table SuccAuctHistory(
			      auctionId integer,
			      productId integer references product, --
			      sellerLogin varchar(20),
			      thresholdPrice integer,
			      reservePrice integer,
			      winnerLogin varchar(20),
			      winnerPrice integer
			      -- productPicture varchar(20) no need of this now
			   );

create table UnsuccAuctHistory(
				auctionId integer, 
				productId integer, 
				sellerLogin varchar(20),
				thresholdPrice integer,
				reservePrice integer,
				startDate date,
				closingDate date,
				minIncrement integer,
				location varchar(20)
			      );				   	
				       	  	  	
				        		 
	






