
Create Database joinex;

use joinex;

Create table students  (
id int primary key auto_increment,
fname varchar (20),
lname varchar (20),
shopId varchar (2)

);
Create table shop  (
id int primary key auto_increment,
shop varchar (2)
);


Describe students;
Describe shop;


insert into students
(fname, lname, ShopId)
value
('Luss', 'Miller', 2),
('Aleaxander', 'Miller', 1),
('keadens', 'dolan', 3),
('lute', 'Miller', 5),
('Lis', 'roskesoky', 4),
('keaden', 'milbo', 1),
('jake', 'Miller', 2),
('zake', 'austin', 6),
('taka', 'Miller', 5),
('maka', 'taka', 3),
('paca', 'Milbo', 2),
('jaka', 'Miller', 1),
('suka', 'dola', 2),
('luca', 'javo', 5),
('jis', 'mavo', 4),
('nis', 'tavo', 2),
('bliss',' Miller', 6),
('tis', 'Miller', 4),
('iss', 'austen', 1),
('lisp', 'austin', 3)
;



insert into shop
(Shop)
value
('AU'),
('IT'),
('CU'),
('HV'),
('MT'),
('AT')
;



select  fname, lname, "AU" AS shop 
from students 
where shopId = 1; 

select fname, lname, shopId 
from students 
join shop on students.shopId = shop.shopId 
where students.lname = "Miller";

select fname, lname, shopId 
from students join shop 
on students.shopId = shop.shopId 
where shopId = 2 ;
