SQLite

SQLite logo


sqlite3 Python documentation

https://docs.python.org/3.7/library/sqlite3.html

The sqlite3 Python package documentation page.


Databases

MySQL client

People use the term database to sometimes mean:

  • The data set itself.
  • A program that manages datasets.
  • The computer that runs the program.

Purposes

  • Persistent storage.
  • Fast data storage and retrieval algorithms.
  • Dealing with multi-user conflicts.

Types

Relational database table

  • Relational databases where data are structured in tables.
  • NoSQL databases with no particular structure.
  • Relational versus all other types, because relational are historically the most common.

Many tables

SQL join

  • Excel is great for single table scenarios.
  • Gets a little clunky when you have two or more tables that are related.

Connections

  • Database server/management system is a program running on some machine.
  • Access it by knowing the connection details, supplied by the database administrator.
  • Typcially need database type, IP address, port, username, password, database name.

import mysql.connector
cnx = mysql.connector.connect(user='scott', password='password',
                              host='127.0.0.1',
                              database='employees')
cnx.close()


SQLite

  • Simple database that runs in memory.
  • Not really a separate program/process/software - it's part of your program.
  • Uses the SQL language.

SQL

  • Structured Query Language.
  • Simple syntax.
  • State what you want, not how to get it.
  • CRUD: Create, Retrieve, Update, Delete.

CREATE TABLE person(id AUTOINCREMENT PRIMARY KEY, name VARCHAR(255), address VARCHAR(255));
    INSERT INTO person VALUES("Joe Bloggs", "Galway");
    SELECT name FROM person;
    UPDATE person SET address="Sligo" WHERE name="Joe Bloggs";
    DELETE FROM person WHERE name="Joe Bloggs";
    DROP TABLE person;

Join in pandas

In [1]:
import pandas as pd
In [2]:
person = pd.read_csv("https://github.com/ianmcloughlin/datasets/raw/master/cars-db/person.csv", index_col=0)
person.head(10)
Out[2]:
Name Address
ID
0 Anna Henry Carlow
1 Shelby Beck Tipperary
2 Marie Carr Kerry
3 Sarah Heath Monaghan
4 Robert Snyder Leitrim
5 Lucas Ross Cork
6 David Cox Leitrim
7 Jackson Dean Louth
8 Elizabeth Mcfarland Dublin
9 Timothy Cummings Limerick
In [3]:
car = pd.read_csv("https://github.com/ianmcloughlin/datasets/raw/master/cars-db/car.csv", index_col=0)
car.head(10)
Out[3]:
Registration OwnerId
ID
0 08-SO-11072 9
1 16-KE-16368 97
2 08-LD-16871 17
3 11-KY-17442 22
4 16-LD-17545 48
5 10-WH-3543 10
6 03-KE-8148 74
7 06-G-23024 4
8 08-LS-21770 93
9 03-WX-41717 53
In [4]:
county = pd.read_csv("https://github.com/ianmcloughlin/datasets/raw/master/cars-db/county.csv", index_col=0)
county.head(10)
Out[4]:
Registration Name
ID
0 CW Carlow
1 CN Cavan
2 CE Clare
3 C Cork
4 DL Donegal
5 D Dublin
6 G Galway
7 KY Kerry
8 KE Kildare
9 KK Kilkenny
In [5]:
# Join the car and person data frames on two columns.
pd.merge(car, person, left_on="OwnerId", right_on="ID", how="left")[["Registration", "Name"]].head()
Out[5]:
Registration Name
0 08-SO-11072 Timothy Cummings
1 16-KE-16368 Dana Wade
2 08-LD-16871 Valerie Stewart
3 11-KY-17442 Gregory Vazquez
4 16-LD-17545 Sara Lee
In [6]:
# Find people with cars registered in counties other than where they live.
tmp = pd.merge(car, person, left_on="OwnerId", right_on="ID", how="left")
tmp = pd.merge(tmp, county, left_on="Address", right_on="Name", how="left")
tmp['Registration_x'] = tmp['Registration_x'].apply(lambda x: x.split("-")[1])
tmp = tmp[tmp['Registration_x'] != tmp['Registration_y']]
tmp.head(10)
Out[6]:
Registration_x OwnerId Name_x Address Registration_y Name_y
0 SO 9 Timothy Cummings Limerick L Limerick
1 KE 97 Dana Wade Mayo MO Mayo
3 KY 22 Gregory Vazquez Sligo SO Sligo
4 LD 48 Sara Lee Laois LS Laois
5 WH 10 Jennifer Reeves Offaly OY Offaly
6 KE 74 Leonard Chen Galway G Galway
7 G 4 Robert Snyder Leitrim LM Leitrim
8 LS 93 Morgan Marsh Westmeath WH Westmeath
9 WX 53 Kayla Rodriguez DVM Clare CE Clare
10 T 63 Robert Acevedo Meath MH Meath

SQLite in Python

In [7]:
import sqlite3
In [8]:
conn = sqlite3.connect('data/example.db')
In [9]:
c = conn.cursor()
In [10]:
c.execute('CREATE TABLE person(name text, address text)')
conn.commit()
In [11]:
c.execute("SELECT name FROM sqlite_master")
c.fetchall()
Out[11]:
[('person',)]
In [12]:
c.execute("INSERT INTO person VALUES ('Anna Henry', 'Carlow')")
conn.commit()
In [13]:
c.execute("SELECT name, address FROM person")
c.fetchall()
Out[13]:
[('Anna Henry', 'Carlow')]
In [14]:
people = [('Shelby Beck', 'Tipperary'), ('Marie Carr', 'Kerry'), ('Sarah Heath', 'Monaghan')]
In [15]:
people
Out[15]:
[('Shelby Beck', 'Tipperary'),
 ('Marie Carr', 'Kerry'),
 ('Sarah Heath', 'Monaghan')]
In [16]:
c.executemany("INSERT INTO person VALUES (?, ?)", people)
conn.commit()
In [17]:
c.execute("SELECT name, address FROM person")
c.fetchall()
Out[17]:
[('Anna Henry', 'Carlow'),
 ('Shelby Beck', 'Tipperary'),
 ('Marie Carr', 'Kerry'),
 ('Sarah Heath', 'Monaghan')]
In [18]:
c.execute("INSERT INTO person VALUES ('Anna Henry', 'Carlow')")
conn.commit()
In [19]:
c.execute("SELECT ROWID, name, address FROM person")
c.fetchall()
Out[19]:
[(1, 'Anna Henry', 'Carlow'),
 (2, 'Shelby Beck', 'Tipperary'),
 (3, 'Marie Carr', 'Kerry'),
 (4, 'Sarah Heath', 'Monaghan'),
 (5, 'Anna Henry', 'Carlow')]
In [20]:
c.execute("DELETE FROM person WHERE ROWID=1")
conn.commit()
In [21]:
c.execute("SELECT ROWID, name, address FROM person")
c.fetchall()
Out[21]:
[(2, 'Shelby Beck', 'Tipperary'),
 (3, 'Marie Carr', 'Kerry'),
 (4, 'Sarah Heath', 'Monaghan'),
 (5, 'Anna Henry', 'Carlow')]
In [22]:
c.execute("INSERT INTO person VALUES ('Robert Snyder', 'Leitrim')")
conn.commit()
In [23]:
c.execute("SELECT ROWID, name, address FROM person")
c.fetchall()
Out[23]:
[(2, 'Shelby Beck', 'Tipperary'),
 (3, 'Marie Carr', 'Kerry'),
 (4, 'Sarah Heath', 'Monaghan'),
 (5, 'Anna Henry', 'Carlow'),
 (6, 'Robert Snyder', 'Leitrim')]

sqlite3 with pandas

In [24]:
c.execute("DROP TABLE person")
conn.commit()
In [25]:
person = pd.read_csv("https://github.com/ianmcloughlin/datasets/raw/master/cars-db/person.csv", index_col=0)
person.head(10)
Out[25]:
Name Address
ID
0 Anna Henry Carlow
1 Shelby Beck Tipperary
2 Marie Carr Kerry
3 Sarah Heath Monaghan
4 Robert Snyder Leitrim
5 Lucas Ross Cork
6 David Cox Leitrim
7 Jackson Dean Louth
8 Elizabeth Mcfarland Dublin
9 Timothy Cummings Limerick
In [26]:
person.to_sql("person", conn)
In [27]:
car = pd.read_csv("https://github.com/ianmcloughlin/datasets/raw/master/cars-db/car.csv", index_col=0)
car.to_sql("car", conn)
In [28]:
county = pd.read_csv("https://github.com/ianmcloughlin/datasets/raw/master/cars-db/county.csv", index_col=0)
county.to_sql("county", conn)
In [29]:
c.execute("SELECT * FROM county")
c.fetchall()
Out[29]:
[(0, 'CW', 'Carlow'),
 (1, 'CN', 'Cavan'),
 (2, 'CE', 'Clare'),
 (3, 'C', 'Cork'),
 (4, 'DL', 'Donegal'),
 (5, 'D', 'Dublin'),
 (6, 'G', 'Galway'),
 (7, 'KY', 'Kerry'),
 (8, 'KE', 'Kildare'),
 (9, 'KK', 'Kilkenny'),
 (10, 'LS', 'Laois'),
 (11, 'LM', 'Leitrim'),
 (12, 'L', 'Limerick'),
 (13, 'LD', 'Longford'),
 (14, 'LH', 'Louth'),
 (15, 'MO', 'Mayo'),
 (16, 'MH', 'Meath'),
 (17, 'MN', 'Monaghan'),
 (18, 'OY', 'Offaly'),
 (19, 'RN', 'Roscommon'),
 (20, 'SO', 'Sligo'),
 (21, 'T', 'Tipperary'),
 (22, 'W', 'Waterford'),
 (23, 'WH', 'Westmeath'),
 (24, 'WX', 'Wexford'),
 (25, 'WW', 'Wicklow')]
In [30]:
c.execute("SELECT name FROM sqlite_master WHERE type='table'")
c.fetchall()
Out[30]:
[('person',), ('car',), ('county',)]
In [31]:
c.execute("""
    SELECT p.Name, c.Registration, p.Address
    FROM person as p JOIN car as c ON p.ID = c.OwnerId
""")
c.fetchall()
Out[31]:
[('Timothy Cummings', '08-SO-11072', 'Limerick'),
 ('Dana Wade', '16-KE-16368', 'Mayo'),
 ('Valerie Stewart', '08-LD-16871', 'Longford'),
 ('Gregory Vazquez', '11-KY-17442', 'Sligo'),
 ('Sara Lee', '16-LD-17545', 'Laois'),
 ('Jennifer Reeves', '10-WH-3543', 'Offaly'),
 ('Leonard Chen', '03-KE-8148', 'Galway'),
 ('Robert Snyder', '06-G-23024', 'Leitrim'),
 ('Morgan Marsh', '08-LS-21770', 'Westmeath'),
 ('Kayla Rodriguez DVM', '03-WX-41717', 'Clare'),
 ('Robert Acevedo', '01-T-37495', 'Meath'),
 ('Susan Cummings', '11-WH-22446', 'Cork'),
 ('Anne Anderson', '09-MN-43311', 'Cork'),
 ('Anna Henry', '05-KK-2596', 'Carlow'),
 ('Melanie White', '17-SO-17328', 'Carlow'),
 ('Justin Casey', '99-L-23440', 'Louth'),
 ('Jacob Moore', '05-WX-31122', 'Longford'),
 ('Donna Mason', '16-LS-41756', 'Longford'),
 ('Leonard Brown', '16-RN-45098', 'Sligo'),
 ('Paul Nicholson', '16-C-27251', 'Wexford'),
 ('Stephanie Yates', '06-LD-43721', 'Meath'),
 ('Connie Walls', '03-RN-2898', 'Limerick'),
 ('Tina Holland', '10-CW-49121', 'Sligo'),
 ('Nicholas Carrillo', '15-LS-45283', 'Laois'),
 ('Anna Henry', '08-D-43986', 'Carlow'),
 ('Devin Shaw', '08-DL-49460', 'Wexford'),
 ('Melinda Blackwell', '08-DL-20130', 'Mayo'),
 ('Robert Snyder', '10-WX-18691', 'Leitrim'),
 ('Marie Carr', '08-T-37917', 'Kerry'),
 ('David Cox', '15-D-6469', 'Leitrim'),
 ('Richard Foley', '08-L-26251', 'Offaly'),
 ('Alan Cabrera', '15-DL-15311', 'Leitrim'),
 ('Marcus Malone', '14-KE-41007', 'Kildare'),
 ('Stephanie Yates', '14-DL-12858', 'Meath'),
 ('Diane Hunt', '04-WH-36658', 'Westmeath'),
 ('Mrs. Kerry Romero', '00-MO-9632', 'Limerick'),
 ('Kathleen Henderson', '99-RN-41288', 'Monaghan'),
 ('Mrs. Kerry Romero', '13-MO-7316', 'Limerick'),
 ('Gregory Charles', '00-MH-17952', 'Wicklow'),
 ('James Williams', '18-LM-29466', 'Kilkenny'),
 ('George Fitzgerald', '08-D-18591', 'Carlow'),
 ('Stephanie Yates', '01-KK-27583', 'Meath'),
 ('Billy King', '13-T-24765', 'Louth'),
 ('William Hall', '01-RN-44780', 'Kerry'),
 ('Leonard Brown', '04-LD-24948', 'Sligo'),
 ('Valerie Rodriguez', '13-SO-2521', 'Kerry'),
 ('Leonard Brown', '16-WH-32130', 'Sligo'),
 ('Sandra Knight', '13-KE-37707', 'Offaly'),
 ('Mrs. Sheila Wilkerson', '99-CN-35366', 'Tipperary'),
 ('Marc Chapman', '18-CN-17743', 'Dublin'),
 ('Alan Williams', '05-LS-6602', 'Galway'),
 ('Donna Mason', '02-T-2683', 'Longford'),
 ('Sandra Knight', '06-LD-44064', 'Offaly'),
 ('Connie Walls', '14-SO-35322', 'Limerick'),
 ('Sarah Heath', '00-MH-30641', 'Monaghan'),
 ('Karen Roach', '17-MH-38452', 'Sligo'),
 ('Shelby Beck', '01-KY-40015', 'Tipperary'),
 ('Laura Miller', '13-G-17426', 'Louth'),
 ('Robert Fields', '03-LM-41543', 'Louth'),
 ('Mrs. Kerry Romero', '00-LH-46635', 'Limerick'),
 ('Dana Wade', '09-SO-26131', 'Mayo'),
 ('Glenn Gonzalez', '00-OY-15049', 'Leitrim'),
 ('Jesse Chavez', '12-G-20496', 'Meath'),
 ('Melinda Blackwell', '04-RN-2959', 'Mayo'),
 ('Shelby Beck', '07-KY-17472', 'Tipperary'),
 ('James Walker', '03-KY-23864', 'Tipperary'),
 ('Robert Price', '03-CW-12234', 'Dublin'),
 ('Valerie Rodriguez', '04-LS-17699', 'Kerry'),
 ('Melinda Blackwell', '12-MO-21340', 'Mayo'),
 ('Raymond Perkins', '14-WW-26729', 'Clare'),
 ('Connie Walls', '08-KK-6963', 'Limerick'),
 ('Scott Whitaker', '03-D-36946', 'Offaly'),
 ('Crystal Murphy', '03-WX-39739', 'Clare'),
 ('Timothy Cummings', '15-MO-29166', 'Limerick'),
 ('Kayla Rodriguez DVM', '09-LM-6757', 'Clare'),
 ('Marie Carr', '99-LD-27879', 'Kerry'),
 ('Raymond Perkins', '16-WX-38806', 'Clare'),
 ('Nicholas Carrillo', '06-KE-13830', 'Laois'),
 ('Emily Alvarado', '00-OY-18653', 'Longford'),
 ('Mrs. Kerry Romero', '09-G-14895', 'Limerick'),
 ('Scott Whitaker', '06-LH-39166', 'Offaly'),
 ('Morgan Marsh', '10-MO-45154', 'Westmeath'),
 ('Elizabeth Harper', '04-WH-37901', 'Donegal'),
 ('Stephen Oneal', '13-DL-46087', 'Louth'),
 ('Justin Casey', '14-CN-12576', 'Louth'),
 ('Frederick Schwartz', '15-D-4470', 'Dublin'),
 ('Christopher Mcmahon', '00-MO-32274', 'Limerick'),
 ('Paul Nicholson', '15-WH-21313', 'Wexford'),
 ('Melinda Blackwell', '08-D-29496', 'Mayo'),
 ('Peter Vaughn DDS', '00-LD-24730', 'Cork'),
 ('Gregory Charles', '14-OY-15669', 'Wicklow'),
 ('Peter Vaughn DDS', '00-MO-6904', 'Cork'),
 ('Lucas Ross', '17-DL-4885', 'Cork'),
 ('Jenny Juarez', '05-MN-17446', 'Longford'),
 ('Jordan Velasquez', '04-L-19474', 'Galway'),
 ('Alan Williams', '99-WW-237', 'Galway'),
 ('Kerry Curry', '03-G-36241', 'Galway'),
 ('Sarah Heath', '09-W-11201', 'Monaghan'),
 ('Robert Acevedo', '13-MO-34031', 'Meath'),
 ('Tina Holland', '02-KK-25507', 'Sligo'),
 ('Rachel Johnson', '08-LH-46637', 'Kildare'),
 ('Paul Nicholson', '12-KY-47631', 'Wexford'),
 ('Jennifer Sutton', '01-SO-45136', 'Mayo'),
 ('Jeremiah Soto', '18-WH-15349', 'Sligo'),
 ('Jeremiah Soto', '14-MO-11345', 'Sligo'),
 ('Laura Miller', '13-CE-10371', 'Louth'),
 ('Frederick Schwartz', '17-KE-21153', 'Dublin'),
 ('Rachel Johnson', '12-G-30288', 'Kildare'),
 ('Jacob Moore', '13-T-20412', 'Longford'),
 ('Lucas Ross', '08-LS-13835', 'Cork'),
 ('Devin Shaw', '12-CW-37691', 'Wexford'),
 ('Sarah Heath', '00-KY-48702', 'Monaghan'),
 ('Connie Walls', '14-LD-41919', 'Limerick'),
 ('Laura Miller', '18-W-16094', 'Louth'),
 ('Jacob Moore', '11-MH-39456', 'Longford'),
 ('Rachel Johnson', '01-KK-21586', 'Kildare'),
 ('Sandra Knight', '09-WX-7243', 'Offaly'),
 ('Megan Clarke', '12-WX-26308', 'Kildare'),
 ('Tina Holland', '02-LS-42993', 'Sligo'),
 ('Nicholas Carrillo', '18-W-44751', 'Laois'),
 ('Leonard Chen', '11-L-45810', 'Galway'),
 ('Raymond Perkins', '12-MH-7025', 'Clare'),
 ('Diane Hunt', '09-CW-13802', 'Westmeath'),
 ('Nicholas Carrillo', '11-KK-40419', 'Laois'),
 ('Connie Walls', '09-MO-27719', 'Limerick'),
 ('Rachel Johnson', '99-RN-21293', 'Kildare'),
 ('Raymond Gould', '06-KK-24445', 'Clare'),
 ('Dana Wade', '99-DL-44188', 'Mayo'),
 ('Lucas Ross', '17-CW-12306', 'Cork'),
 ('Melanie White', '12-WH-30512', 'Carlow'),
 ('Donna Mason', '13-CW-22728', 'Longford'),
 ('Jordan Velasquez', '15-G-27780', 'Galway'),
 ('Morgan Marsh', '99-WX-37648', 'Westmeath'),
 ('Katherine Dalton', '07-G-30931', 'Kildare'),
 ('Mrs. Kerry Romero', '08-G-34713', 'Limerick'),
 ('Peter Vaughn DDS', '03-MO-23757', 'Cork'),
 ('Morgan Marsh', '09-LD-32395', 'Westmeath'),
 ('Donna Mason', '05-KE-47018', 'Longford'),
 ('Susan Cummings', '18-RN-21403', 'Cork'),
 ('Paul Raymond', '02-LH-37988', 'Louth'),
 ('Kathleen Henderson', '11-T-29849', 'Monaghan'),
 ('Alan Williams', '99-MN-36507', 'Galway'),
 ('Gregory Charles', '15-SO-10080', 'Wicklow'),
 ('Valerie Rodriguez', '10-KE-5471', 'Kerry'),
 ('Susan Cummings', '09-C-15081', 'Cork'),
 ('Shelby Beck', '12-D-10674', 'Tipperary'),
 ('Jeff Stevens', '16-KK-6777', 'Dublin'),
 ('Nathan Smith', '09-KY-24502', 'Roscommon'),
 ('Jeff Stevens', '06-L-13615', 'Dublin'),
 ('Marcus Malone', '11-WX-6607', 'Kildare'),
 ('Jesse Chavez', '99-KY-44876', 'Meath'),
 ('Susan Cummings', '01-KE-7495', 'Cork'),
 ('Justin Casey', '06-WH-45961', 'Louth'),
 ('Shannon Oneal', '13-RN-48840', 'Sligo'),
 ('Melissa Bell', '15-LS-32504', 'Kildare'),
 ('Kayla Rodriguez DVM', '09-KK-33938', 'Clare'),
 ('Leonard Brown', '15-SO-48732', 'Sligo'),
 ('Tina Holland', '18-LH-9276', 'Sligo'),
 ('Jennifer Reeves', '00-T-13145', 'Offaly'),
 ('Donna Mason', '17-L-8077', 'Longford'),
 ('Raymond Perkins', '16-KY-38486', 'Clare'),
 ('Kathleen Henderson', '13-C-5004', 'Monaghan'),
 ('Sabrina Thompson', '13-KE-8122', 'Longford'),
 ('Elizabeth Mcfarland', '13-D-16232', 'Dublin'),
 ('Tracey Olson', '07-OY-29590', 'Kilkenny'),
 ('John Davis', '18-LS-3902', 'Dublin'),
 ('Christina Bautista', '07-LD-25411', 'Longford'),
 ('Seth Simpson', '11-OY-49718', 'Westmeath'),
 ('Emily Cooper', '09-OY-12095', 'Kildare'),
 ('Emily Alvarado', '10-RN-14168', 'Longford'),
 ('Jenny Juarez', '00-CN-12132', 'Longford'),
 ('Peter Vaughn DDS', '14-G-24691', 'Cork'),
 ('Connie Walls', '08-L-9335', 'Limerick'),
 ('Mrs. Kerry Romero', '13-LS-7544', 'Limerick'),
 ('Sandra Knight', '15-RN-47108', 'Offaly'),
 ('Devin Shaw', '16-RN-12605', 'Wexford'),
 ('Jenny Juarez', '15-WX-13974', 'Longford'),
 ('Alan Williams', '00-T-26883', 'Galway'),
 ('Carrie Sullivan', '01-C-1695', 'Galway'),
 ('Alan Williams', '11-WW-3780', 'Galway'),
 ('Tina Holland', '06-CW-29425', 'Sligo'),
 ('Laura Miller', '04-MN-1637', 'Louth'),
 ('Raymond Perkins', '14-OY-39752', 'Clare'),
 ('Justin Casey', '15-MO-15513', 'Louth'),
 ('Robert Price', '16-MN-22976', 'Dublin'),
 ('Christopher Miller', '07-OY-14928', 'Kerry'),
 ('Gregory Vazquez', '09-L-10881', 'Sligo'),
 ('Daniel Smith', '99-WX-23085', 'Limerick'),
 ('Valerie Rodriguez', '01-DL-25359', 'Kerry'),
 ('Elizabeth Harper', '00-MO-45664', 'Donegal'),
 ('Daniel Smith', '08-WW-30636', 'Limerick'),
 ('Megan Clarke', '01-CN-16097', 'Kildare'),
 ('Tina Holland', '07-LM-3132', 'Sligo'),
 ('Marc Chapman', '09-T-9813', 'Dublin'),
 ('Anna Henry', '16-KK-30424', 'Carlow'),
 ('Jesse Chavez', '99-CE-38547', 'Meath'),
 ('Sarah Heath', '10-LM-31279', 'Monaghan'),
 ('Paul Nicholson', '18-LH-44089', 'Wexford'),
 ('David Matthews', '02-SO-11359', 'Leitrim'),
 ('Elizabeth Mcfarland', '10-KE-33674', 'Dublin'),
 ('George Fitzgerald', '15-KE-8245', 'Carlow'),
 ('Raymond Perkins', '09-KK-23170', 'Clare'),
 ('Christopher Mcmahon', '14-CN-36381', 'Limerick'),
 ('Christina Bautista', '00-C-29416', 'Longford'),
 ('Christopher Mcmahon', '10-OY-1992', 'Limerick'),
 ('David Matthews', '10-T-36797', 'Leitrim'),
 ('Rachel Johnson', '07-KY-35080', 'Kildare'),
 ('Gail Jones', '08-MO-42969', 'Waterford'),
 ('Jeff Stevens', '07-OY-23008', 'Dublin'),
 ('Joseph Griffith', '14-MO-46320', 'Wicklow'),
 ('Katherine Dalton', '09-CW-29560', 'Kildare'),
 ('Devin Shaw', '03-MH-49587', 'Wexford'),
 ('Paul Raymond', '10-MH-34061', 'Louth'),
 ('Lucas Ross', '08-OY-35517', 'Cork'),
 ('Peter Vaughn DDS', '04-KY-47667', 'Cork'),
 ('Gregory Vazquez', '03-C-18358', 'Sligo'),
 ('Marcus Malone', '11-DL-2662', 'Kildare'),
 ('Gail Jones', '06-CW-15872', 'Waterford'),
 ('Jenny Juarez', '08-KE-7824', 'Longford'),
 ('Sabrina Thompson', '14-WH-21137', 'Longford'),
 ('Kathleen Henderson', '11-W-6130', 'Monaghan'),
 ('Raymond Gould', '03-C-4508', 'Clare'),
 ('Elizabeth Mcfarland', '02-CN-35760', 'Dublin'),
 ('Megan Clarke', '13-C-5330', 'Kildare'),
 ('Justin Casey', '07-CN-40170', 'Louth'),
 ('Valerie Rodriguez', '07-CW-32094', 'Kerry'),
 ('Alan Williams', '13-CW-22639', 'Galway'),
 ('Alan Williams', '10-LD-39262', 'Galway'),
 ('Stephanie Yates', '14-CE-46501', 'Meath'),
 ('Susan Cummings', '16-WW-18559', 'Cork'),
 ('Christopher Miller', '11-LD-42457', 'Kerry'),
 ('Shannon Oneal', '02-W-35723', 'Sligo'),
 ('Tina Holland', '13-RN-4833', 'Sligo'),
 ('Karen Roach', '01-KK-12540', 'Sligo'),
 ('Laura Miller', '14-CN-39530', 'Louth'),
 ('Carrie Sullivan', '08-T-1665', 'Galway'),
 ('Frederick Schwartz', '13-LH-30593', 'Dublin'),
 ('Carrie Sullivan', '06-C-24008', 'Galway'),
 ('Megan Clarke', '12-LH-5689', 'Kildare'),
 ('Leonard Chen', '05-WW-47977', 'Galway'),
 ('Susan Cummings', '09-KK-5328', 'Cork'),
 ('Marie Carr', '10-DL-6386', 'Kerry'),
 ('John Davis', '05-MH-22339', 'Dublin'),
 ('Jackson Dean', '02-MH-44541', 'Louth'),
 ('Jesse Chavez', '18-MN-26444', 'Meath'),
 ('Gregory Charles', '12-LM-22338', 'Wicklow'),
 ('Devin Shaw', '18-KY-29981', 'Wexford'),
 ('Laura Miller', '01-G-8684', 'Louth'),
 ('Marc Chapman', '04-KY-32797', 'Dublin'),
 ('Paul Nicholson', '08-LD-12240', 'Wexford'),
 ('Donna Mason', '18-WW-11514', 'Longford'),
 ('Dana Wade', '03-L-40377', 'Mayo'),
 ('Jenny Juarez', '15-G-37225', 'Longford'),
 ('Emily Alvarado', '14-CN-41515', 'Longford'),
 ('Robert Fields', '09-LS-131', 'Louth'),
 ('David Cox', '12-LS-47102', 'Leitrim'),
 ('Alan Cabrera', '15-WX-8189', 'Leitrim'),
 ('Donna Mason', '13-CW-21688', 'Longford'),
 ('John Davis', '15-DL-3247', 'Dublin'),
 ('Raymond Perkins', '02-D-22267', 'Clare'),
 ('Robert Acevedo', '01-LS-33323', 'Meath'),
 ('Peter Vaughn DDS', '10-WH-9955', 'Cork'),
 ('Joseph Griffith', '03-MO-4365', 'Wicklow'),
 ('Joseph Griffith', '04-LD-23688', 'Wicklow'),
 ('Alan Williams', '13-G-16885', 'Galway'),
 ('Jenny Juarez', '18-KE-36389', 'Longford'),
 ('Melissa Lowe', '01-T-15866', 'Westmeath'),
 ('Christopher Miller', '08-KE-16056', 'Kerry'),
 ('Kayla Rodriguez DVM', '13-G-24475', 'Clare'),
 ('Emily Cooper', '03-MO-25665', 'Kildare'),
 ('Stephanie Yates', '18-T-2425', 'Meath'),
 ('Elizabeth Harper', '04-WW-24305', 'Donegal'),
 ('Shannon Oneal', '13-OY-23701', 'Sligo'),
 ('David Matthews', '08-MO-46007', 'Leitrim'),
 ('Robert Price', '00-L-47267', 'Dublin'),
 ('Emily Cooper', '08-KK-47849', 'Kildare'),
 ('Elizabeth Harper', '16-MN-41115', 'Donegal'),
 ('Dana Wade', '02-DL-7526', 'Mayo'),
 ('Melanie White', '01-G-15863', 'Carlow'),
 ('Elizabeth Harper', '14-SO-6402', 'Donegal'),
 ('Lori Harmon', '02-CN-7196', 'Carlow'),
 ('Christopher Mcmahon', '01-CW-35670', 'Limerick'),
 ('Sandra Knight', '16-T-45794', 'Offaly'),
 ('Anna Henry', '03-KK-1616', 'Carlow'),
 ('Jennifer Reeves', '08-WX-43305', 'Offaly'),
 ('Mrs. Sheila Wilkerson', '15-W-31836', 'Tipperary'),
 ('Susan Cummings', '03-KE-1400', 'Cork'),
 ('Jared Nguyen', '08-WW-22857', 'Cavan'),
 ('Elizabeth Harper', '15-L-48040', 'Donegal'),
 ('Stephanie Yates', '05-CN-49186', 'Meath'),
 ('Tracey Olson', '18-T-43669', 'Kilkenny'),
 ('John Davis', '05-WX-40194', 'Dublin'),
 ('Anna Henry', '08-LH-30886', 'Carlow'),
 ('Melanie White', '07-G-36331', 'Carlow'),
 ('Leonard Chen', '06-WW-48865', 'Galway'),
 ('Leonard Brown', '16-MO-40801', 'Sligo'),
 ('George Fitzgerald', '15-L-37732', 'Carlow'),
 ('Gail Jones', '10-G-21752', 'Waterford'),
 ('Susan Cummings', '08-C-34297', 'Cork'),
 ('Jacob Moore', '17-SO-23443', 'Longford'),
 ('Dana Wade', '05-CN-5924', 'Mayo'),
 ('David Cox', '05-W-22770', 'Leitrim'),
 ('Joshua Perez', '10-LH-34050', 'Galway'),
 ('Robert Fields', '16-LS-26245', 'Louth'),
 ('Hannah Collier', '05-D-30917', 'Leitrim'),
 ('Dana Wade', '07-G-48955', 'Mayo'),
 ('Diane Hunt', '13-G-48846', 'Westmeath'),
 ('Megan Clarke', '05-L-42386', 'Kildare'),
 ('Richard Foley', '08-T-12971', 'Offaly'),
 ('Carrie Sullivan', '18-WH-6082', 'Galway'),
 ('Daniel Smith', '12-MO-30235', 'Limerick'),
 ('John Davis', '16-T-22243', 'Dublin'),
 ('Jeff Stevens', '03-L-37130', 'Dublin'),
 ('Devin Shaw', '12-MO-18353', 'Wexford'),
 ('Robert Fields', '11-MN-11186', 'Louth'),
 ('Robert Price', '05-WX-40062', 'Dublin'),
 ('Melissa Lowe', '04-D-38409', 'Westmeath'),
 ('William Hall', '16-CE-29807', 'Kerry'),
 ('Joseph Griffith', '15-D-4632', 'Wicklow'),
 ('Joshua Perez', '14-LM-31240', 'Galway'),
 ('David Cox', '15-LH-20280', 'Leitrim'),
 ('Jeff Stevens', '04-L-14265', 'Dublin'),
 ('Sandra Knight', '05-KK-13066', 'Offaly'),
 ('Jordan Velasquez', '02-MN-14407', 'Galway'),
 ('Jared Nguyen', '11-CE-42446', 'Cavan'),
 ('Melissa Lowe', '16-W-29168', 'Westmeath'),
 ('Katherine Dalton', '03-G-19542', 'Kildare'),
 ('Hannah Collier', '18-MO-35400', 'Leitrim'),
 ('Alan Williams', '11-KK-35894', 'Galway'),
 ('Seth Simpson', '07-G-5958', 'Westmeath')]
In [32]:
c.execute("""
    SELECT p.Name, c.Registration, p.Address
    FROM person as p
         JOIN car as c ON p.ID = c.OwnerId
         JOIN county as t ON t.Name = p.Address
    WHERE c.Registration NOT LIKE '%-' + t.Registration + '-%'
""")
c.fetchall()
Out[32]:
[('Timothy Cummings', '08-SO-11072', 'Limerick'),
 ('Dana Wade', '16-KE-16368', 'Mayo'),
 ('Valerie Stewart', '08-LD-16871', 'Longford'),
 ('Gregory Vazquez', '11-KY-17442', 'Sligo'),
 ('Sara Lee', '16-LD-17545', 'Laois'),
 ('Jennifer Reeves', '10-WH-3543', 'Offaly'),
 ('Leonard Chen', '03-KE-8148', 'Galway'),
 ('Robert Snyder', '06-G-23024', 'Leitrim'),
 ('Morgan Marsh', '08-LS-21770', 'Westmeath'),
 ('Kayla Rodriguez DVM', '03-WX-41717', 'Clare'),
 ('Robert Acevedo', '01-T-37495', 'Meath'),
 ('Susan Cummings', '11-WH-22446', 'Cork'),
 ('Anne Anderson', '09-MN-43311', 'Cork'),
 ('Anna Henry', '05-KK-2596', 'Carlow'),
 ('Melanie White', '17-SO-17328', 'Carlow'),
 ('Justin Casey', '99-L-23440', 'Louth'),
 ('Jacob Moore', '05-WX-31122', 'Longford'),
 ('Donna Mason', '16-LS-41756', 'Longford'),
 ('Leonard Brown', '16-RN-45098', 'Sligo'),
 ('Paul Nicholson', '16-C-27251', 'Wexford'),
 ('Stephanie Yates', '06-LD-43721', 'Meath'),
 ('Connie Walls', '03-RN-2898', 'Limerick'),
 ('Tina Holland', '10-CW-49121', 'Sligo'),
 ('Nicholas Carrillo', '15-LS-45283', 'Laois'),
 ('Anna Henry', '08-D-43986', 'Carlow'),
 ('Devin Shaw', '08-DL-49460', 'Wexford'),
 ('Melinda Blackwell', '08-DL-20130', 'Mayo'),
 ('Robert Snyder', '10-WX-18691', 'Leitrim'),
 ('Marie Carr', '08-T-37917', 'Kerry'),
 ('David Cox', '15-D-6469', 'Leitrim'),
 ('Richard Foley', '08-L-26251', 'Offaly'),
 ('Alan Cabrera', '15-DL-15311', 'Leitrim'),
 ('Marcus Malone', '14-KE-41007', 'Kildare'),
 ('Stephanie Yates', '14-DL-12858', 'Meath'),
 ('Diane Hunt', '04-WH-36658', 'Westmeath'),
 ('Mrs. Kerry Romero', '00-MO-9632', 'Limerick'),
 ('Kathleen Henderson', '99-RN-41288', 'Monaghan'),
 ('Mrs. Kerry Romero', '13-MO-7316', 'Limerick'),
 ('Gregory Charles', '00-MH-17952', 'Wicklow'),
 ('James Williams', '18-LM-29466', 'Kilkenny'),
 ('George Fitzgerald', '08-D-18591', 'Carlow'),
 ('Stephanie Yates', '01-KK-27583', 'Meath'),
 ('Billy King', '13-T-24765', 'Louth'),
 ('William Hall', '01-RN-44780', 'Kerry'),
 ('Leonard Brown', '04-LD-24948', 'Sligo'),
 ('Valerie Rodriguez', '13-SO-2521', 'Kerry'),
 ('Leonard Brown', '16-WH-32130', 'Sligo'),
 ('Sandra Knight', '13-KE-37707', 'Offaly'),
 ('Mrs. Sheila Wilkerson', '99-CN-35366', 'Tipperary'),
 ('Marc Chapman', '18-CN-17743', 'Dublin'),
 ('Alan Williams', '05-LS-6602', 'Galway'),
 ('Donna Mason', '02-T-2683', 'Longford'),
 ('Sandra Knight', '06-LD-44064', 'Offaly'),
 ('Connie Walls', '14-SO-35322', 'Limerick'),
 ('Sarah Heath', '00-MH-30641', 'Monaghan'),
 ('Karen Roach', '17-MH-38452', 'Sligo'),
 ('Shelby Beck', '01-KY-40015', 'Tipperary'),
 ('Laura Miller', '13-G-17426', 'Louth'),
 ('Robert Fields', '03-LM-41543', 'Louth'),
 ('Mrs. Kerry Romero', '00-LH-46635', 'Limerick'),
 ('Dana Wade', '09-SO-26131', 'Mayo'),
 ('Glenn Gonzalez', '00-OY-15049', 'Leitrim'),
 ('Jesse Chavez', '12-G-20496', 'Meath'),
 ('Melinda Blackwell', '04-RN-2959', 'Mayo'),
 ('Shelby Beck', '07-KY-17472', 'Tipperary'),
 ('James Walker', '03-KY-23864', 'Tipperary'),
 ('Robert Price', '03-CW-12234', 'Dublin'),
 ('Valerie Rodriguez', '04-LS-17699', 'Kerry'),
 ('Melinda Blackwell', '12-MO-21340', 'Mayo'),
 ('Raymond Perkins', '14-WW-26729', 'Clare'),
 ('Connie Walls', '08-KK-6963', 'Limerick'),
 ('Scott Whitaker', '03-D-36946', 'Offaly'),
 ('Crystal Murphy', '03-WX-39739', 'Clare'),
 ('Timothy Cummings', '15-MO-29166', 'Limerick'),
 ('Kayla Rodriguez DVM', '09-LM-6757', 'Clare'),
 ('Marie Carr', '99-LD-27879', 'Kerry'),
 ('Raymond Perkins', '16-WX-38806', 'Clare'),
 ('Nicholas Carrillo', '06-KE-13830', 'Laois'),
 ('Emily Alvarado', '00-OY-18653', 'Longford'),
 ('Mrs. Kerry Romero', '09-G-14895', 'Limerick'),
 ('Scott Whitaker', '06-LH-39166', 'Offaly'),
 ('Morgan Marsh', '10-MO-45154', 'Westmeath'),
 ('Elizabeth Harper', '04-WH-37901', 'Donegal'),
 ('Stephen Oneal', '13-DL-46087', 'Louth'),
 ('Justin Casey', '14-CN-12576', 'Louth'),
 ('Frederick Schwartz', '15-D-4470', 'Dublin'),
 ('Christopher Mcmahon', '00-MO-32274', 'Limerick'),
 ('Paul Nicholson', '15-WH-21313', 'Wexford'),
 ('Melinda Blackwell', '08-D-29496', 'Mayo'),
 ('Peter Vaughn DDS', '00-LD-24730', 'Cork'),
 ('Gregory Charles', '14-OY-15669', 'Wicklow'),
 ('Peter Vaughn DDS', '00-MO-6904', 'Cork'),
 ('Lucas Ross', '17-DL-4885', 'Cork'),
 ('Jenny Juarez', '05-MN-17446', 'Longford'),
 ('Jordan Velasquez', '04-L-19474', 'Galway'),
 ('Alan Williams', '99-WW-237', 'Galway'),
 ('Kerry Curry', '03-G-36241', 'Galway'),
 ('Sarah Heath', '09-W-11201', 'Monaghan'),
 ('Robert Acevedo', '13-MO-34031', 'Meath'),
 ('Tina Holland', '02-KK-25507', 'Sligo'),
 ('Rachel Johnson', '08-LH-46637', 'Kildare'),
 ('Paul Nicholson', '12-KY-47631', 'Wexford'),
 ('Jennifer Sutton', '01-SO-45136', 'Mayo'),
 ('Jeremiah Soto', '18-WH-15349', 'Sligo'),
 ('Jeremiah Soto', '14-MO-11345', 'Sligo'),
 ('Laura Miller', '13-CE-10371', 'Louth'),
 ('Frederick Schwartz', '17-KE-21153', 'Dublin'),
 ('Rachel Johnson', '12-G-30288', 'Kildare'),
 ('Jacob Moore', '13-T-20412', 'Longford'),
 ('Lucas Ross', '08-LS-13835', 'Cork'),
 ('Devin Shaw', '12-CW-37691', 'Wexford'),
 ('Sarah Heath', '00-KY-48702', 'Monaghan'),
 ('Connie Walls', '14-LD-41919', 'Limerick'),
 ('Laura Miller', '18-W-16094', 'Louth'),
 ('Jacob Moore', '11-MH-39456', 'Longford'),
 ('Rachel Johnson', '01-KK-21586', 'Kildare'),
 ('Sandra Knight', '09-WX-7243', 'Offaly'),
 ('Megan Clarke', '12-WX-26308', 'Kildare'),
 ('Tina Holland', '02-LS-42993', 'Sligo'),
 ('Nicholas Carrillo', '18-W-44751', 'Laois'),
 ('Leonard Chen', '11-L-45810', 'Galway'),
 ('Raymond Perkins', '12-MH-7025', 'Clare'),
 ('Diane Hunt', '09-CW-13802', 'Westmeath'),
 ('Nicholas Carrillo', '11-KK-40419', 'Laois'),
 ('Connie Walls', '09-MO-27719', 'Limerick'),
 ('Rachel Johnson', '99-RN-21293', 'Kildare'),
 ('Raymond Gould', '06-KK-24445', 'Clare'),
 ('Dana Wade', '99-DL-44188', 'Mayo'),
 ('Lucas Ross', '17-CW-12306', 'Cork'),
 ('Melanie White', '12-WH-30512', 'Carlow'),
 ('Donna Mason', '13-CW-22728', 'Longford'),
 ('Jordan Velasquez', '15-G-27780', 'Galway'),
 ('Morgan Marsh', '99-WX-37648', 'Westmeath'),
 ('Katherine Dalton', '07-G-30931', 'Kildare'),
 ('Mrs. Kerry Romero', '08-G-34713', 'Limerick'),
 ('Peter Vaughn DDS', '03-MO-23757', 'Cork'),
 ('Morgan Marsh', '09-LD-32395', 'Westmeath'),
 ('Donna Mason', '05-KE-47018', 'Longford'),
 ('Susan Cummings', '18-RN-21403', 'Cork'),
 ('Paul Raymond', '02-LH-37988', 'Louth'),
 ('Kathleen Henderson', '11-T-29849', 'Monaghan'),
 ('Alan Williams', '99-MN-36507', 'Galway'),
 ('Gregory Charles', '15-SO-10080', 'Wicklow'),
 ('Valerie Rodriguez', '10-KE-5471', 'Kerry'),
 ('Susan Cummings', '09-C-15081', 'Cork'),
 ('Shelby Beck', '12-D-10674', 'Tipperary'),
 ('Jeff Stevens', '16-KK-6777', 'Dublin'),
 ('Nathan Smith', '09-KY-24502', 'Roscommon'),
 ('Jeff Stevens', '06-L-13615', 'Dublin'),
 ('Marcus Malone', '11-WX-6607', 'Kildare'),
 ('Jesse Chavez', '99-KY-44876', 'Meath'),
 ('Susan Cummings', '01-KE-7495', 'Cork'),
 ('Justin Casey', '06-WH-45961', 'Louth'),
 ('Shannon Oneal', '13-RN-48840', 'Sligo'),
 ('Melissa Bell', '15-LS-32504', 'Kildare'),
 ('Kayla Rodriguez DVM', '09-KK-33938', 'Clare'),
 ('Leonard Brown', '15-SO-48732', 'Sligo'),
 ('Tina Holland', '18-LH-9276', 'Sligo'),
 ('Jennifer Reeves', '00-T-13145', 'Offaly'),
 ('Donna Mason', '17-L-8077', 'Longford'),
 ('Raymond Perkins', '16-KY-38486', 'Clare'),
 ('Kathleen Henderson', '13-C-5004', 'Monaghan'),
 ('Sabrina Thompson', '13-KE-8122', 'Longford'),
 ('Elizabeth Mcfarland', '13-D-16232', 'Dublin'),
 ('Tracey Olson', '07-OY-29590', 'Kilkenny'),
 ('John Davis', '18-LS-3902', 'Dublin'),
 ('Christina Bautista', '07-LD-25411', 'Longford'),
 ('Seth Simpson', '11-OY-49718', 'Westmeath'),
 ('Emily Cooper', '09-OY-12095', 'Kildare'),
 ('Emily Alvarado', '10-RN-14168', 'Longford'),
 ('Jenny Juarez', '00-CN-12132', 'Longford'),
 ('Peter Vaughn DDS', '14-G-24691', 'Cork'),
 ('Connie Walls', '08-L-9335', 'Limerick'),
 ('Mrs. Kerry Romero', '13-LS-7544', 'Limerick'),
 ('Sandra Knight', '15-RN-47108', 'Offaly'),
 ('Devin Shaw', '16-RN-12605', 'Wexford'),
 ('Jenny Juarez', '15-WX-13974', 'Longford'),
 ('Alan Williams', '00-T-26883', 'Galway'),
 ('Carrie Sullivan', '01-C-1695', 'Galway'),
 ('Alan Williams', '11-WW-3780', 'Galway'),
 ('Tina Holland', '06-CW-29425', 'Sligo'),
 ('Laura Miller', '04-MN-1637', 'Louth'),
 ('Raymond Perkins', '14-OY-39752', 'Clare'),
 ('Justin Casey', '15-MO-15513', 'Louth'),
 ('Robert Price', '16-MN-22976', 'Dublin'),
 ('Christopher Miller', '07-OY-14928', 'Kerry'),
 ('Gregory Vazquez', '09-L-10881', 'Sligo'),
 ('Daniel Smith', '99-WX-23085', 'Limerick'),
 ('Valerie Rodriguez', '01-DL-25359', 'Kerry'),
 ('Elizabeth Harper', '00-MO-45664', 'Donegal'),
 ('Daniel Smith', '08-WW-30636', 'Limerick'),
 ('Megan Clarke', '01-CN-16097', 'Kildare'),
 ('Tina Holland', '07-LM-3132', 'Sligo'),
 ('Marc Chapman', '09-T-9813', 'Dublin'),
 ('Anna Henry', '16-KK-30424', 'Carlow'),
 ('Jesse Chavez', '99-CE-38547', 'Meath'),
 ('Sarah Heath', '10-LM-31279', 'Monaghan'),
 ('Paul Nicholson', '18-LH-44089', 'Wexford'),
 ('David Matthews', '02-SO-11359', 'Leitrim'),
 ('Elizabeth Mcfarland', '10-KE-33674', 'Dublin'),
 ('George Fitzgerald', '15-KE-8245', 'Carlow'),
 ('Raymond Perkins', '09-KK-23170', 'Clare'),
 ('Christopher Mcmahon', '14-CN-36381', 'Limerick'),
 ('Christina Bautista', '00-C-29416', 'Longford'),
 ('Christopher Mcmahon', '10-OY-1992', 'Limerick'),
 ('David Matthews', '10-T-36797', 'Leitrim'),
 ('Rachel Johnson', '07-KY-35080', 'Kildare'),
 ('Gail Jones', '08-MO-42969', 'Waterford'),
 ('Jeff Stevens', '07-OY-23008', 'Dublin'),
 ('Joseph Griffith', '14-MO-46320', 'Wicklow'),
 ('Katherine Dalton', '09-CW-29560', 'Kildare'),
 ('Devin Shaw', '03-MH-49587', 'Wexford'),
 ('Paul Raymond', '10-MH-34061', 'Louth'),
 ('Lucas Ross', '08-OY-35517', 'Cork'),
 ('Peter Vaughn DDS', '04-KY-47667', 'Cork'),
 ('Gregory Vazquez', '03-C-18358', 'Sligo'),
 ('Marcus Malone', '11-DL-2662', 'Kildare'),
 ('Gail Jones', '06-CW-15872', 'Waterford'),
 ('Jenny Juarez', '08-KE-7824', 'Longford'),
 ('Sabrina Thompson', '14-WH-21137', 'Longford'),
 ('Kathleen Henderson', '11-W-6130', 'Monaghan'),
 ('Raymond Gould', '03-C-4508', 'Clare'),
 ('Elizabeth Mcfarland', '02-CN-35760', 'Dublin'),
 ('Megan Clarke', '13-C-5330', 'Kildare'),
 ('Justin Casey', '07-CN-40170', 'Louth'),
 ('Valerie Rodriguez', '07-CW-32094', 'Kerry'),
 ('Alan Williams', '13-CW-22639', 'Galway'),
 ('Alan Williams', '10-LD-39262', 'Galway'),
 ('Stephanie Yates', '14-CE-46501', 'Meath'),
 ('Susan Cummings', '16-WW-18559', 'Cork'),
 ('Christopher Miller', '11-LD-42457', 'Kerry'),
 ('Shannon Oneal', '02-W-35723', 'Sligo'),
 ('Tina Holland', '13-RN-4833', 'Sligo'),
 ('Karen Roach', '01-KK-12540', 'Sligo'),
 ('Laura Miller', '14-CN-39530', 'Louth'),
 ('Carrie Sullivan', '08-T-1665', 'Galway'),
 ('Frederick Schwartz', '13-LH-30593', 'Dublin'),
 ('Carrie Sullivan', '06-C-24008', 'Galway'),
 ('Megan Clarke', '12-LH-5689', 'Kildare'),
 ('Leonard Chen', '05-WW-47977', 'Galway'),
 ('Susan Cummings', '09-KK-5328', 'Cork'),
 ('Marie Carr', '10-DL-6386', 'Kerry'),
 ('John Davis', '05-MH-22339', 'Dublin'),
 ('Jackson Dean', '02-MH-44541', 'Louth'),
 ('Jesse Chavez', '18-MN-26444', 'Meath'),
 ('Gregory Charles', '12-LM-22338', 'Wicklow'),
 ('Devin Shaw', '18-KY-29981', 'Wexford'),
 ('Laura Miller', '01-G-8684', 'Louth'),
 ('Marc Chapman', '04-KY-32797', 'Dublin'),
 ('Paul Nicholson', '08-LD-12240', 'Wexford'),
 ('Donna Mason', '18-WW-11514', 'Longford'),
 ('Dana Wade', '03-L-40377', 'Mayo'),
 ('Jenny Juarez', '15-G-37225', 'Longford'),
 ('Emily Alvarado', '14-CN-41515', 'Longford'),
 ('Robert Fields', '09-LS-131', 'Louth'),
 ('David Cox', '12-LS-47102', 'Leitrim'),
 ('Alan Cabrera', '15-WX-8189', 'Leitrim'),
 ('Donna Mason', '13-CW-21688', 'Longford'),
 ('John Davis', '15-DL-3247', 'Dublin'),
 ('Raymond Perkins', '02-D-22267', 'Clare'),
 ('Robert Acevedo', '01-LS-33323', 'Meath'),
 ('Peter Vaughn DDS', '10-WH-9955', 'Cork'),
 ('Joseph Griffith', '03-MO-4365', 'Wicklow'),
 ('Joseph Griffith', '04-LD-23688', 'Wicklow'),
 ('Alan Williams', '13-G-16885', 'Galway'),
 ('Jenny Juarez', '18-KE-36389', 'Longford'),
 ('Melissa Lowe', '01-T-15866', 'Westmeath'),
 ('Christopher Miller', '08-KE-16056', 'Kerry'),
 ('Kayla Rodriguez DVM', '13-G-24475', 'Clare'),
 ('Emily Cooper', '03-MO-25665', 'Kildare'),
 ('Stephanie Yates', '18-T-2425', 'Meath'),
 ('Elizabeth Harper', '04-WW-24305', 'Donegal'),
 ('Shannon Oneal', '13-OY-23701', 'Sligo'),
 ('David Matthews', '08-MO-46007', 'Leitrim'),
 ('Robert Price', '00-L-47267', 'Dublin'),
 ('Emily Cooper', '08-KK-47849', 'Kildare'),
 ('Elizabeth Harper', '16-MN-41115', 'Donegal'),
 ('Dana Wade', '02-DL-7526', 'Mayo'),
 ('Melanie White', '01-G-15863', 'Carlow'),
 ('Elizabeth Harper', '14-SO-6402', 'Donegal'),
 ('Lori Harmon', '02-CN-7196', 'Carlow'),
 ('Christopher Mcmahon', '01-CW-35670', 'Limerick'),
 ('Sandra Knight', '16-T-45794', 'Offaly'),
 ('Anna Henry', '03-KK-1616', 'Carlow'),
 ('Jennifer Reeves', '08-WX-43305', 'Offaly'),
 ('Mrs. Sheila Wilkerson', '15-W-31836', 'Tipperary'),
 ('Susan Cummings', '03-KE-1400', 'Cork'),
 ('Jared Nguyen', '08-WW-22857', 'Cavan'),
 ('Elizabeth Harper', '15-L-48040', 'Donegal'),
 ('Stephanie Yates', '05-CN-49186', 'Meath'),
 ('Tracey Olson', '18-T-43669', 'Kilkenny'),
 ('John Davis', '05-WX-40194', 'Dublin'),
 ('Anna Henry', '08-LH-30886', 'Carlow'),
 ('Melanie White', '07-G-36331', 'Carlow'),
 ('Leonard Chen', '06-WW-48865', 'Galway'),
 ('Leonard Brown', '16-MO-40801', 'Sligo'),
 ('George Fitzgerald', '15-L-37732', 'Carlow'),
 ('Gail Jones', '10-G-21752', 'Waterford'),
 ('Susan Cummings', '08-C-34297', 'Cork'),
 ('Jacob Moore', '17-SO-23443', 'Longford'),
 ('Dana Wade', '05-CN-5924', 'Mayo'),
 ('David Cox', '05-W-22770', 'Leitrim'),
 ('Joshua Perez', '10-LH-34050', 'Galway'),
 ('Robert Fields', '16-LS-26245', 'Louth'),
 ('Hannah Collier', '05-D-30917', 'Leitrim'),
 ('Dana Wade', '07-G-48955', 'Mayo'),
 ('Diane Hunt', '13-G-48846', 'Westmeath'),
 ('Megan Clarke', '05-L-42386', 'Kildare'),
 ('Richard Foley', '08-T-12971', 'Offaly'),
 ('Carrie Sullivan', '18-WH-6082', 'Galway'),
 ('Daniel Smith', '12-MO-30235', 'Limerick'),
 ('John Davis', '16-T-22243', 'Dublin'),
 ('Jeff Stevens', '03-L-37130', 'Dublin'),
 ('Devin Shaw', '12-MO-18353', 'Wexford'),
 ('Robert Fields', '11-MN-11186', 'Louth'),
 ('Robert Price', '05-WX-40062', 'Dublin'),
 ('Melissa Lowe', '04-D-38409', 'Westmeath'),
 ('William Hall', '16-CE-29807', 'Kerry'),
 ('Joseph Griffith', '15-D-4632', 'Wicklow'),
 ('Joshua Perez', '14-LM-31240', 'Galway'),
 ('David Cox', '15-LH-20280', 'Leitrim'),
 ('Jeff Stevens', '04-L-14265', 'Dublin'),
 ('Sandra Knight', '05-KK-13066', 'Offaly'),
 ('Jordan Velasquez', '02-MN-14407', 'Galway'),
 ('Jared Nguyen', '11-CE-42446', 'Cavan'),
 ('Melissa Lowe', '16-W-29168', 'Westmeath'),
 ('Katherine Dalton', '03-G-19542', 'Kildare'),
 ('Hannah Collier', '18-MO-35400', 'Leitrim'),
 ('Alan Williams', '11-KK-35894', 'Galway'),
 ('Seth Simpson', '07-G-5958', 'Westmeath')]
In [33]:
conn.close()

End