Create table orders and customer inner join and left join right join and full join
**Create table1**
create table orders ( orderid int, customerid int, orderdate varchar2(10));
insert into orders values(10308,2,'18-9-21');
insert into orders values(10309,37,'21-10-21');
insert into orders values(10310,77,'1-01-21');
**Create table 2**
create table customer ( customerid int,customername varchar2(20), contactname varchar2(20), country varchar2(20));
insert into customer values(1,'alex','maria','germany');
insert into customer values(2,'frido','helen','mexico');
insert into customer values(3,'thomas','rose','mexica');
*Query1->SELECT Orders.OrderID, Customer.CustomerName, Orders.OrderDate
FROM Orders
INNER JOIN Customer
ON Orders.CustomerID=Customer.CustomerID;
*Query2->SELECT Orders.OrderID, Customer.CustomerName, Orders.OrderDate
FROM Orders
left join Customer
ON Orders.CustomerID=Customer.CustomerID;
Query 3->SELECT Orders.OrderID, Customer.CustomerName, Orders.OrderDate
FROM Orders
right join Customer
ON Orders.CustomerID=Customer.CustomerID;
Query4->SELECT Orders.OrderID, Customer.CustomerName, Orders.OrderDate
FROM Orders
full join Customer
ON Orders.CustomerID=Customer.CustomerID;
Comments
Post a Comment