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

Setup the engine and metadata

In this exercise, your job is to create an engine to the database that will be used in this chapter. Then, you need to initialize its metadata.

Recall how you did this in Chapter 1 by leveraging create_engine() and MetaData().

Bu egzersiz, kursun bir parçasıdır

Introduction to Databases in Python

Kursa Göz Atın

Egzersiz talimatları

  • Import create_engine and MetaData from sqlalchemy.
  • Create an engine to the chapter 5 database by using 'sqlite:///chapter5.sqlite' as the connection string.
  • Create a MetaData object as metadata.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Import create_engine, MetaData


# Define an engine to connect to chapter5.sqlite: engine
engine = create_engine(____)

# Initialize MetaData: metadata
metadata = ____
Kodu Düzenle ve Çalıştır