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

  • Home
  • SEARCH
  • 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 4265186
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:35:22+00:00 2026-05-21T06:35:22+00:00

I’m insecure about the way i’m thinking when I’m normalising. I’m designing a database

  • 0

I’m insecure about the way i’m thinking when I’m normalising. I’m designing a database for an fictional online pizza shop.

consider a table with a concatenated key being order_nr and pizza_article_nr.

I’m stuck with the pizza toppings. I’m thinking that taken litterally, they don’t rely on the pizza since they technically speaking can exist on their own. Yet in reality they’re always connected to a pizza. So then do they exist on their own so that I will deal with them in 3NF or does the column ‘toppings’ fail 2NF because it does rely on the pizza in practical reality?

  • 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-05-21T06:35:23+00:00Added an answer on May 21, 2026 at 6:35 am

    The source of your confusion is that you are seeing keys in more than one place and you’re thinking that it must be redundancy. The fact is that in normalization you need to ignore the psuedo-redundancy in the keys. This is not real redundancy but merely repetition of information. The repetition is there for a reason, namely to indicate the relationship between entities.

    If you have a table for toppings that are available, i.e. the primary key is topping_id, then a table that tells you which topping is on which pizza is 3NF. If you don’t have a lookup table for toppings and instead put the topping name in your pizza composition table, then I think a lot of people would say you’re violating 2NF. They would be right if topping names are not immutable. If the topping names happen to be immutable then there’s an argument to say that the topping name is your primary key to an implicit topping table. However, as a matter of best practice, it’s good to have meaningless keys in general – unless you can come up with a really good reason to use a meaningful key on a case by case basis. Therefore avoid using topping name in your pizza composition table.

    Since you can often order more than one pizza at a time (I cut code and have two teenage sons, so I speak from experience) your schema should probably be along these lines:

    ORDER:
      order_id (PK)
    , date_taken
    , deliver_to (or FK to a CUSTOMER table if you're being ambitious)
    
    PIZZA:
      pizza_id (PK)
    , order_id (FK)
    , size
    
    TOPPING:
      topping_id (PK)
    , topping_name
    
    PIZZA_COMPOSITION:
    , pizza_id (PK, FK)
    , topping_id (PK, FK)
    , quantity (My kids insist on double cheese)
    , coverage (One likes half plain cheese...)
    

    This schema is 3NF because the only thing that appears in more than one place is a foreign key.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.