Queries
Explain what a query does, identify the purpose of a base, distinguish between filters and exports, build a simple query, and use a query to answer a real-world Slate question.
Queries help you find the records you need by starting with the right type of record, narrowing the results with filters, and choosing what information to return.
Queries: Ask Questions of Your Data
Slate stores a tremendous amount of information. Once that information exists, you need a way to find the records that matter for the question you're trying to answer.
That's what queries do. A query allows you to start with a group of records, narrow that group using criteria, and return the information you need.
For beginners, it helps to think of every query as answering a question: Which students submitted an application this term? Who registered for an upcoming event? Which records have an email address? How many students selected Nursing as an academic interest?
Base → Filters → Exports → Results
Who or what are you starting with?
Which of those records should remain?
What information do you want to see?
The records and information returned by the query
Base
Filters
Exports
Results
Every query starts with context. Before adding filters or exports, you need to understand what kind of records you're working with. That's why the Base matters.
Remember these
A tool used to find records that meet defined criteria and return selected information.
Defines the type of records the query begins with.
A condition used to narrow which records are included.
A piece of information returned in the query results.
The records and information returned after the query runs.
Filters vs. Exports
Who should be included?
- State = Tennessee
- Email is not blank
- Academic Interest = Nursing
What do I want to see about them?
- First Name
- Last Name
- Email Address
- Academic Interest
Filters decide WHO. Exports decide WHAT YOU SEE.
Check your understanding
One question at a time. Wrong answers are just practice.
You want a list of people whose State is Tennessee. What role does “State = Tennessee” play in the query?
Build Your First Query
Build a simple query and identify its Base, Filters, Exports, and Results.
Open your institution's Slate database in another tab. Create a new query using a Base that allows you to work with Person records. Because Slate configurations and permissions vary, the exact Base name available to you may differ. Build a simple query that identifies people whose Last Name = Smith AND Email Address is not blank, then return First Name, Last Name, and Email Address.
- Create a new query
- Select an appropriate Base
- Add a Last Name = Smith filter
- Add an Email is not blank filter
- Add First Name as an export
- Add Last Name as an export
- Add Email Address as an export
- Run or preview the query results
Depending on your institution's permissions and data, your exact filter and export names may vary. The goal is to practice the structure of the query, not reproduce an identical configuration.
People
Last Name = Smith; Email Address is not blank
First Name; Last Name; Email Address
Slate is highly customizable. Your institution's tabs, fields, views, permissions, and processes may differ from examples used throughout Insider's Aid. Focus on understanding the concept rather than finding an identical screen.
Reflection
You built a query with the filter State = Tennessee and the export Email Address. What does the query do?
Your Director Needs a List
Your director asks: “Can you give me a list of prospective students who have Nursing as their academic interest and include their name and email address?” Before opening the query tool, what should you identify?
What should you identify first?
Build the Query in Your Head
Your institution wants a list of people where State = Tennessee, Academic Interest = Nursing, and Email Address is not blank. The final list should display First Name, Last Name, Email Address, and Academic Interest.
Which grouping classifies these correctly?
When Do You Need a Query?
Which situation most naturally calls for a query?
Pick the situation that calls for a query.
Think Like a Slate User
Business question
Start with the real-world ask
Who or what?
Choose the Base
Who matches?
Add Filters
What do I need to see?
Add Exports
Results
The records and information returned
Don't start with the query builder. Start with the question.
A strong Slate user learns to translate a real-world question into data before building anything. When someone asks for a list, report, audience, or group of records, pause and identify: What type of records am I working with? What criteria define the group? What information needs to be returned?
Write the question in plain language before building the query. If you can't clearly explain who you're trying to find and what you need to know about them, you're probably not ready to build.
Put It Together
Your Slate mental model is now: Record → Field → Value → Form → Query.
Who or what does the information belong to?
What type of information is stored?
What information is actually stored?
How might we collect information we don't have?
How do we find records based on information Slate already has?
For example: a Person record holds the field Academic Interest, whose value is Nursing — collected by a form asking “What program are you interested in?” — and found later by a query: “Find everyone whose Academic Interest = Nursing.”
This is how Slate concepts begin to connect. Forms can help collect information. Fields give that information a place to live. Queries help you find the records whose data matches the question you're trying to answer.
Keep Learning
Records
Review what type of record you're working with.
Fields
Review where the information you're filtering and exporting lives.
Forms
Review how information can be collected.
Datasets
Learn how structured collections of records and information can be organized.
Finished the lesson?
Mark it complete to track your progress. Progress is saved in this browser.
