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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:06:40+00:00 2026-05-12T16:06:40+00:00

Is there a way to have pointers to rows in a database? for example

  • 0

Is there a way to have “pointers to rows” in a database?

for example I have X product rows, all these rows represent distinct products but many have the same field values except their “id” and “color_id” are different.

I thought of just duplicating the rows but this could be error prone, plus making a small change would have to be done on several rows, again buggy.


Question: Is there a way to fill some rows fully, then use a special value to “point to” certain field values?

For example:

id | field1   | field2   | field3   | color_id
-----------------------------------------------
1  | value1   | value2   | value3   | blue
2  | point[1] | point[1] | point[1] | red    (same as row 1, except id and color)
3  | point[1] | point[1] | point[1] | green  (same as row 1, except id and color)
4  | valueA   | valueB   | valueC   | orange
5  | point[4] | point[4] | point[4] | brown  (same as row 4, except id and color)
6  | valueX   | valueY   | valueZ   | pink
7  | point[6] | point[6] | point[6] | yellow (same as row 6, except id and color)

I’m using MySQL, but this is more of a general question. Also if this is goes completely against database theory, some explanation of why this is bad would be appreciated.

  • 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-12T16:06:40+00:00Added an answer on May 12, 2026 at 4:06 pm

    This does go against database design. Look for descriptions of normalization and relational algebra. It is bad mainly because of the comment you have made “duplicating the rows but this could be error prone, plus making a small change would have to be done on several rows, again buggy.”

    The idea of relational databases is to act on sets of data and find things by matching on primary and foreign keys and absolutely not to use or think of pointers at all.

    If you have common data for each product, then create a product table

    create table product (
      product_id int,
      field1 ...,
      field2 ...,
      field3
    )
    with primary key on product_id
    

    The main table would have fields id, color_id and product_id

    if product table looks like

    product_id | field1   | field2   | field3  
    -----------------------------------------------
    1          | value1   | value2   | value3  
    2          | valueA   | valueB   | valueC  
    3          | valueX   | valueY   | valueZ   
    

    The main table would look like

    id | product_id | color_id
    --------------------------------
    1  | 1          | blue
    2  | 1          | red
    3  | 1          | green  
    4  | 2          | orange
    5  | 2          | brown
    6  | 3          | pink
    7  | 3          | yellow
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 226k
  • Answers 226k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Why would you want to do this with JavaScript, if… May 13, 2026 at 1:12 am
  • Editorial Team
    Editorial Team added an answer The relevant part of the string API is this constructor:… May 13, 2026 at 1:12 am
  • Editorial Team
    Editorial Team added an answer WPF mitigates this problem by introducing Routed Events. At any… May 13, 2026 at 1:12 am

Related Questions

Is there an easy way to reference a column in a 2-D array as
A discussion happened today where a grid containing data, which ultimately had data attached
I have a table of customers. This table can be big, millions of rows.
This example is simplified a bit, but in my ASP.NET web page in my

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.