1. 학습
  2. /
  3. 강의
  4. /
  5. Scaling and Optimizing Data Pipelines with Polars

Connected

연습 문제

Appending to a SQLite history table

Each week, the team writes the latest digital format summary back to a shared SQLite history table. The table already holds last week's snapshot, and you want this week's results added on top, not replacing what's there. Use the write_database method with the right if_table_exists value.

This week's summary is in weekly_summary, and the SQLite URI is in uri. The existing table is printed for you, so you can compare it with what you write.

지침

100 XP
  • Call the method that writes a DataFrame back to a SQL table.
  • Add the argument that controls how an existing table is handled.
  • Set its value so the new rows are appended.