Click to See Complete Forum and Search --> : Sql Query


Jemper
02-18-2009, 09:33 PM
Hi,

I'm working on a client management system.
in my database i have a customer table a product table so if the customer clicks details he gets the customer table and if he clicks on last bought products for example he gets the product table

What is a better design to have a long table containing both the customer and product details and get one part at a time or to have two tables and use two sql queries to get the data?

chazzy
02-18-2009, 09:55 PM
why do you need 2 queries? why not use a join?

Jemper
02-18-2009, 11:55 PM
Well, i tried to use join but i couldn't do it properly...
if you or someone else could do it that would be awesome!

Jemper
02-19-2009, 06:41 PM
Can anyone help make the join i have the following columns
customer table:
customer_id,first name,last name,age,country,city,street,zip,phone,mobile,fax,mail
product table:
product_id,product_name,price,description,quantity

also what if i have customer_id on two tables how do i use join then?

Jemper
02-20-2009, 07:39 AM
Solved (for now...)