473,386 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

foreign key

I'd like to create a table with PRIMARY KEY k (a,b,c) where a, b, c are
foreign key. Is it possible? How can I do?

Thanks

Bye
Jul 19 '05 #1
6 1843
r
I'm waiting for the answer on this one....
R
"Fabio" <fm*****@yahoo.com> wrote in message
news:cM*****************@tornado.fastwebnet.it...
I'd like to create a table with PRIMARY KEY k (a,b,c) where a, b, c are
foreign key. Is it possible? How can I do?

Thanks

Bye

Jul 19 '05 #2
r
I'm waiting for the answer on this one....
R
"Fabio" <fm*****@yahoo.com> wrote in message
news:cM*****************@tornado.fastwebnet.it...
I'd like to create a table with PRIMARY KEY k (a,b,c) where a, b, c are
foreign key. Is it possible? How can I do?

Thanks

Bye

Jul 19 '05 #3
r
I'm waiting for the answer on this one....
R
"Fabio" <fm*****@yahoo.com> wrote in message
news:cM*****************@tornado.fastwebnet.it...
I'd like to create a table with PRIMARY KEY k (a,b,c) where a, b, c are
foreign key. Is it possible? How can I do?

Thanks

Bye

Jul 19 '05 #4
table one

id - auto increment - primary key - medium int
item - description - text
table two

id - auto increment - primary key - medium int
fk_item_id - medium int
the fk_item_id (foreign key) in table two is really just the primary key of
table one.

A

"r" <no***@nowhere.com> wrote in message
news:99********************@comcast.com...
I'm waiting for the answer on this one....
R
"Fabio" <fm*****@yahoo.com> wrote in message
news:cM*****************@tornado.fastwebnet.it...
I'd like to create a table with PRIMARY KEY k (a,b,c) where a, b, c are
foreign key. Is it possible? How can I do?

Thanks

Bye



Jul 20 '05 #5
table one

id - auto increment - primary key - medium int
item - description - text
table two

id - auto increment - primary key - medium int
fk_item_id - medium int
the fk_item_id (foreign key) in table two is really just the primary key of
table one.

A

"r" <no***@nowhere.com> wrote in message
news:99********************@comcast.com...
I'm waiting for the answer on this one....
R
"Fabio" <fm*****@yahoo.com> wrote in message
news:cM*****************@tornado.fastwebnet.it...
I'd like to create a table with PRIMARY KEY k (a,b,c) where a, b, c are
foreign key. Is it possible? How can I do?

Thanks

Bye



Jul 20 '05 #6
table one

id - auto increment - primary key - medium int
item - description - text
table two

id - auto increment - primary key - medium int
fk_item_id - medium int
the fk_item_id (foreign key) in table two is really just the primary key of
table one.

A

"r" <no***@nowhere.com> wrote in message
news:99********************@comcast.com...
I'm waiting for the answer on this one....
R
"Fabio" <fm*****@yahoo.com> wrote in message
news:cM*****************@tornado.fastwebnet.it...
I'd like to create a table with PRIMARY KEY k (a,b,c) where a, b, c are
foreign key. Is it possible? How can I do?

Thanks

Bye



Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dcp | last post by:
I just installed the 4.1.0-alpha-max-nt version of MySql and have just started playing around with it. My first test was to try to create a couple of tables, one with a foreign key constraint. ...
0
by: Jeremiah Jacks | last post by:
I just upgraded to MySQL 4.0.14-standard for RedHat Linux and am using = the pre-compiled binaries. I have a database with INNODB tables. When I insert a row into one of the child tables, I get...
2
by: geoff | last post by:
The table creation script(at the end of this post) works fine on 4.0.1-alpha-win, but the foreign key constraints fail on 4.0.15-win. I am starting the server with the same command for both...
10
by: Bodza Bodza | last post by:
I'm having an argument with an incumbent self-taught programmer that it is OK to use null foreign keys in database design. My take is the whole point of a foreign key is that it's not supposed...
31
by: Robert Brown | last post by:
Let's say I have a type hierarchy: (just an example) the general entity customer: CREATE TABLE customer(customer_id int, customer_name varchar(250), customer_type int) three specific...
4
by: Simon Bond | last post by:
Hi there, I should point out I am very new to MySql, im trying to learn what I can. Basically im using Navicat to work with my databases. When making a foreign key, i am asked to enter the...
2
by: adammitchell | last post by:
How can you indicate that a FOREIGN KEY constraint references two columns in two different tables? "SQL Server Books Online" show an example of how to reference two columns in the SAME table:...
0
by: Scott Ribe | last post by:
I've got a problem which I think may be a bug in Postgres, but I wonder if I'm missing something. Two tables, A & B have foreign key relations to each other. A 3rd table C, inherits from A. A...
10
by: Shawn Chisholm | last post by:
Hi, I am trying to deal with a deadlock situation caused by foreign key references on insert and I was wondering if anyone knows what order the foreign keys are locked (or evaluated) in for a...
2
by: Ian Davies | last post by:
I have created a database with about 17 tables. I have been creating foreign keys some of which have worked but when creating others I get the message below ************************* 1005...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.