LoslegenKostenlos loslegen

Querying a column-oriented database

In this example, you'll use Snowflake to query data from the olympic_medals table. This table contains information about Olympic medal winners going back to 1896. To work with this data stored in Snowflake, you'll be using the snowflake.connector package. A connection object has been created, which is stored in the variable conn. Best of luck!

Diese Übung ist Teil des Kurses

Introduction to NoSQL

Kurs anzeigen

Anleitung zur Übung

  • Update the string stored to the query variable to return all columns of the olympic_medals table, limiting to the first ten rows.
  • Execute the query stored in the query variable, using the conn.cursor().execute() function.
  • Print the results of the query, which are stored in the results variable.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Write a query to return all columns, limiting to 10 rows
query = "SELECT * FROM ____ LIMIT 10;"

# Execute the query
results = conn.cursor().execute(____).fetch_pandas_all()

# Print the results of the query
print(____)
Code bearbeiten und ausführen