#SQL Interview Question 159::
Write an SQL query to find the list of each customer along with the name of the person who referred them. If they have no referee, display "No Referee"
from the "Customer" table.
Table Name:: Customer
SELECT C1.name AS customer_name,
COALESCE(C2.name, 'No Referee') AS referee_name
FROM Customer C1
LEFT JOIN Customer C2 ON C1.referee_id = C2.id;
@SekharAcademy1
#sql
#sqlqueries
#mysql
#oracle
#learning
#interview
#programming
#database
#education
#sqlinterview
#interviewquestions
#quiz
#sqlquiz
#quiztest
#test
#interviewtest
#mcq
#mocktest
#viralvideo
#video #viralshorts
#trending #viralreels
#follow #sqljoins
#join #interviewquery
#leetcode #leetcodesql
#leetcodesolutions #job
#jobs #jobsearch #olympics
#databasequeries
#leetcode #leetcodesolutions
#leetcodesql #coding