customer\_entity

Shortly after the addition of the three new products, a new customer, Sammy Customer, visits Clothes4U’s website for the first time. Since Clothes4U does not allow guest orders, Sammy Customer must first create an account on the website. Customer enters required credentials and clicks submit, resulting in the following new entry on the customer\_entity table:

entity identity type idemailcreated at
2141sammy.customer@gmail.com2016/09/23 15:27:12
  • entity_id - Just like the prior table, entity_id is the primary key of the customer_entity table.
    • When Sammy Customer created an account and the row above was written to the customer_entity table, customer was assigned entity_id = 214. Throughout all tables, the customer identified as entity_id = 214 always refers to the user Sammy Customer
  • entity_type_id – This column identifies which type of entity is being listed in this table, and functions the same way as it does in the catalog_product_entity table
    • Every row on the customer_entity table is a customer, and Commerce defines customers as entity_type_id 1 by default
  • email – this field is populated by the email that a new customer enters when making their account
  • created_at – This column returns the timestamp for when each user joined

sales\_flat\_order (or Sales\_order if you have Adobe Commerce 2.x

With the account creation finished, Sammy Customer is ready to start making a purchase. On the website, the customer adds two pairs of the Throwback Bellbottoms and one V-Neck T-Shirt to the cart. Satisfied with the selections, the customer moves to checkout and submits the order, creating the following entry on the sales flat order table:

entity id**customer id**subtotalcreated at
22721494.852016/09/23 15:41:39
  • entity_id – this is the primary key of the sales_flat_order table.
    • When Sammy Customer placed this order and the row above was written to the sales_flat_order table, the order was assigned entity_id = 227.
  • customer_id – This column is the unique identifier of the customer who placed this particular order
    • The customer_id associated with this order is 214, which is Sammy Customer’s entity_id on the customer_entity table.
  • subtotal – This column is the total amount charged to a customer for the order
    • The two pairs of “Throwback Bellbottoms” and the “V-Neck T-Shirt” cost $94.85 dollars in total
  • created_at – This column returns the timestamp for when each order was created