DB 40

insert into on duplicate key update (oracle merge) function + DDL alter

create table insert_test ( seq int(10) not null primary key, cont text null, name varchar(15) null, tel_num int null, input_date datetime null ); INSERT INTO insert_test (seq, cont, name, tel_num, input_date) VALUES (1, '대한민국은 코로나를 잘 극복 하고 있습니다.', '홍길동', 1012345678, '2020-05-15 14:35:10'); INSERT INTO insert_test (seq, cont, name, tel_num, input_date) VALUES (2, '대한민국은 코로나를 잘 극복 하고 있습니다.', '홍길동'..

DB/SQL 2022.06.29

SQL update, delete function 정리

delete from insert_test2 where seq in (select seq from insert_test);​ create table insert_test ( seq int(10) primary key , cont text, name varchar(15), tel_num int(11), input_date datetime ); insert into insert_test values (13, '대한민국은 코로나를 잘 극복 하고 있습니다.', '홍길동', 01012345678, now()), (14, '대한민국은 코로나를 잘 극복 하고 있습니다.', '홍길동', 01012345678, now()), (15, '대한민국은 코로나를 잘 극복 하고 있습니다.', '홍길동', 01012345678, ..

DB/SQL 2022.06.28

SQL inner join with ansi 복습용 필기

create table professor ( prfs_id int(10) comment '교수ID', bl_major_id int(10) comment '소속학과ID', name varchar(20) comment '교수이름', tel varchar(15) comment '교수연락처' ); create table major ( major_id int(10) comment '학과ID', major_title varchar(30) comment '학과명', major_prfs_cnt int(5) comment '학과소속교수수', major_student_cnt int(5) comment '학과소속학생수', tel varchar(15) comment '학과사무실연락처' ); create table studen..

DB/SQL 2022.06.25