Catalogue / Product Database Design - sql

As I have looked all over for an answer to my question and found nothing of use, I can only assume a) I can't use Google b) I'm the only one stupid enough to not know the answer off my own back.... So would be greatful for any advice or support on this.
Basically I'm setting up a basic e-commerce site. I have the standard products, customers, orders, orderdetails, addresses, and cart tables in place.
What I'm struggling to envisage is how to incorporate cataloguing into my design. There will be hundreds of products and downs of account but not all the products will be available to each account/customer. One customer may only have 4 products in their catalogue to choose from but another may have 50. Would merely creating a seperate catalogue for each customer (CatalogueID against Account ID), at the risk of repeating data, be my only answer?
Hope this makes sense.
Cheers.

Related

Which SQL table should I use to store `popularity` field

I am setting up a small E-commerce website using Django. My aim is to ensure that the landing page displays products in order of popularity. I am defining popularity as the total number of times a product was purchased.
In terms of design architecture, what is the best way of achieving this?
At first I thought of putting the popularity field inside the Product table. However, I suspect that I will get in trouble with caching further down the line. Perhaps it is best to create a PopularityDetails table with both product_id (pk) and popularity?
I see many website have this functionality so I would have thought that there must be a standard practice on this. Alas, I have not found any resources on the matter. Any help would be much appreciated.
Thanks in advance!

mysql database tables design

I have to design a database for an advert site.
Until now this is the design i came up with:
Administrator(Id,Name,Password)
Advert(Advert_Id,Title,Description,Category,User,Date_created,Picture,Type)
User(User_Id, Name ,Phone,email,Address)
Category(Cat_id,Cat_Name)
Type(Id,Type_Name)
Picture(Picture_Id,Name)
The administrator refers to to the person that will manage the site.
The type refers to the type of the advert: selling, buying etc.
I must have minimum 5 tables at least 2 one to many relationships and at least one many to many relationship. The problem is that I can't find a many to many relationship that would make sense.
If an advertisement can have more than one category, then advertisements and category would be many to many.
If an ad can have more than one picture and a picture can be used in more than one ad, ads and pictures would be many to many.
However, you have to know the business rules. None of us will.
Like Dan mentioned on the answer, you have to know the Business Rules. It's a project for a class, so the business rules might be flexible, I remember back in college, for example, they would tell us that if a client wanted to have advertisement be of at least one category, but could have up to 3 or 4 different categories, that changes your DB structure a lot.
An advertisement can also have many pictures, not just one. It can even have some videos, and many of them as well. Make sure you clarify well the Business Rules and that you understand them fully, as in a real life situation, that can represent either the success of your project or the failure of it.

Draw EER Model to create Store Database system

I asked the following question on a database site:
I am trying to build an EER Model for a Autostore that has 5 locations
and offers a range of auto products. They offer car repairs and
roadworthy tests as a service also. I need to be able to make
fortnightly reports on unfinished service jobs, and fortnightly
reports on the sales. They have a wide customer database filled with
full addresses. There is a constant inflow of new stock items and
restocking of old ones. There should also be a way to know the cost of
each item in stock and where its being held.
I swear I've researched it enough to be able to understand it by now
but Im really struggling to map this out as I'm constantly running
into a wall when dealing with the products that are being restocked,
sold and stocked by particular stores in different locations.
-I'm a total rookie with this kind of thing but if anyone can help me it would be amazing.
but I am struggling to find an answer and was thinking that maybe if I asked someone here to build an SQL setup it would lead me in the direction of being able to make the model or if there was a way of building the relational model then it would be a simple step from there, unless someone has the original answer - or all of them haha, hope you can help!
Thanks,
Jacob
If you are struggling with creating an EER diagram, my guess is that you may not have captured detailed enough requirements for the application. A clear understanding of the functionality the application should provide should lay the groundwork for what you need to model in the database.
Ask yourself these questions.
Have I created user profiles for each type of user the application will be used by?
Have I outlined every action these users will be performing on the application and the details of the actions?
These are just two of many questions that you have hopefully fully addressed. If you have addressed these topics and everything else fully, perhaps you just need a different approach in organizing your requirements.
Break it up into segments of data. For example, you'll need to create a system of tables that manages inventory. Which will need to then be linked up to a system of tables that manages sales and service records. Which will need to be linked to a system of tables that manages customers data. The sales/service and inventory control will need to be linked up to a system of tables that governs employees and their roles and ability to do things (security, privileges, etc). I can go on and on speaking theoretically about this, but this should hopefully be enough to get you started.
Good luck.

Product categories vs. business categories

I'm developing an e-commerce site and I'm facing a problem. The requirement I need to fulfill is: given a certain string like "lock", "tennis", "cinema" or "scaffold" entered by an user, I should display both profiles and product postings matching that query.
That leads me to these conclusions:
a) I should classify profiles (what they do): maybe some sort of "business category". I face a problem here, it's almost impossible to create a list that covers all the business activities in the world, so I've been reading some good questions here and liked the strategy of creating a 1 or 2 level hierarchy and then capture the user feedback automatically through reusable tags.
The idea here is to keep the keywords that are more likely to be thought of and so with best odds of being searched for.
By the way, is there a really good business category list out there that I'm missing?
b) I should classify products and services (what they offer): with a similar approach, I liked using some fixed categories and then let users use persistent tags. I ask you again if there is a category list out there that really rocks.
Questions:
1) Do you like what I've just described? Based on your experiences do you think it might work or will I drown in a tag sea?
2) Sometimes both product and business hierarchies are kind of redundant. There are some people that describe their businesses like "theater", "bank", "dentist" and that's not a product or service but rather what they actually are. But there are plenty of cases where people say "(sale/manufacturing) cars", "(manufacturing) pottery", and so on. Their business activity is chiefly determined by the product or service they're selling or producing. What's your take on this?
I did something like this is ror_ecommerce. I used a tree for product_types.
So you could sell:
Furniture => Livingroom => Chairs
Filtering by Livingroom would also give items that have a product_type pointing to Chairs.
To make it more complex I would first fight the business person.
Second I would create a model where product has many product_types. Thus you need a join table between product_type and product.
Answer to your question:
1) You will probably drown because categories are infinite. Limit the number of tags or make an admin interface that your business people can populate. If not your business folks will request you to do this work over and over again.
2) It sounds like Your tree would look like this:
sale/manufacturing => cars
sale/manufacturing => pottery
bank => personal
bank => business
thus if someone just wants a bank they get results for personal and business. but they can further refine the search to just personal banking.
It also sounds like the business and product hierarchies are completely redundant. I would really fight a business guy saying anything else because a future requirement will be to relate business and personal hierarchies. If they are the same it will be easy. You might want a type flag on the list for personal / business / both. it will be a lot easier to remove the flag if it's not needed.
Good Luck

rails different order fields for different products

In my rails application, I would like different products to have different types of questions asked on the order fields. Whats the best way to accomplish this? Should i just make one big order model with all the fields for the different orders, and have only the fields pertaining to the product filled out? For example, if you check out the product fire extinguisher, i would like it to ask:
have you ever used a fire extinguisher before?
or if your checking out a car seat, i would like it to ask
do you want the fire department to install it for you?
the example i gave you is just basic, but it will ask a lot more questions than that pertaining to the product when it is being checked out. what do you think the best way to accomplish this is?
What do you mean, "with all the fields for the different orders"?
If each product has an arbitrary number of questions, and valid answers for that questions, those Q&A should be reflected in additional models, and each product should have an association to its Q&A.