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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:05:06+00:00 2026-06-14T05:05:06+00:00

So, I’m learning (and using) a database, and so far I think I’m understanding

  • 0

So, I’m learning (and using) a database, and so far I think I’m understanding it

Today, a question arise on the following example:

I have a table with identities (for instance, objects, which have a name and a physical description and naturally a primary auto-increment integer index). And I have identities (e.g. persons) which interact with then).

Is there any way of categorizing these identities in my a database? For instance, assume a mechanic only interacts with a very specific set of those objects (tools, car pieces, etc). So, it would make sense to restrict any search by a mechanic on the objects to that set.

Any hints on what is the natural way (if any) to approach this problem?
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-14T05:05:07+00:00Added an answer on June 14, 2026 at 5:05 am

    You would need a table category with an id and a description

    An object can have many categories and a category can have many objects. So we are facing a many to many relationship.

    You need a third table, that we call a junction table. This table would have the id of the category and the id of the object.

    The design would look like this

    Category
    Id | Description
    
    Object
    Id | Description
    
    Person
    id | Type | ...
    
    Categories_Objects
    Id | CategoryId | ObjectId
    

    Then if you want to select the objects for a mechanic which would be the category 1 (that’s an example, you need to find the id first)

    You would do a select like this

    SELECT Object.Description 
    FROM Object 
         INNER JOIN Categories_Objects ON Object.id = Categories_Objects.ObjectID 
    WHERE CategoryID = 1
    

    OR

    SELECT Object.Description 
    FROM Object 
         INNER JOIN Categories_Objects ON Object.id = Categories_Objects.ObjectID
         INNER JOIN Category ON Categories_Objects.CategoryId = Category.id
    WHERE category.description = "Mechanic"
    

    Note: If a person can use many categories of tools, you will need another junction table like this

    Persons_Categories
    ID | PersonID | CategoryID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
This could be a duplicate question, but I have no idea what search terms
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I have thousands of HTML files to process using Groovy/Java and I need to
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a reasonable size flat file database of text documents mostly saved in
Let's say I'm outputting a post title and in our database, it's Hello Y’all
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.