Insert New Records into SQLite Database from CSV
Beginner Mode

Start your terminal to use beginner mode.

Scenario

A CSV file contains customer records that need to be imported into a database. Some records may already exist in the database and should not be duplicated.

Task

Write a Python script at /home/interview/insert_new_records.py that reads /home/interview/new_customers.csv, checks if each record already exists in the customers table of /home/interview/customers.db (based on the id field), and inserts only the new records.

Terminal requires a larger screen

Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.

Linux Terminal Environment

Write and execute your solution in the terminal below.

Sign In

Track

Question Difficulty Company Access
Need more practice in this area? Explore more questions →