Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
24 views

SQLQuery 2

Uploaded by

Suraj P V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

SQLQuery 2

Uploaded by

Suraj P V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

use Training

create table orders (order_id int, order_date date, amount int, customer_id int);
select * from customer;
select * from orders;

insert into orders values(1,'04/03/2023',140, 4);

insert into orders values(2,'05/03/2023',75, 3);

insert into orders values(3,'05/03/2023',150, 4);

insert into orders values(4,'06/03/2023',75, 2);

insert into orders values(5,'06/03/2023',200, 4);

select * from customer;


select * from orders;

select c.first_name, c.address, o.amount, o.order_date


from customer As c
INNER JOIN orders As o
ON c.customer_id=o.customer_id;

select c.first_name, c.address, o.amount, o.order_date


from customer As c
LEFT JOIN orders As o
ON c.customer_id=o.customer_id;

select c.first_name, c.address, o.amount, o.order_date


from customer As c
RIGHT JOIN orders As o
ON c.customer_id=o.customer_id;

UPDATE ORDERS SET amount=100 where customer_id=3;

select * from orders;

You might also like