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

  • SEARCH
  • Home
  • 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 7826713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:32:31+00:00 2026-06-02T09:32:31+00:00

I have 2 tables books, mobiles in a Mysql database. Tables structure being, 1.

  • 0

I have 2 tables books, mobiles in a Mysql database.

Tables structure being,

1. book_id|book_name  
2. mobile_id|mobile_name

A third table products with the following structure is also created,

  1. product_id|product_name

Now, I want the book_id to start with a pattern in mysql.

For example,

book_ids -> 11,12,13,14,15,16,17,18,19,110,111,112,...  
mobile_ids -> 21,22,23,24,25,26,27,28,29,210,211,212,...

Now, in my products table I can have,

product_id -> 11,21,16,26, if this starts with pattern is not set,
then the problem would be,

product_id -> 1,1,6,6..its not unique.

How to handle this..?

Edited stuff below:

So, are you meaning this..?

category_table

category_id | category_name

1 | books
2 | mobiles

book_table

book_id | book_name

1 | da vinci code
2 | alchemist

mobile_table

mobile_id | mobile_name

1 | nokia
2 | samsung

product_table

id | product_name | product_id | category_id

1 | da vinci code | 1 | 1
2 | alchemist | 2 | 1
3 | nokia | 1 | 2
4 | samsuing | 2 | 2

  • 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-02T09:32:34+00:00Added an answer on June 2, 2026 at 9:32 am

    You seem to be duplicating information without a reason.

    Just create a products table with:

    id | name | type (e.g. 0 book, 1 mobile, etc) | price | ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two MySQL tables, subjects and books, and a third table to define
I have a MySQL table looking like this: > describe books; +---------------+--------------+------+-----+---------+----------------+ | Field
I have a following tables/classes structure in Linq to entities. Books { bookId, Title
Let's say i have 2 tables Customer and Books. Table Books can have multiple
I have a MySQL database with a lot of tables, and I have two
I have two tables like below, mysql> select * from Books ; +----+------+------------+----------+----------+ |
Here's my simple SQL question... I have two tables: Books ------------------------------------------------------- | book_id |
I have 3 db tables: books(id, title, author,...) and orders(id, book_id, user_id,...) and users(id,
Let I have Tables (Books and Authors have ManyToMany relation ship) BOOKS id book_name
I have 2 tables: publications and books. Currently, the table publications is empty. 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.