Magento Database – Use of Order Tables in magento

Magento Database – Use of Order Tables in magento
Below tables are useful, when order is successfully placed by the customer in the frontend. If admin placing the order details also update here.
1. sales_flat_order
2. sales_flat_order_item
3. sales_flat_order_grid
4. sales_flat_order_address
5. sales_flat_order_payment
6. sales_order_status_history

Table :1 sales_flat_order:
This is the main table , if order is done by successfully. For each order, each row will create in this table. About the order details, we will get it from here, like order amount, and state/status of the order, etc…

Table :2 sales_flat_order_item:
This is order line item table. One or more than one line item products (it depend on the order) for a order. Those line item products details will get it from this table.Will get each line item product details like SKU, product ID, price details, if any custom attribute are created by developer , etc…

Table :3 sales_flat_order_grid:
This is grid table. When admin see the order grid section from admin sales -> order , total order detail are coming as a grid format. Those values are comming from this table. In grid section, instead referring around 5 tables , will refer thi grid table. It take very less time to show the order details in grid.

Table :4 sales_flat_order_address:
Order billing address and shipping address detail will get it from here.

Table : 5 sales_flat_order_payment:
From this table, will order payment details like which payment method is used, what is the amound (billing,shipping,cancel,refund).

Table :6 sales_order_status_history:
From this table, will get the detail about status history. Once order is successfully created by the customer, one row will create with status called order. If invoice is generated for this order by admin , another row will created with status called “invoice”, simillary for shipping, creditmemo, cancel..etc.

Leave a Reply