Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7976765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:59:49+00:00 2026-06-04T08:59:49+00:00

I am am new to PHP/Databases… But I am picking it up fairly swiftly.

  • 0

I am am new to PHP/Databases… But I am picking it up fairly swiftly. What I would like to ask you guys is pretty simple. I want to normalize my database and am not positive how to go about it. I get the concept, but see multiple ways to do it. Figure I’d ask people with some experience.

Here is my Database (2 tables so far):
Brands
Products

***Brands Breakdown:***
1   id          int(6)
**Note:** Above, I will probably use 4-Letter codes for each brand instead of primary/int/auto.
2   name            text
3   logo            varchar(20)
4   phone           varchar(20)
5   website     varchar(30)
6   contact_name    text
7   contact_number  varchar(20)
8   contact_email   varchar(30)
9   warehouse       varchar(20)
10  pricing         varchar(15)
11  bio             varchar(300)

***Products Breakdown***
id (INT(6) / Auto_Increment)
brand (This is where I'll insert the four letter code for brand)
category (e.g. Brakes)
subCategory (e.g. Brake Rotors)
details (e.g. Drilled and Slotteed 'Razr')
sku (Part #)
minYear
maxyear
make (e.g. Subaru)
model (e.g. Impreza)
subModel (e.g. WRX STi)
description (Paragraph on part describing it)

specs (I imagine this can be expanded on. need cells somewhere for sizes / colors / engine codes / etc.)

msrp
jobber
price
cost
weight (of part)
warehouse (Could be moved to brand's table)
image (URL of image for the part)

So My main question is: Do I make each brand have there own table similar to my current ‘products’ table? or have ‘category’ tables? ‘subCategories’? How would you guys normalize this data?

I would like to have a solid database while I’m learning this stuff so I learn the right way. Any advice would be appreciated.

UPDATE:
To anyone who comes across this question who is trying to learn how to structure their database, one major thing I was unaware of when I asked this was something called “cardinality“. Research this topic and learn how to apply it to your database schemas!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:59:50+00:00Added an answer on June 4, 2026 at 8:59 am

    Don’t make each brand have its own table. That’s not normalization, that’s partitioning. Don’t do that until your data base gets very large.

    It’s not clear what your brand table means. I am guessing you mean parts-manufacturer, but I’m not sure. The rest of this discussion assumes that you do mean parts-manufacturer.

    Here’s my suggestion.

    Rename your brand table. Call it “Manufacturer” and split it in two, for Manufacturer and Contact.

    Manufacturer:

    mfrid (your four letter code, primary key)
    mfrname            text
    mrflogo            varchar(20)
    mfrwebsite     varchar(30)
    mfrphone           varchar(20)
    warehouse       varchar(20)
    

    Contact:

    mfrid (four letter code)  (part of primary key)
    contactid (autoincrement) (part of primary key)
    contact_name    text
    contact_number  varchar(20)
    contact_email   varchar(30)
    bio             varchar(300)
    

    Why is “pricing” an attribute of the manufacturer? What do you mean by “pricing?” Isn’t it an attribute of an individual part?

    Split your parts table into two. One table will have a row for each part sku. The other will have a table for each application (that is, each make and model of car in which the part may be used). Like so:

    SKU:

    sku (your stock-keeping unit number, primary key).
    mfrid (maker of the PART, not the vehicle in which it fits, foreign key to mfr table).
    mfrsku (the brand's stock keeping unit, not necessarily unique in your system)
    category (e.g. Brakes)
    subCategory (e.g. Brake Rotors)
    details (e.g. Drilled and Slotteed 'Razr')
    description (Paragraph on part describing it)
    saleprice (?)
    cost (?)
    

    Application:

    ApplicationID (auto incrementing primary key)
    make (e.g. Subaru)
    model (e.g. Impreza)
    subModel (e.g. WRX STi)
    firstYear.
    lastYear.
    

    Then, you’ll need a join table (because each Application can have zero or more SKUs and vice versa; that is, your SKU and Application entities can have many-to-many relationships). In your example, you know that multiple models of Subarus often take the same parts. This schema allows for that.

    ApplicationSKU:

    ApplicationID
    SKU
    

    The trick to normalizing is to understand your application domain. Figure out what entities you have: e.g.

    1. manufacturers like Delco and Subaru
    2. contact people like Joe and Harry
    3. parts like Left Front Wiper Assembly and Rear Wiper Assembly
    4. applications like 1999-2006 Subaru Forester and 1998-2007 Subaru Impreza

    Create a table that matches each entity you have. Figure out how you will uniquely identify each entity (in other words, figure out what you will use for a primary key).

    Create join tables when you have many-to-many relationships between entities.

    Create foreign keys to connect the various entities together.

    I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to PHP, AJAX, and databases. But I want to know what experiences
PHP/MySQL (CodeIgniter) I would like to add new interest_keywords in the exist database value.
To put it simply i am a fairly new PHP coder and i was
I'm new to PHP and have the basics down but now I have a
I have a working PHP server. Now I want to use databases (MySQL or
I've just got a new computer, and I've been setting up PHP/MySQL/databases etc... I
I am new to PHP and trying to learn it by creating a database
I am using PDO with PHP to create a new database and then a
We are in the startup build phase of a new PHP webapp that will
Rather new to php, so sorry if this seems stupid. I'm really copying a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.