Зміст курсу
Databases in Python
Databases in Python
Challenge: First Table
Завдання
Your task is to complete the code that creates an SQLite database and a table called articles
. Here’s what you need to do:
- Connect to the database
my_database.db
. - Create a cursor to execute SQL commands.
- Use the cursor to create a table named
articles
with the following fields:id
— typeINTEGER
.title
— typeTEXT
.content
— typeTEXT
.author
— typeTEXT
.
- Save the changes and close the database connection.
Once you've completed this task, click the button below the code to check your solution.
Дякуємо за ваш відгук!
Challenge: First Table
Завдання
Your task is to complete the code that creates an SQLite database and a table called articles
. Here’s what you need to do:
- Connect to the database
my_database.db
. - Create a cursor to execute SQL commands.
- Use the cursor to create a table named
articles
with the following fields:id
— typeINTEGER
.title
— typeTEXT
.content
— typeTEXT
.author
— typeTEXT
.
- Save the changes and close the database connection.
Once you've completed this task, click the button below the code to check your solution.
Дякуємо за ваш відгук!
Challenge: First Table
Завдання
Your task is to complete the code that creates an SQLite database and a table called articles
. Here’s what you need to do:
- Connect to the database
my_database.db
. - Create a cursor to execute SQL commands.
- Use the cursor to create a table named
articles
with the following fields:id
— typeINTEGER
.title
— typeTEXT
.content
— typeTEXT
.author
— typeTEXT
.
- Save the changes and close the database connection.
Once you've completed this task, click the button below the code to check your solution.
Дякуємо за ваш відгук!
Завдання
Your task is to complete the code that creates an SQLite database and a table called articles
. Here’s what you need to do:
- Connect to the database
my_database.db
. - Create a cursor to execute SQL commands.
- Use the cursor to create a table named
articles
with the following fields:id
— typeINTEGER
.title
— typeTEXT
.content
— typeTEXT
.author
— typeTEXT
.
- Save the changes and close the database connection.
Once you've completed this task, click the button below the code to check your solution.