I have a table called \'flights\' which is in one to many relationship with \'tickets\' and many to many relationship with \'categories\', I want to filter flights table bas