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 69681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:36:44+00:00 2026-05-10T19:36:44+00:00

I’ve been trying to design a database schema for a side project but I

  • 0

I’ve been trying to design a database schema for a side project but I havent been able to produce anything that I’m comfortable with. I’m using ASP.Net with LINQ for my data access:

I’m going to allow users to specify up to 10 ‘items’ each with 2 numeric properties, and 1 referential property, the item name.

If I were to put this entry into 1 row, it would easily equal out to some 30+ columns (minimum), e.g. item_1_name (ref) item_1_weight item_1_volume item_2_name… etc…

And I can’t simply turn these columns into referential tables as each property can essentially range from 1 to 400+.

I also figured that if a user only decides to put 1 item into their entry, the method of which I create the object for that data will be static as with LINQ I’d have to check whether the properties and whatnot are NULL and work accordingly. Also, if I ever wanted to increase the number of items allowed in an entry, it’d be a headache to work with.

The other option I’ve thought of is simply creating a row for each item and tying it with an entry id. So I’d essentially never have null entries, but my table would grow astronomically deep but not very wide, as there would only be some 5 odd columns.

Is there something I’m overlooking in my design/is there a much better and efficient way of doing this?

EDIT: When I say that it will grow astronomically, I mean it in this sense: A user can create an entry, and each entry will most likely have a group of items. So say they make 1 entry a day to the site, they could have 3 groups of items, with the max number of items (10), which would equate to 30 items for that sole entry. Make an entry everyday for a week at that rate and you could have 210 rows for that single user.

  • 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. 2026-05-10T19:36:44+00:00Added an answer on May 10, 2026 at 7:36 pm

    I’d recommend the latter design you mention, create one dependent table with five columns:

    CREATE TABLE Items (   user_id               INTEGER NOT NULL,   item_id               INTEGER NOT NULL DEFAULT 1,   numeric_property1     INTEGER,   numeric_property2     INTEGER,   referential_property  INTEGER,   PRIMARY KEY (user_id, item_id),   FOREIGN KEY (user_id) REFERENCES Users(user_id)                         ON DELETE CASCADE,   FOREIGN KEY (item_id) REFERENCES num_items(item_id),   FOREIGN KEY (referential_property) REFERENCES some_other_table(some_column) ); 

    I show a table num_items above, which contains the numbers 1 through 10 if you want to restrict users to 10 items at most:

    CREATE TABLE num_items (item_id INTEGER NOT NULL ); INSERT INTO num_items (item_id)    VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); 

    Advantages of this design is that it’s easy to COUNT() how many items a given user has, it’s easy to compute things like MIN() and MAX() for a given property, you can enforce a foreign key for the referential property, etc.

    Some databases have a feature to declare the second part of a compound primary key (item_id in this case) as auto-incrementing, so if you specify the value for entity_id but omit item_id it automatically gets the next unused value (but does not fill gaps if you delete one). You don’t state which brand of database you’re using so I’ll leave it to you to figure out this feature.

    edit: As Tony Andrews says in his answer, the number of rows is not a problem. You don’t state which brand of database you’re intending to use, but unless you choose an especially feeble product like MS Access, you can rely on the database to process millions of rows easily. If you choose indexes well, and write queries that use those indexes, efficiency shouldn’t be a problem.

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

Sidebar

Ask A Question

Stats

  • Questions 84k
  • Answers 84k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The easiest way I can think of is to create… May 11, 2026 at 5:04 pm
  • Editorial Team
    Editorial Team added an answer The problem lies with C++ and not LLVM. Use a… May 11, 2026 at 5:04 pm
  • Editorial Team
    Editorial Team added an answer I have found the solution! The WHERE clause of CAML… May 11, 2026 at 5:04 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.