BaşlayınÜcretsiz Başlayın

What are the tables in the database?

In this exercise, you'll once again create an engine to connect to 'Chinook.sqlite'. Before you can get any data out of the database, however, you'll need to know what tables it contains!

To this end, you'll save the table names to a list using the method .table_names() on the engine and then you will print the list.

Bu egzersiz

Introduction to Importing Data in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import the function create_engine from the module sqlalchemy.
  • Create an engine to connect to the SQLite database 'Chinook.sqlite' and assign it to engine.
  • Using the method .table_names() on the engine engine, assign the table names of 'Chinook.sqlite' to the variable table_names.
  • Print the object table_names to the shell.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import necessary module


# Create engine: engine


# Save the table names to a list: table_names


# Print the table names to the shell
print(____)
Kodu Düzenle ve Çalıştır