cgreen66 / AmaSphere

0 stars 0 forks source link

Issue #2 - Database Schema #3

Closed keginzburg closed 8 months ago

keginzburg commented 8 months ago

Database Schema

Comments

  1. 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.
  2. 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.
  3. Is the column type of decimal correct for price, or should it be something else?
  4. 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).
  5. Do Reviews have titles on Amazon. Besides a body, do users provide unique titles as well. If so, that should be a column.
  6. 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?
cgreen66 commented 8 months ago
  1. Changed
  2. Changed
  3. 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.
  4. Changed
  5. Changed
  6. Changed, it can ensure a user doesn’t submit multiple reviews for the same product.
keginzburg commented 8 months ago

Solid research on the decimal data type for the price column. This document looks good. Awesome work!