9 Replies - 604 Views - Last Post: 29 December 2017 - 11:16 AM Rate Topic: -----

#1 ikhlas06   User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 327
  • Joined: 20-May 16

database for online store where I can sell clothes

Posted 29 December 2017 - 09:17 AM

I am building a online store where I can sell clothes. below is the database structure. Did i missed anything?

-----------
vistor_info
-----------
vistor_id
ip_address
date 

--------------
subscriptions:
--------------
id
email
date

--------
Customer
--------
Customer_id
user_name
password
email
verified_email 
register_date

first name
middle name 
date of birth 
phone number

address 1 
address 2 
city
state 
zip 
country


------------
payment info
------------
payment_id 
customer_id
CC_number
CC_name 
CC_expiration_date
CC_code
Delivery_Address
Delivery_email_or_phonenumber

----
cart
----
cart_id
Customer_id
product_id (s)
qty (s)
date //del record after 1 week

---------
products
---------
product_id
name
description
price
color
size
weight 
material
Category_main
Category_sub
Discount
added_date

-------
Orders
-------
order_id
Customer_id
product_id(s)
Qty (s)
tax
total_amt
status (pedding, shipped?)
Order_date


---------
shipping
---------
ship_id
customer_id
order_id (s)
tracking_number
ship_method
ship_charge
ship_date
status?

-----
size:
----- 
id
size_name
active

------
color: 
------
id 
name 
active

--------------
category_main:
--------------
id 
name
active

------------- 
category_sub:
-------------
id 
name 
active

---------
material: 
---------
id 
name 
active


Is This A Good Question/Topic? 0
  • +

Replies To: database for online store where I can sell clothes

#2 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2555
  • View blog
  • Posts: 10,249
  • Joined: 03-December 12

Re: database for online store where I can sell clothes

Posted 29 December 2017 - 09:19 AM

Yep! You seem to think it would be a good idea to store customers credit card information. Which site is this, I want to ensure I never go there.
Was This Post Helpful? 0
  • +
  • -

#3 ikhlas06   User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 327
  • Joined: 20-May 16

Re: database for online store where I can sell clothes

Posted 29 December 2017 - 10:17 AM

you could have said not a good idea to store credit card info due to risk. your sarcastic comments arent helping any one.

what about storing credit card name? or credit card address?

This post has been edited by ikhlas06: 29 December 2017 - 10:17 AM

Was This Post Helpful? 0
  • +
  • -

#4 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2555
  • View blog
  • Posts: 10,249
  • Joined: 03-December 12

Re: database for online store where I can sell clothes

Posted 29 December 2017 - 10:22 AM

Who said it was sarcastic?


This looks like it may be a bad path. How do you plan on implementing it?
----
cart
----
cart_id
Customer_id
product_id (s)
qty (s)
date //del record after 1 week



You may want to split out the customer table into a few more.
Customer
Customer_Phone
Customer_Address

Color, Size, and Material could be abstracted into an Attribute table, no need to have three separate tables.

Stripe

You could just store the uuid's that stripe uses to process the payment.
cust_id, card_id, payment_id, payment_status
Was This Post Helpful? 1
  • +
  • -

#5 ikhlas06   User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 327
  • Joined: 20-May 16

Re: database for online store where I can sell clothes

Posted 29 December 2017 - 10:41 AM

yes, for cart i wasn't full sure. but I was thinking that each customer would have its own cart.
below is a ex.
product_id(s) | qty 
1,2,3,4,5     | 1,1,2,1,1



or shuld i do only 1 product id in cart like this?

https://dba.stackexc...able-sql-server

This post has been edited by ikhlas06: 29 December 2017 - 10:43 AM

Was This Post Helpful? 0
  • +
  • -

#6 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2555
  • View blog
  • Posts: 10,249
  • Joined: 03-December 12

Re: database for online store where I can sell clothes

Posted 29 December 2017 - 10:51 AM

Poor implementation.


product_id and qty should be single instance, not a delimited field. What you want is something like an items table that links back to a cart_id.

Example
Was This Post Helpful? 0
  • +
  • -

#7 ikhlas06   User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 327
  • Joined: 20-May 16

Re: database for online store where I can sell clothes

Posted 29 December 2017 - 11:05 AM

Thanks for you rhelp. I think order tables structure is good as it is.


----
cart
----
cart_id
Customer_id
cart_item_id

----------
cart_item:
----------
cart_item_id
item_id

-----
item:
-----
item_id
product_id
qty
size
color
date //del record after 1 week


-------
Orders
-------
order_id
Customer_id
total_amt
status (pedding, shipped?)
Order_date

--------------
Orders detail:
--------------
order_detail_id
Customer_id
product_id
Qty
color
size
price
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14146
  • View blog
  • Posts: 56,698
  • Joined: 12-June 08

Re: database for online store where I can sell clothes

Posted 29 December 2017 - 11:08 AM

Ah.. wouldn't order detail need a key to the order table itself?
Was This Post Helpful? 1
  • +
  • -

#9 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2555
  • View blog
  • Posts: 10,249
  • Joined: 03-December 12

Re: database for online store where I can sell clothes

Posted 29 December 2017 - 11:11 AM

And you duplicate data by having the customer id in both.
Was This Post Helpful? 1
  • +
  • -

#10 ikhlas06   User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 327
  • Joined: 20-May 16

Re: database for online store where I can sell clothes

Posted 29 December 2017 - 11:16 AM

you both are correct

Just though of a new issue with cart set. This works good if user is loged in becuase I can get the customer ID...

but what if customer is not loged in? how would i set up cart than?


-------
Orders
-------
order_id
order_detail_id
Customer_id
total_amt
status (pedding, shipped?)
Order_date

--------------
Orders detail:
--------------
order_detail_id
product_id
Qty
color
size
price

------------
payment info
------------
payment_id
customer_id
payment_method

Delivery_Address
Delivery_email_or_phonenumber

This post has been edited by ikhlas06: 29 December 2017 - 11:57 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1