rhishi20 Posted December 28, 2013 Share Posted December 28, 2013 I am new to sql and want to do some practice stuff hence requires list of two tables which having relation with each other for example product and order table. these are the two tables having relation with each other through productid column. producttable ordertable productid productname price color weight orderid productid customer Link to comment Share on other sites More sharing options...
davej Posted December 28, 2013 Share Posted December 28, 2013 (edited) Using MySQL or another database? Perhaps you could try something like this... producttable --------------------- productid PK productname price color weight ordertable ------------------- orderid PK customerid FK salesman FK ordertotal date customertable ----------------------- customerid PK lastname firstname address city country phone creditlimit orderitemstable ------------------------ orderid PK FK productid PK FK quantity soldprice employeestable ------------------------ employeeid PK lastname firstname address city phone basesalary salescommission productstock ------------------------ productid PK FK warehouseid PK FK locationid PK stockqty warehouses -------------------------- warehouseid PK address city size customerledger ----------------------------- entryid PK (AUTONUMBER) customerid FK orderid FK entrytype NOT NULL amount NOT NULL date NOT NULL http://www.w3schools.com/sql/sql_create_table.asp Edited December 28, 2013 by davej 1 Link to comment Share on other sites More sharing options...
rhishi20 Posted December 30, 2013 Author Share Posted December 30, 2013 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now