Hello,
I have a database that includes the following tables:
Table 1:
Customers (CustomerID, FirstName, LastName, Number) The primary key is CustomerID
Table 2:
Orders (OrderID, CustomerID, TheProduct, Quantity, OrderDate) The primary key is OrderID
Table 3:
OrdersDetails (OrderID, OrderStatus (whether it has been shipped or not), ShippedDate) The primary key is OrderID.
As you see the Relationship between tblCustomers & tblOrders 1-To-Many
and Relationship between tblOrders & tblOrdersDetails 1-To-1
I have 3 questions :
1- when I create a form for the tblOrders and enter a specific order for a specific customer, I want the program to automatically send this OrderID to the tblOrdersDetails and put in the OrderStatus Field some string for example “Processing.” To be able to deal with it later (I just want to define the order In tblOrdersDetails table to deal with later)..
How can we do this and what is the best way to Handle this scenario?
2- Is this the correct way to create tables for this purpose I mean create those 2 tables (Orders & OrdersDetails) or should combine them in one Table To solve this problem, Knowing I prefer to set the Orders and OrdersDetails it on a different Table?
3- Is it necessary to add CustomerID to tblOrdersDetails or this method apply just for Junction Table when we have Many-To-Many Relationship or this optional?
I have attached the file, I would appreciate any help
I have a database that includes the following tables:
Table 1:
Customers (CustomerID, FirstName, LastName, Number) The primary key is CustomerID
Table 2:
Orders (OrderID, CustomerID, TheProduct, Quantity, OrderDate) The primary key is OrderID
Table 3:
OrdersDetails (OrderID, OrderStatus (whether it has been shipped or not), ShippedDate) The primary key is OrderID.
As you see the Relationship between tblCustomers & tblOrders 1-To-Many
and Relationship between tblOrders & tblOrdersDetails 1-To-1
I have 3 questions :
1- when I create a form for the tblOrders and enter a specific order for a specific customer, I want the program to automatically send this OrderID to the tblOrdersDetails and put in the OrderStatus Field some string for example “Processing.” To be able to deal with it later (I just want to define the order In tblOrdersDetails table to deal with later)..
How can we do this and what is the best way to Handle this scenario?
2- Is this the correct way to create tables for this purpose I mean create those 2 tables (Orders & OrdersDetails) or should combine them in one Table To solve this problem, Knowing I prefer to set the Orders and OrdersDetails it on a different Table?
3- Is it necessary to add CustomerID to tblOrdersDetails or this method apply just for Junction Table when we have Many-To-Many Relationship or this optional?
I have attached the file, I would appreciate any help