Skip to content
Python for Quantitative Finance / Data access and delivery

SQL and Persistent Data

A duplicate close can become a false return if it enters a price panel unnoticed. A relational schema can reject duplicate instrument-date keys before estimation. This lesson stores fixture prices in SQLite, queries a bounded sample and reshapes it into a pandas panel.

Learning objectives. By the end of this note you should be able to:
  • create a prices table with a composite primary key and useful columns;
  • insert rows with executemany and parameter binding;
  • query a date-bounded panel and pivot it to wide form in pandas;
  • explain what "system of record" means for a research or risk pipeline.

In this lesson

  1. Schema for prices
  2. Load and query a panel
  3. Why not only files?
  4. Integrity checks in SQL
  5. Parameter binding remains mandatory
  6. Repository module sketch

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or browse the Python for Quantitative Finance syllabus.