Jump to content

can anybody suggest list of related tables for performing SQL operations


rhishi20

Recommended Posts

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

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 by davej
  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...