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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:28:10+00:00 2026-06-16T16:28:10+00:00

I have a many-to-many table user_processes that consists of two columns: user and process

  • 0

I have a many-to-many table user_processes that consists of two columns: user and process. user is a foreign key referencing the user table’s primary key. The process column is a foreign key referencing the processes primary key. However, I don’t need a separate primary key column in user_processes since a multi-column primary key on user, process should be enough (right? I’m not seeing a need for a separate id column). One user can have many processes, but there shouldn’t be multiple rows with the same user having the same process.

The following code is giving me the error “#1005 – Can’t create table ‘test.user_processes’ (errno: 150) (Details…) ” in phpmyadmin.

Here’s the code, generated by mysql workbench:

-- -----------------------------------------------------
-- Table `test`.`user_processes`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `test`.`user_processes` (
  `user` INT UNSIGNED NOT NULL ,
  `process` INT UNSIGNED NOT NULL ,
  PRIMARY KEY (`user`, `process`) ,
  INDEX `fk_user_processes_users1_idx` (`user` ASC) ,
  INDEX `fk_user_processes_processes1_idx` (`process` ASC) ,
  CONSTRAINT `fk_user_processes_users1`
    FOREIGN KEY (`user` )
    REFERENCES `test`.`users` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_user_processes_processes1`
    FOREIGN KEY (`process` )
    REFERENCES `test`.`processes` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

Any idea why it’s not letting me do this, and what the right solution is?

  • 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-16T16:28:11+00:00Added an answer on June 16, 2026 at 4:28 pm

    The table users and/or processes might not exists. Make sure that the create table statements for the referenced tables are executed before calling this.

    Or the type of the referenced fields users.id and/or processes.id don’t match the type of the fields user_processes.user / user_processes.process. In this case, those fields should also be INT UNSIGNED.

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

Sidebar

Related Questions

I have a database in which there is a user table & how many
I have a user and a message table. User to Message are one-to-many relationships
i have a many to many table relationship that involves 2 logical tables. Record
I have many tables, say T1, T2, T3. Every table has a column named
What is the purpose of the Secondary key? Say I have a table that
Take tables: User, Comment, Snippet. A User can have many Snippets. A Snippet can
I created 3 tables: User User-Group Group Where I can have a many-to-many relationship.
Right now I have 3 tables: User, Roles, and User_Roles for the many-to-many association.
In each table have many number of rows with amount. Like this i have
I have db scheme where Product table have many to many relation to Color

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.