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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:35:00+00:00 2026-06-01T15:35:00+00:00

More of a question concerning the database model for a specific problem. The problem

  • 0

More of a question concerning the database model for a specific problem. The problem is as follows:

I have a number of objects that make up the rows in a fixed table, they are all distinct (of course). One would like to create sets that contain a variable amount of these stored objects. These sets would be user-defined, therefore no hard-coding. Each set will be characterized by a number.

My question is: what advice can you experienced SQL programmers give me to implement such a feature. My most direct approach would be to create a table for each such set using table-variables or temporary tables. Finally, an already present table that contains the names of the sets (as a way to let the user know what sets are currently present in the database).

If not efficient, what direction would I be looking in to solve this?

Thanks.

  • 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-01T15:35:01+00:00Added an answer on June 1, 2026 at 3:35 pm

    Table variables and temporary tables are short lived, narrow of scope and probably not what you want to use for this. One table for each Set is also not a solution I would choose.

    By the sound of it you need three tables. One for Objects, one for Sets and one for the relationship between Objects and Sets.

    Something like this (using SQL Server syntax to describe the tables).

    create table [Object]
    (
      ObjectID int identity primary key,
      Name varchar(50)
      -- more columns here necessary for your object.
    )
    
    go
    
    create table [Set]
    (
      SetID int identity primary key,
      Name varchar(50)
    )
    
    go
    
    create table [SetObject]
    (
      SetID int references [Object](ObjectID),
      ObjectID int references [Set](SetID),
      primary key (SetID, ObjectID)
    )
    

    Here is the m:m relation as a pretty picture:
    enter image description here

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

Sidebar

Related Questions

I have a question concerning encryption, more specifically encryption that requires no internet connection
One more question concerning JSF.Particularly, Primefaces. Have following problem with ajax update of elements
Hey guys I have one more question lol. I am using a script that
While I can find the answer to almost any specific question I have concerning
This is more a question of practical database design. I've designed smaller databases before,
This is kind of more generic question, isn't language-specific. More about idea and algorithm
I'm new to flex and I have a question concerning bitmapData and its width
The question is, how can I remove elements that appear more often than once
I have a question concerning multiple similair forms on one page. Lets say you
This is more of a conceptual question concerning the built in functionality of PHP

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.