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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:59:18+00:00 2026-05-13T14:59:18+00:00

Take these tables for example. Item id description category Category id description An item

  • 0

Take these tables for example.

Item
    id
    description
    category

Category
    id
    description 

An item can belong to many categories and a category obviously can be attached to many items.

How would the database be created in this situation? I’m not sure. Someone said create a third table, but do I need to do that? Do I literally do a

create table bla bla

for the third table?

  • 1 1 Answer
  • 1 View
  • 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-13T14:59:18+00:00Added an answer on May 13, 2026 at 2:59 pm

    Yes, you need to create a third table with mappings of ids, something with columns like:

     item_id     (Foreign Key)
     category_id (Foreign Key)
    

    edit: you can treat item_id and category_id as a primary key, they uniquely identify the record alone. In some applications I’ve found it useful to include an additional numeric identifier for the record itself, and you might optionally include one if you’re so inclined

    Think of this table as a listing of all the mappings between Items and Categories. It’s concise, and it’s easy to query against.

    edit: removed (unnecessary) primary key.

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

Sidebar

Related Questions

Take these two example tables: Table A Name FirstOrLast Jeremy First Smith Last Mark
Take these two classes for example (C++) class B1 { public: }; class B2
I have these 3 tables + data: items : itemId, itemName data: 1, my
In a postgresql database I have 2 tables like these ones: Table items: item_id
Take these four formats of the from parameter in an email's header: From: Jon
Take these two classes for instance: struct Owned { Owned() : i() { }
In the math module, I could only find cos/sin/tan/acos/asin/atan. These take the argument, respectively
please help me arrange these 3 buttons horizontally like this photoshopped image: Please take
I have a class that currently has several methods that take integer parameters. These
I have three tables (these are the relevant columns): Table1 bookingid, person, role Table2

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.