Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 test

Author  Topic 

lisa_baria03
Yak Posting Veteran

60 Posts

Posted - 2007-10-13 : 23:32:32
test

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-10-14 : 01:51:50
No other columns in those tables? You can't set relationship to those tables since they are not related. By the way, I know it's your homework.
Go to Top of Page

SunnyDay
Starting Member

9 Posts

Posted - 2007-10-14 : 02:57:44
Just look the topic "Select all from two many-to-many related tables"
or use "How To:..." in MS SQL Server Help
Go to Top of Page

lisa_baria03
Yak Posting Veteran

60 Posts

Posted - 2007-10-14 : 12:06:26
would i require to create two more tables like this?

create table customer_order
(customer_id int not null
references customer(customer_id),
order_id int not null
references [order](order_id)
)

create table customer_product
(customer_id int not null
references customer(customer_id),
product_id int not null
references product(product_id)
)
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-10-14 : 12:15:04
I think if you just have a look at those tables in Northwind or Pubs sample database which is provided with SQL Server 2000/MS Access/SQL Server 2005, you will get exact idea of how the schema and releationship between tables should be designed.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

lisa_baria03
Yak Posting Veteran

60 Posts

Posted - 2007-10-14 : 14:03:42
I'm having some trouble following them. Do you have examples where you can show me ?
thank
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-10-14 : 22:29:50
I think if you will be able to tell us exactly what problems you are facing in understanding the sample database, we can help you in more precise manner.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-21 : 06:57:38
Note sure why the OP has deleted the original post, but here it is in case useful:

Title: creating many to many table in sql

I created three different tables: order customer product

I need 2 many-to-many table for
order and customer
customer and product

Create table order
( order_id Int Not Null,

)

Create table customer
( customer_id Int Not Null,

)

Create table product
( product_id Int Not Null,

)

can you give me a hint in how to create the many to many relationship. I'm not sure if it is the use of foreign key, constraints, check etc. hope that you can show me one example
Thanks.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-10-21 : 09:47:33
quote:
Note sure why the OP has deleted the original post

I thought k-bot did it


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-22 : 02:35:42
quote:
Originally posted by lisa_baria03

test


Well. I hope you tested it well


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -