jkkummerfeld / text2sql-data

A collection of datasets that pair questions with SQL queries.
http://jkk.name/text2sql-data/
Other
534 stars 105 forks source link

location.restaurant_id should be foreign key in "Restaurants"? #50

Closed rizar closed 3 years ago

rizar commented 3 years ago

I am looking at the restaurants database. It contains tables Restaurants and Location. As far as I can understand from eyeballing the db content, Location.restaurant_id is referring to Restaurants.id, i.e. table Location contains addresses of the restaurants in table Restaurants. But in the database creation code Location.restaurant_id is made a primary key, not a foreign key:

https://github.com/jkkummerfeld/text2sql-data/blob/master/tools/create_restaurant_database.py#L32

What would be the right thing to do here?

jkkummerfeld commented 3 years ago

You're right - that's an error, I'll update that code (note that this is not actually code we used in our experiments, it was contributed to the repository later).

jkkummerfeld commented 3 years ago

Done

rizar commented 3 years ago

Great, thanks a lot for the quick response!