{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Data Workbench","type":"markdown"},"seo":{"title":"Query sample table","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"query-sample-table","__idx":0},"children":["Query sample table"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To query a sample table:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench > Queries"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Query"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sample_datasets"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Write a query of your choice against the table named \"www_access\"."," ","Here is one example query that counts and sorts HTTP requests by their status codes."]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"SELECT\n  code AS http_status_code,\n  COUNT(1) AS num_requests\nFROM www_access\nGROUP BY code\nORDER BY num_requests\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190905-231536.746638ef902be3649c2d5f93f05a26508ec656b4fabe30ac7590521f9f9b5154.142841d8.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Run"]},". You can monitor the query job status in the Query Result portion of the screen. For example:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190905-231552.5d2ff6160c69bfb797d7af42d8d116f6b9ac0b4ae8b115946730f537c66ff91e.142841d8.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":6},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When the job is done, the status changes from RUNNING to SUCCESS. You can also view the results within the Jobs view."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190905-231613.6d7ecd2f3a839ef9ba444110e7fa8a3aa5f88faec019cef3b4e788542d345124.142841d8.png","alt":""},"children":[]}]}]},"headings":[{"value":"Query sample table","id":"query-sample-table","depth":1}],"frontmatter":{"seo":{"title":"Query sample table"}},"lastModified":"2025-11-24T01:09:09.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/data-workbench/getting-started/querying-a-sample-table","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}