Are you looking for how to add product attribute(s) through in WooCommerce programmatically, then here is the solution for all the above query.
WooCommerce 3.0 had released a new way of creating, updating or deleting a product or an order using CRUD method. In this tutorial, we'll be learning how to use it to create or update a product.
Wondering how WooCommerce stores the product attributes information in the database? In this tutorial, I have taken a deep drive in WooComerce and database which will give you a brief idea of how product attribute are organized in WordPress Tables.