Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything.
Table: Customer.
+----+-------+
| Id | Name |
+----+-------+
| 1 | Joe |
| 2 | Henry |
| 3 | Sam |
| 4 | Max |
+----+-------+
Using the above tables as example, return the following:
+-----------+
| Customers |
+-----------+
| Henry |
| Max |
+-----------+
DDL SCRIPTS
create table customer (id int,name varchar(100)) insert into customer values(1,'Joe'); insert into customer values(2,'Henry'); insert into customer values(3,'Sam'); insert into customer values(4,'Max'); create table orders(id int,customer_id int); insert into orders values(1,3); insert into orders values(3,1);
select cust.name from customer cust left join orders ord on cust.id=ord.id where ord.id is null;
any case, it additionally implies more open doors for the business to demonstrate significant elements like shopper conduct, taking into account increasingly exact perspectives on circumstances and dangers. ExcelR Data Science Courses
ReplyDeleteVery interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.
ReplyDeleteData Science In Banglore With Placements
Data Science Course In Bangalore
Data Science Training In Bangalore
Best Data Science Courses In Bangalore
Data Science Institute In Bangalore
Thank you..
Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data sciecne course in hyderabad
ReplyDeleteExcellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking Best data science courses in hyerabad
ReplyDeleteIncredibly in general very intriguing post. I was looking for such an information and took pleasure in scrutinizing this one. Keep posting. An obligation of appreciation is all together for sharing.data analytics course in Hyderabad
ReplyDeleteInformative blog
ReplyDeletedata science training in jamshedpur