Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: First Table | Introduction to SQLite
Databases in Python
course content

Course Content

Databases in Python

Databases in Python

1. Introduction to SQLite
2. CRUD
3. More About SQLite
4. SQLAlchemy

book
Challenge: First Table

Task

Swipe to start coding

Your task is to complete the code that creates an SQLite database and a table called articles. Here’s what you need to do:

  1. Connect to the database my_database.db.
  2. Create a cursor to execute SQL commands.
  3. Use the cursor to create a table named articles with the following fields:
    • id — type INTEGER.
    • title — type TEXT.
    • content — type TEXT.
    • author — type TEXT.
  4. Save the changes and close the database connection.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 5
toggle bottom row

book
Challenge: First Table

Task

Swipe to start coding

Your task is to complete the code that creates an SQLite database and a table called articles. Here’s what you need to do:

  1. Connect to the database my_database.db.
  2. Create a cursor to execute SQL commands.
  3. Use the cursor to create a table named articles with the following fields:
    • id — type INTEGER.
    • title — type TEXT.
    • content — type TEXT.
    • author — type TEXT.
  4. Save the changes and close the database connection.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 5
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt