English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i dont know how to design database for my application. i am using VB 2005 and SQL 2005, i am stuck in relationship. i have 5 tables. my question is

i want to 2 items from one table to another table like below

first table is second tables is

CustomerID OrderID
Customer Name Customer Name
ItemS ItemS
orderDate

i want two items from customer tables in order tables. so do i need to create two foreign keys in orders table because i want two items ?

2006-11-07 13:24:22 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

you dont need to add two foreignkey in to other tables.always. you can add just primary key into other tables. only primary key can be foreign key into other tables.

2006-11-11 00:23:17 · answer #1 · answered by GLADIATOR 3 · 0 0

You need just 1 foreign key (CustomerID, not CustomerName) in the Orders table. Give me more info if you want further help.

2006-11-07 21:40:12 · answer #2 · answered by Doran L 2 · 0 0

if you want to reference the data from both the tables you can use this statement

let first table be cust ,second table be order

select a.*,b* from cust a,order b where a.customer_name=
b.customer_name

2006-11-08 12:17:42 · answer #3 · answered by life goes on... 2 · 0 0

Yes its call composit keys

2006-11-07 21:30:07 · answer #4 · answered by safrodin 3 · 0 0

fedest.com, questions and answers