
create schema gip_taak_08_SipsJoeri;
use gip_taak_08_SipsJoeri;
create table UserAccount(
id int not null auto_increment primary key,
naam text not null,
email text not null,
age int
);
create table Photo(
id int not null auto_increment primary key,
user_id int not null,
album_id int not null,
photo_naam,
author text,
likes int
);
create table Album(
id int not null auto_increment primary key,
user_id int ,
album_naam text
);
insert into UserAccount(id, naam, email, age)
values
(1, "Joeri", "Joeri.sips@immalle.be", "17"),
(2, "Maan", "manneke.jaan@hotmail.com", "100");
insert into Photo(id, user_id, album_id, photo_naam, author, likes)
values
(1, 1, 1, "boom", "joeri",7),
(2, 2, 1, "plant", "maan",20),
(3, 2, 1, "tak", "maan", 46);
insert into Album(id, user_id, album_naam)
values
(1,1, "Natuur"),
SELECT UserAccount.naam, UserAccount.email, UserAccount.age,
photo.photo_naam, photo.author, photo.likes, Album.album_naam
FROM UserAccount JOIN Photo
ON UserAccount.id = Photo.user_id
INNER JOIN Album ON(Photo.album_id = Album.id);