Connecting data, tables, and creating a model
Before you start writing your first queries in SQL, you need to prepare a little bit. It’s a good idea to create an account with Weld, or request access if your organization already has a Weld account. Once you have a Weld account, you can connect the sample data to your data warehouse, as we’ll be using this data set in the tutorial.
If you’ve just signed up for Weld, the e-commerce sample data will be suggested for you to connect to. If you already had an account in Weld, you might need to set up a new gather sync through this connector. You’ll find this in the Gather section inside Weld.
Once you’ve connected to a data source, you’ll get access to the data. This will typically consist of several tables, each with different pieces of information. You can see the different tables once you set up the connector, or in the sidebar to the left in the Weld Editor in the Raw Data section. As you can see, the sample e-commerce data set consists of three different tables:
- Webshop customer (with one row of information for each customer in the webshop),
- Webshop order (one row for each order in the shop), and
- Order line (one row for each line in the orders)
If you connect to other tools such as Hubspot or Stripe, these will also consist of several different tables representing the different information available in these tools.
Now you’ve connected the data you’ll be using in this Getting Started guide. The last thing to do to prepare is to create the model you’ll be working with. A model is a file in which you define how you’d like to manipulate the raw data to get the results you require. It’s easy to create a new model in Weld. Make sure you’re in the model layer of Weld (click Model in the sidebar to the left), and then simply click ‘+ New’. Now you’ve created your own model. For now, it doesn’t matter where you locate the model, or if you just keep it as an unpublished model.
Remember that by writing SQL, you do not alter the raw data in any way. You simply put a new layer of manipulation on top of the data. When you add a new model, you also do not change the data being used elsewhere, for example in any dashboards someone in your organization has set up. To change that data, you would have to enter their models and make changes to them, and publish those changes. You can therefore safely create as many new models as you want in Weld, without putting your existing data operations at risk.
The last thing to note before you start writing your first queries is that in your models, you can reference not only different sources of raw data, but also other data models when they’re made public. In this way, you can split your analysis into several steps in different models before you arrive at the end result you’re looking for and want to add to a dashboard or activate by sending the data back to your business tools.