Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
0 answers
360 views

MySQL, InnoDB: two-column unique constraint with one column in parent table

In a child table, I need to enforce a unique constraint with a composite key where one of the two columns is in the parent table. The situation is that in my application users can have multiple ...
kKre's user avatar
  • 21
4 votes
2 answers
5k views

MySQL column order in composite key

I have a doubt, Here is my table: mysql> show create table example\G *************************** 1. row *************************** Table: example Create Table: CREATE TABLE `example` ( ...
zebo zhuang's user avatar
3 votes
2 answers
223 views

Mysql composite key order relevance

I have this mySql table: create table associations (email1 varchar(30), email2 varchar(30), primary key(email1, email2)); Now in this table if I insert two rows as follows: insert into ...
Shekhar Joshi's user avatar
1 vote
0 answers
373 views

Select with composite key match my sql

I have following problem. I want to select single record from my table. That table has composite primary key. This select is in stored procedure that accepts two int parameters. This is my query: ...
user1797770's user avatar
4 votes
1 answer
3k views

Composite Primary Key and Auto_Increment [duplicate]

I'm trying to do the composite key with one of them auto incrementing, but when I try to enter a new row it just continue the sequential. Here's the example of what happens: Item_1 | Item_2 1 | ...
Heron Vieira's user avatar