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

Kurssisisältö

Databases in Python

Databases in Python

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

book
Challenge: First Table

Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 5
toggle bottom row

book
Challenge: First Table

Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 5
Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?
some-alt