[X] Contains bullet points after the table that state which foreign keys will reference to which table, or references to the associations which will be made
[X] foreign key and table name are lowercased, snake_cased and back_ticked
[X] Correctly formatted
[X] schema is written in a table format
[X] the table's name are lowercased, snake_cased and back_ticked
[X] the table header column names are bolded
[X] columns names are lowercased and snaked_cased and back_ticked
Comments
Do Users have usernames on Amazon? Or do they just provide their Full name on Sign up? Also, don't forget to add timestamps to your Users table.
You currently have a Category table that is associated with your Products table. I don't know if this is absolutely necessary considering that our Category table have one column of note. We could instead just provide our Products with a category column and have it point to a string value from a CONSTANT list of categories in our backend.
Is the column type of decimal correct for price, or should it be something else?
Make sure to add more columns for your Products as well. Amazon is Products. That's its selling point, so our Products should have additional info (ie. brand and dimensions and weight).
Do Reviews have titles on Amazon. Besides a body, do users provide unique titles as well. If so, that should be a column.
Should the Reviews table have a unique composite inex between the product_id and user_id? What's the benefit of adding something like this?
Yes decimal is correct based on my research for our use case. For applications dealing with money, such as e-commerce platforms (like this clone), banking systems, or accounting software, decimal is the standard choice due to its accuracy and reliability.
Changed
Changed
Changed, it can ensure a user doesn’t submit multiple reviews for the same product.
Database Schema
back_ticked
back_ticked
back_ticked
Comments
username
s on Amazon? Or do they just provide their Full name on Sign up? Also, don't forget to add timestamps to yourUsers
table.category
column and have it point to a string value from a CONSTANT list of categories in our backend.decimal
correct for price, or should it be something else?Reviews
have titles on Amazon. Besides a body, do users provide unique titles as well. If so, that should be a column.Reviews
table have a unique composite inex between theproduct_id
anduser_id
? What's the benefit of adding something like this?