1,815 views
1 1 vote
Consider the relation Customers (custid, name , address , city , state , introducer)

List all the customers who have introduced at least one other customer

1) Select distinct e.name from Customer e, Customer F where f.introducer =e.ename

2) Select distinct e.name from Customer e, Customer F where f.introducer <>e.name

1 Answer

Best answer
2 2 votes
1 should work.
• selected by
Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
1.2k
1.2k views
tishhaagrawal asked Dec 16, 2023
1,213 views
My doubt here is, if NOT EXISTS gets an empty set as the input then every tuple of the table in the outer query must satisfy the condition. Am I right?For example, in the...
2 2 votes
1 1 answer
764
764 views
equimanthorn asked Sep 15, 2023
764 views
A SQL query is written in its format as clauses are arranged in a specific sequence and these clauses are executed in different sequence. If we’re writing a query using s...
0 0 votes
1 1 answer
1.8k
1.8k views
rayhanrjt asked Jan 6, 2023
1,818 views
Write SQL command to find DepartmentID, EmployeeName from Employee table whose average salary is above 20000.
2 2 votes
1 1 answer
862
862 views
Subhrangsu asked Jun 18, 2022
862 views
Write SQL query to show all employees hired on June 4,1984 (non-default format)emp(empno,ename,job,mgr,hiredate,sal,comm,deptno)