Exploring an unfamiliar database
1. Exploring an unfamiliar database
Every new role comes with a database someone else built, and CoCo can help you find your way around it.2. The plan
In this video, you'll do exactly that with a retailer's sales data. First, you'll get to know its tables and how they connect.3. The plan
Then you'll ask CoCo a business question about that data.4. The plan
Finally, you'll check the answer with a shortcut and two commands that let you see what CoCo actually did.5. Meet the SHOP data
The data belongs to an online electronics retailer, and it lives in a schema called SHOP. Customers holds the people who buy, with one row for each customer.6. Meet the SHOP data
Products holds the twelve items on sale.7. Meet the SHOP data
Orders records each purchase, along with its date and its status.8. Meet the SHOP data
One order can hold several products, so order items has a row for each one, with the price the buyer actually paid.9. Meet the SHOP data
Reviews hold the ratings customers gave the products they bought.10. Let CoCo map it
You don't need to work all of that out by hand. Ask CoCo what's in the database and how the tables connect, and it reads the schema itself and comes back with a map like this one.11. Database and business
That's the part CoCo handles well, because it can see every table and column your account can reach.12. Database and business
What it can't see is how your business works. Your team decides which orders count as sales, and what a status like cancelled means for the numbers. Those rules live with you, so CoCo's answers improve the moment you add them to your question.13. Ask with what you know
Here's what that looks like in practice. Say you want to know which three products brought in the most revenue.14. Ask with what you know
You also know that cancelled orders shouldn't count, so you say so, along with how they're recorded: the word CANCELLED in the status column.15. The answer
CoCo replies in plain language with the top three, led by the noise cancelling headphones at just over twelve thousand dollars. If a figure ever looks wrong, say so in a follow-up, and CoCo will check the data and run its query again.16. Expand with Ctrl+O
By default, CoCo keeps its working out of the way. Press Control O to expand each step and see the exact SQL behind the answer. Here, you can confirm that it joined the right tables and that your rule made it in, as a filter on the status column.17. Query with /sql
Most of the time, asking is all you'll need. But when you want to see the exact rows for yourself, type slash sql followed by a query, and it runs straight against Snowflake without going through CoCo. Counting orders by status, for example, shows the twenty cancelled orders that were left out.18. Browse with /table
When a result is too long to read in place, slash table opens it full screen, with the query above it, so you can scroll through every row.19. What you learned
You now have three ways to check CoCo's work: Control O for the SQL it ran, slash sql for a query of your own, and slash table for a full-screen view.20. What you learned
You've also seen how the work splits. CoCo already knows your database, so the business context is the part you bring to every question.21. Let's practice!
Now it's your turn to explore the SHOP data with CoCo.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.