Essential SQL
drop table bird;
drop table if exists bird; 
create table bird (name varchar, size numeric(5,1));
insert into bird (name, size) values ('House sparrow', 15);
insert into bird values ('Carrion crow', 50); 
delete from bird where size > 500;
select name, size from bird where size > 20 order by name;
select avg(size) from bird;

drop table if exists player;
drop table if exists team;
create table team (id char(3) primary key, name varchar);
create table player (id int primary key, name varchar, team char(3) references team(id));
insert into team values ('BM', 'Bayern Muenchen');
insert into team values ('RM', 'Real Madrid');
insert into player values (1, 'Manuel Neuer', 'BM');
select team, count(*) from player group by team;
select player.name as player, team.name as team from player join team on player.team = team.id;