Find query evidence and explore databases
Use Query History to inspect execution and Database Explorer to find objects.
Understand the idea
Match its text and execution time, then record the query ID and status. A query that fails can still leave history useful for diagnosis. The amount of history you can see depends on the surface and your privileges.
| Concept | What it means |
|---|---|
| Query History | Find statement text, query ID, status, timing and execution context. |
| Database Explorer | Browse database → schema → table/view → columns. |
| Failure diagnosis | Read the exact error and verify account, role and namespace. |
A concrete example
SELECT definitely_missing_column; produces an undefined-identifier error. Query details show which statement failed.
Remember: Record the query ID and context when investigating a problem.
Explain it step by step · full theory
A query has an identity and an outcome
Query History records execution evidence such as statement identity, status, timing and context. After your first VALUES query, open the query history area or the statement’s query details and locate that execution.
Match its text and execution time, then record the query ID and status. A query that fails can still leave history useful for diagnosis. The amount of history you can see depends on the surface and your privileges.
Read a failure in its context
For a controlled exercise, submit SELECT definitely_missing_column; in a learning SQL file. The identifier has no defined source, so expect a compilation error. Open its details, read the error and compare it with the successful two-row query.
The missing identifier should lead you back to the SQL text. Changing warehouse size would not define the column. In later lessons you will also inspect queueing, execution and query-profile operators. For now, learn to capture the exact failed statement and context.
Explore the object hierarchy
Use Database Explorer or the database browsing area to expand an accessible database, then a schema, then a table or view. Inspect column names and types before requesting a data preview.
The database/schema hierarchy forms part of an object’s name. SALES.PUBLIC.ORDERS names a table in a particular schema and database within the current account. Your view of objects is shaped by permissions. An absent table may require checking role, account and namespace.
A preview can execute a query using compute. If the role can see an object name but cannot read its data, inspect the needed privileges with the administrator. Write down the fully qualified name and columns before composing a query.
Words used in this lesson
- Query ID
- An identifier for a particular statement execution.
- Compilation
- Preparing and validating a statement for execution.
- Database Explorer
- A hierarchy for browsing accessible database objects.
See how it works
Choose a step to explore the idea at your own pace.
Open the interactive explanation
Find query evidence and explore databases
Find
Locate the specific statement execution.
Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.
Read the complete diagram explanation
- Find
Locate the specific statement execution.
- Diagnose
Read status and context together.
- Explore
Resolve a table through its namespace.
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Before running this lesson
Current browser guidance uses Workspaces. Visible controls depend on role and account configuration.
Explore visible objects
SHOW DATABASES;
SHOW SCHEMAS;
SELECT CURRENT_SESSION() AS SESSION_ID;What to expect and why
SHOW returns only objects visible to your role. Use Query History in Snowsight to locate these statements and compare the session ID.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
Locate the successful sample query and compare it with an intentional missing-column error.
Compare your reasoning
Match each statement to its query ID and status, explain the undefined identifier, and verify the account/role/warehouse used.