I have 3 tables as follow:
Customer (CustomerName , CustomerCity , CustomerStreet) Branch (BranchName , BranchCity) Deposit (CustomerName , BranchName , AccountNumber , Balance)
Here I show you sample data of the above tables :
Customer ('John','City1','Street1') ('Lili','City2','street2') Branch ('Branch1','Kaj') ('Branch2','Bahar') ('Branch3','Bahar') ('Branch4','Bahar') Deposit ('John','Branch1',12,1000) ('Lili','Branch1',123,1222) ('Lili','Branch2',124,45233) ('Lili','Branch3',345,6000) ('Lili','Branch4',567,5600)
So based on the information above, I need a query to give me CustomerName that have a deposit in all branches that are in Bahar.
I should see 'Lili' in the output because it has deposits for all branches that are in Bahar but I should not see John cause it has a deposit only in one branch of Bahar.
I did my best to write the query but I could not. Could you help me with this please?