Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
    • Data
Google Cloud Platform icon
Labs

Querying Data in Amazon S3 with Amazon Athena

Welcome to this hands-on AWS lab, where we'll query data stored in Amazon S3 with SQL queries in Amazon Athena. Let's get started!

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 23, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Create a Table from S3 Bucket Metadata
    1. Navigate to Amazon Athena.
    2. Configure settings to send query results to the S3 bucket and enable Assign bucket owner full control over query results.
    3. Create a table from the S3 bucket data using the following values:
      • Database: aws_service_logs
      • Table Name: cf_access_optimized
      • Location of Input Data Set: s3://<S3_BUCKET_NAME>/
      • Data Format: Parquet
    4. Bulk add columns using this data:
      time timestamp, location string, bytes bigint, requestip string, method string, host string, uri string, status int, referrer string, useragent string, querystring string, cookie string, resulttype string, requestid string, hostheader string, requestprotocol string, requestbytes bigint, timetaken double, xforwardedfor string, sslprotocol string, sslcipher string, responseresulttype string, httpversion string
      
    5. Create the following partitions:
      • Column Name: year
      • Column Name: month
      • Column Name: day
    6. Click Create table.
  2. Challenge

    Add Partition Metadata
    1. Open a new query tab.

    2. Run the following query:

      MSCK REPAIR TABLE aws_service_logs.cf_access_optimized
      
    3. Observe that the row count equals 207535 with the following query:

      SELECT count(*) AS rowcount FROM aws_service_logs.cf_access_optimized
      
    4. Verify the partitions were created with the following query:

      SELECT * FROM aws_service_logs.cf_access_optimized order by time desc LIMIT 10
      
  3. Challenge

    Query the Total Bytes Served in a Date Range
    1. Observe the bytes column from the following query:

      SELECT * FROM aws_service_logs.cf_access_optimized WHERE time BETWEEN TIMESTAMP '2018-11-02' AND TIMESTAMP '2018-11-03'
      
    2. Run the following query:

      SELECT SUM(bytes) AS total_bytes
      FROM aws_service_logs.cf_access_optimized
      WHERE time BETWEEN TIMESTAMP '2018-11-02' AND TIMESTAMP '2018-11-03'
      
    3. Observe the value for total_bytes equals 87310409.

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight