samir_gambler
Member
- Joined
- Jul 12, 2012
- Messages
- 6
- Programming Experience
- 1-3
Hello,
I am new to sql. Can anyone please help me in creating query. I have three table
1. Stock containing fields -> StockID(primary key), CategoryID, StockName, StockOnHand, UnitPrice, [CashVaue-StockOnHand], Margin, SalePrice
2.OrderDetails containing fields -> OrderID, StockID, Quantity, [Sub-total]
3. Sales containing fields -> OrderID(primary key), CustomerID, EmployeeID, Date, Net, Discount, Total, OfficialReceiptNumber, EVAT
4.Employee containing fields -> EmployeeID(primary key), LastName, FirstName, JobDescription.
for a given orderID I have to extract information from all the four table.
i.e from order id we will get stockid quantity and sub-total from orderdetailtable
from OrderID we will get CustomerID, EmployeeID, Date, Net, Discount, Total, OfficialReceiptNumber, EVAT
From employeeID(which we got from OrderID table) we will get FirstName, LastName
from stockid we will get stockname, SalePrice
Can anyone please help me to write the query to get all these information.
Thanks
I am new to sql. Can anyone please help me in creating query. I have three table
1. Stock containing fields -> StockID(primary key), CategoryID, StockName, StockOnHand, UnitPrice, [CashVaue-StockOnHand], Margin, SalePrice
2.OrderDetails containing fields -> OrderID, StockID, Quantity, [Sub-total]
3. Sales containing fields -> OrderID(primary key), CustomerID, EmployeeID, Date, Net, Discount, Total, OfficialReceiptNumber, EVAT
4.Employee containing fields -> EmployeeID(primary key), LastName, FirstName, JobDescription.
for a given orderID I have to extract information from all the four table.
i.e from order id we will get stockid quantity and sub-total from orderdetailtable
from OrderID we will get CustomerID, EmployeeID, Date, Net, Discount, Total, OfficialReceiptNumber, EVAT
From employeeID(which we got from OrderID table) we will get FirstName, LastName
from stockid we will get stockname, SalePrice
Can anyone please help me to write the query to get all these information.
Thanks