Fix SQL so it actually works
Add import for lookup tables
Add extra missing columns from sample table