MulaiMulai sekarang secara gratis

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!

Latihan ini adalah bagian dari kursus

Introduction to NoSQL

Lihat Kursus

Petunjuk latihan

  • 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.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# 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(____)
Edit dan Jalankan Kode