Is my Relational Database Design good enough?

I am about to work on an ecommerce website project and i would like to have some experts advice on my design. So please take a look and please advise any problem by providing tips.

customer_registration
(
customerID INT unsigned Primarykey AutoIncrement not null
name char not null
surname char not null
email char not null
password char
DOB char not null
)

product_name
(
productID INT unsigned PrimaryKey AutoIncrement Not null
product_name char not null
product_desc tinytext not null
product_img char not null
product_price int not null
category_id PRIMARY KEY
)

category
(
categoryID INT unsigned PrimaryKey AutoIncrement Not null
categoryName(sandal,boots,basket, casual shoes) char not null
)

Groupe_type
(
GroupeID INT unsigned PrimaryKey AutoIncrement Not null
GroupeName(male,female,kid_boy,kid_female) char not null
)

Category_groupe
(
categoryID INT unsigned PrimaryKey Not null
GroupeID INT unsigned PrimaryKey
)

order
(
orderID INT unsigned PrimaryKey AutoIncrement Not null
orderAmount INT
orderDate date
customerID PRIMARY KEY unsigned INT
)

This applies to all your tables, the category_id below is actually a foreign Key (InnoDB). If you use MyISAM there are no foreign keys constraints. I would also use Varchar and not Char.

[php]product_name
(
productID INT unsigned PrimaryKey AutoIncrement Not null
product_name char not null
product_desc tinytext not null
product_img char not null
product_price int not null
category_id PRIMARY KEY
)[/php]

Well, this is more of a PHP site, but, I am sure many here will help with your ideas…

First, I would suggest you think out each of your areas needed for the site. You have a start, but, I see a
large number of items missing. Let’s just discuss your customer list first. The use of this is really two-fold.
The first thing it is needed for is a log-in system which will authenticate the user to make sure they are
allowed on the site. Also, you need to think about members that do not want to be a full user, but, just
want to buy something as a guest. You would need some sort of field to indicate their membership or user
level. Also, you need more info for them if you are going to track their credit cards, mailing addresses, billing
addresses (which are very often not their mailing address, shipping addresses (Sometimes they have more
than one to save), phone numbers and many many other fields that you will need. You would keep extra
data if the user is a full member of your site or just a guest.

Products are dependent on your needs. If you have thousands of products, you need a very accurate type
of product description. You might have various types encoded, such as sizes (SM, LG, XL, XX), colors, styles,
male/female, special options and many other values. It is a very good idea to first think outside the box and
try to think what you might need 10 years from now. Then, create a master list of everything you can come
up with for future uses of your products. With that list, you can figure out a way to encode your products
and you might find that you forgot to add a field you need.

The design process for databases are complicated. Lots of thinking ahead. Once you know all your user’s,
what they will do on your site, all of your products and their options, then you can design the database.
There are many many sites on the web to get you started. Here is one that might be complicated for you,
but, it shows tables and how they link to each other. You might get something out of this sample. Look at
the second example and you will see how many items you still have to design… Hope it helps!
https://www3.ntu.edu.sg/home/ehchua/programming/sql/SampleDatabases.html

You could use a prebuilt library store. There are thousands out there for free. One I played a lot with was
Prestashop. You can download it and set up your own store in minutes. It is free unless you want to buy
templates to make them more pretty. I found that if you take a few months to learn all the vast code in it,
that you can make it pretty yourself. It creates a control panel for the owner/admin and then the store. I
really liked it as it covered just about everything I could think of. I never opened my store, but, still have it
for a possible future use. Here is a link to it and a link to it’s feature-list which will help you get some ideas
in creating your own store…
https://www.prestashop.com/en/download
https://www.prestashop.com/en/ecommerce-templates (click on tabs, like templates, mobile)

Normally, Rebel, I would not suggest an outside full solution, but, for free and to get ideas on what you do
need to start with, you might like to check it out. Use the download type not the cloud as they host that
version. Well, this is just an idea… If nothing else, steal ideas on what you want in the future!

Well, there are a lot of things for you to start thinking about. Hope it gets you started…

Take a look at the attached database schema…


Sponsor our Newsletter | Privacy Policy | Terms of Service