Added interfaces and updated SQL query to incorporate autogenerating primary keys in tables