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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:29:35+00:00 2026-05-29T05:29:35+00:00

I’m trying to design an application that will use a DB to store some

  • 0

I’m trying to design an application that will use a DB to store some information about boxes.

These boxes are located at a specific, predefined site such as “Garage”, “Living Room”, etc. Locations that could easily be chosen with a dropdown box . But sometimes they can be somewhere else like “Joe’s” that would pretty much be specific and mostly non repeatable.

So my question is how to store this in the DB?
My first idea was to make a simple relation with a table with boxes

BOXES
| ID_BOX | ID_LOCATION | 
|  1     |      1      |
|  2     |      3      | 

And another table with the locations

LOCATION 
| ID_LOCATION |  LOCATION     | 
|      1      |   Garage      |
|      2      |   Living Room |

But how can I put the extra options in here? Add them “temporarily” to the Locations Table? Or make an “Other” field and store this information somewhere else?

  • 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-29T05:29:35+00:00Added an answer on May 29, 2026 at 5:29 am

    If these locations are sure to be pretty much unique and you do not need persistence once the object has been moved or deleted you could add an SQL function when deleting to check if there are any objects at a certain location, if there are non: delete the location.

    If that sound dangerous or not a good idea (for most cases it will be a bad idea) you could add a column to BOXES to specify if the location is in a regular place or in a temporary place, create a table for each and make the relation in a 4rd table. This way you could only add the registers in REGULAR_LOCATIONS to your drop menu and add the ‘others’ option to write into TEMP_LOCATIONS

    Or even better, you could add a column to the locations table and specify if they are regular or not, if they aren’t you won’t show them in the drop down menu. And you get to keep you r current scheme.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
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
For some reason, after submitting a string like this Jack’s Spindle from a text

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.