Customer using HDFC bank in SQL

Question:

Customer using HDFC bank

Display user name and their city who have booked their tickets not by using HDFC bank for any of the bookings. Sort the result based on user name.

Customer using HDFC bank

Code:

Main.sql

select distinct u.name, u.address
from users u join bookingdetails b 
           on u.user_id=b.user_id
           where u.user_id not in (select user_id from bookingdetails
           where lower (name)='hdfc')
           order by 1;

Recommended:

Leave a Comment

Your email address will not be published. Required fields are marked *

x