SELECT Exercise (Company . Location Tables)

Script
● Table Name : company -> empno : Employee Number(사원번호), name : Name, job : Job Title, lono : Location No(출근위치번호), stdat : Start Date(입사일)
CREATE TABLE company (empno VARCHAR(10),name VARCHAR(15),
job VARCHAR(20),lono INT(3),stdat DATE, PRIMARY KEY(empno));
 
INSERT INTO company (empno,name,job,lono,stdat) VALUES
('2010005','Iron Man',' Manager',1,'2010-03-05'),
('2018113','Black Widow','Staff',3,'2018-3-4'),
('2015027','Spider Man','Assistant manager',1,'2015-6-5'),
('2021005','Batman','Staff',4,'2021-3-4'),
('2005037','Hulk','General Manager',5,'2005-3-7'),
('2015006','Iron Man','Assistant manager',2,'2015-04-09')";
 
● Table Name : location -> lono : 출근위치번호, locana : 출근지역명
CREATE TABLE location (lono int(2),locana VARCHAR(10));
 
INSERT INTO location (lono,locana) VALUES (1,'Italy'),(2,'Korea'),(3,'Spain'),(4,'UK'),(5,'USA');
Contents
SELECT * FROM company;
empno name job lono stdat
2005037 Hulk General Manager 5 2005-03-07
2010005 Iron Man Manager 1 2010-03-05
2015006 Iron Man Assistant manager 2 2015-04-09
2015027 Spider Man Assistant manager 1 2015-06-05
2018113 Black Widow Staff 3 2018-03-04
2021005 Batman Staff 4 2021-03-04
Contents
명령 : SELECT * FROM location;
lono locana
1 Italy
2 Korea
3 Spain
4 UK
5 USA
Query Input
두 개의 테이블을 사용해서 SELECT명령을 작성 후 'Execute' 선택하세요.
Result
😲 위 Query입력에 명령을 입력 후 'Execute'을 선택해 주세요.
Copyright 2022 © SQL Query