There is a customer table and order tableCustomer table has

There is a customer table and order table.Customer table has (Cust_id,Cust_name,Cust_address,city,state,zip_code).

Order table has (Order_id,Order_date,cust_id)

Write a query that will select the names of all customers who have placed orders only.(use inner join technique).In SQL server 2014.

Solution

SELECT ORDER.Order_ID, CUSTOMER.Cust_name,CUSTOMER.Cust_Id
FROM ORDER
INNER JOIN CUSTOMER
ON Order.Cust_iD=Customer.Cust_iD;

While creating tables the field for cust_id in ORDER place Caps C i.e.,Cust_id

There is a customer table and order table.Customer table has (Cust_id,Cust_name,Cust_address,city,state,zip_code). Order table has (Order_id,Order_date,cust_id)

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site