Complex Sql Query Needed

I have following set of tables where user_key_id is id of the photographer and users should be able to search photographers as per the following database tables.

User should

tbl_type ( type of service provided by photographer )

-id
-type_name

tbl_category ( Category in which photographer provides his services, Eg:- Wildlife, Event, Wedding etc {multiple selection} )
-id
-category_name

tbl_location ( location in which photographer provides his services, Eg:- Delhi, Mumbai, banglore etc {multiple selection} )
-id
-location_name

tbl_photographer_profile ( Photographer details )
-id
-user_key_id
-first_name
-last_name
-street_address

tbl_category_selected ( contain data which photographer has selected what categories {multiple selections} )
-id
-user_key_id
-category_id

tbl_service_type ( contain data which photographer has selected what service type [tbl_type] {multiple selections} )
-id
-user_key_id
-type_id

tbl_regions ( contain data which photographer has selected what locations to provide his services {multiple selections} )
-id
-user_key_id
-region_id

And search should perform based on all these tables

what did you try on your own so not somebody else has to do your work?

Im not good in JOIN and such complex queries thats y i posted it here. If you can answer it would be great else no problem someone else will help for sure

The way those table structures look to be I’m not surprised you’re having trouble working wth them.
They look suspiciously like the work of a newbie. eg. they all have an id field whether they need one or not?

tbl_regions 
id 
user_key_id 
region_id 

Anyway, assuming it is only me having trouble digesting the information you have posted and the database design and table shemas are as they should be, it would be helpful to me if you could start by giving a simplified example with only one JOIN condition that involves only two tables.

In particular, how what information in one table is related to what information in the other.

all tables can have multiple data same photographer can have multiple regions, service type and locations selected.
this query will not help
BTW thanks for you time

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.