Wednesday, November 7, 2018

SQL in MySQL

Use Pythonclub3;
use Sakila;
Select * from Film;

/*this joins three tables*/
Select first_name, Last_name, title
From Actor
Join film_actor
On actor.actor_id=film_actor.actor_id
join Film
on film.film_id=film_actor.film_id
Where title='Academy Dinosaur';

Insert into Actor (first_name, Last_name)
values('HARRISON','FORD');

Select * from actor;

start transaction; 
Update Actor
Set First_name='ALEC'
Where actor_id=1;
commit;

Select * from Actor;

Start Transaction;
Update Actor
Set last_name='Smith';
rollback;

No comments:

Post a Comment