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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:16:27+00:00 2026-06-11T09:16:27+00:00

Lookup table – unique row identity The other lookup tables just do not make

  • 0

Lookup table – unique row identity

The other lookup tables just do not make sense as from what I have seen giving a row an ID then putting that id in another table which also has a id then adding these id’s to some more tables which may reference them and still creating a lookup tables with more id’s (this is how all the examples I can find seem) What I have done is this :

product_item - table
------------------------------------------
id | title   | supplier   | price 
1  | title11 | suuplier1  | price1

etc.
it then goes on to include more items (sure you get it)

product_feature - table
--------------------------
id | title    | iskeyfeature 
1  | feature1 | true




feature_desc - table
-----------------------------
id | title | desc
1  | desc1 | text description





 product_lookup - table
    item_id | feature_id | feature_desc
    1       | 1          | 1
    1       | 2          | 2
    1       | 3          | 3
    1       |64          | 15 

(as these only need to be referenced in the lookup the id’s can be multiples per item or multiple items per feature)

What I want to do without adding item_id to every feature row or description row is retrieve only the columns from the multiple tables where their id is referenced in the same row of the lookup table. I want to know if it is possible to select all the referenced columns from the lookup row if I only know the item_id eg. Item_id = 1 return all rows where item_id = 1 with the columns referenced in the same row. Every item can have multiple features and also every feature could be attached to multiple items , this will not matter if I can just get the pattern right in how to construct this query from a single known value.

Any assistance or just some direction will be greatly appreciated. I’m using phpmyadmin, and sure this will be easier with some php voodoo I am learning mysql from tutorials ect and would like to know how to do it with sql directly.

  • 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-11T09:16:28+00:00Added an answer on June 11, 2026 at 9:16 am

    Having a NULL value in a column is not the major concern that would lead to this design – it’s the problem with adding new attribute columns in the future, at which MySQL is disgracefully bad.

    If you want to make a query that returns everything about an item in one row, you need to LEFT OUTER JOIN back to the product_lookup table for each feature_id. This is about every 10th mysql question on Stack Overflow, so you should be able to find tons of examples.

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

Sidebar

Related Questions

I have two tables (Orders, Transactions) and a TransactionsOrders lookup table that just retains
Let's say I have a lookup table which I'd like to make accessible to
I have two tables: A lookup table ( tabOne ): KEY | Group |
I'm writing a program that is creating a lookup table from two tables that
Guys i currently have 2 tables that reference a lookup table. Ive been tasked
I have a SQL lookup table like this: CREATE TABLE Product(Id INT IDENTITY PRIMARY
I am trying to create an ANI lookup table from 2 separate tables, one
I have 2 tables 1. paypal_ipn_orders table 2 is lookup. The lookup table I
I have a lookup table called metadata_types in my database, which lists all the
I am trying to code a global lookup table of sorts. I have game

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.