Run SQL in the Query Builder
The Query Builder lets you browse the tables in any public data source and run read-only SQL against them. Open Data, pick a source, select Query Builder, write a query and select Execute.
Who can do this: Owner, Admin and Member. About roles
Use the Query Builder when you want to see the raw tables behind an answer, check a number yourself or write your own SQL. Every source has its own Query Builder, and a query runs against one source at a time.
Open a source
Step 1: Select Data in the left rail.
Step 2: Under Public Data, select a source such as IPEDS, then Query Builder.
You can also select a source card on Overview.
Step 3: Check the strip above the editor.
It shows Last updated and Frequency for the source.
Browse a table
Step 1: Find the table in the left panel.
The panel header shows the source name and the number of tables. The panel is hidden on phone-sized screens.
Step 2: Select the table name.
Clema shows its rows with a row and column count.
Run a query
Step 1: Type your SQL in Query Editor.
The editor highlights SQL, suggests table names from the current source as you type and supports find.
Step 2: Select Execute, or press
Cmd+Enteron Mac orCtrl+Enteron Windows.The button reads Executing... and the editor is locked while the query runs.
Step 3: Read Query Results.
The header shows rows, columns and run time in milliseconds. Results come back 100 rows per page.
Step 4: To stop a running query, select Cancel.
Step 5: To empty the editor, select Clear.
Limits
| Limit | Detail |
|---|---|
| Read-only | Only queries that read data are accepted. You cannot insert, update or delete. |
| One source per query | A query sees the tables of the source you opened. |
| Page size | 100 rows per page. |
| Saved queries | Not available. Keep queries you want to reuse in your own notes. |
| Export | There is no download or export button for results. |
| History | Logs shows the last 100 executions. See query logs. |
Share a link to a source
The source is part of the page address, for example /data/query?source=ipeds. Send that link to a teammate in your organization to open the same source. The link does not carry your query text.
Troubleshooting
- "Query cannot be empty"
- Type a query in the editor before selecting Execute.
- "The request timed out. Please try again."
- Narrow the query. Add a
WHEREfilter on year or institution, select fewer columns or add aLIMIT, then run it again. - An Error: box with a database message
- The message comes from the database. Check table and column names against the left panel and Data Definitions.
- "No tables available"
- Reload the page. If the list stays empty, contact support.
- You are sent to chat when you open the Data area
- Your role is Data Requester, which does not include the Data area. Ask an Owner or Admin to change your role. See roles and permissions.
Common questions
- Can I save a query in the Query Builder?
- No. There are no saved queries. The Logs view keeps the last 100 executions, so you can find a recent query there and copy it.
- Can I export query results to CSV?
- Not from the Query Builder. Ask the question in chat instead, where charts offer Download CSV.
- Can the Query Builder write SQL for me from plain English?
- No. The Query Builder runs the SQL you type. To ask in plain English, use chat, then open Sources under the answer to see the SQL Clema wrote.
- Can I change the data?
- No. The Query Builder only accepts read-only queries.