[MSSQL] CREATE TABLE, INSERT INTO, DROP TABLE
1)CREATE TABLE 코드 예제
2)INSERT INTO 코드 예제
3)DROP TABLE 코드 예제
CREATE TABLE author(
aid int not null,
name varchar(20) default null primary key,
city varchar(10) default null,
profile_id int default null,
)
INSERT INTO author values(1,'egoinh','seoul',1),(2,'leezche','jeju',2),(3,'blackdew','namhae',3);
CREATE TABLE profile(
pid int not null primary key,
title varchar(10) default null,
description varchar(100)
)
insert into profile values(1,'developer','developer is...'),(2,'designer','designer is...'),(3,'dba','dab is...');
create table topic(
tid int not null primary key,
title varchar(45) default null,
description varchar(100),
author_id varchar(45) default null
)
insert into topic values(1,'HTML','HTML IS...',1),(2,'CSS','CSS IS...',2),(3,'JAVASCRIPT','JAVASCRIPT IS...',3),(4,'DATABASE','DATABASE IS...',NULL);
drop table author
select * from author
select * from profile
select * from topic
CREATE TABLE author(
aid int not null,
name varchar(20) default null primary key,
city varchar(10) default null,
profile_id int default null,
)
INSERT INTO author values(1,'egoinh','seoul',1),(2,'leezche','jeju',2),(3,'blackdew','namhae',3);
CREATE TABLE profile(
pid int not null primary key,
title varchar(10) default null,
description varchar(100)
)
insert into profile values(1,'developer','developer is...'),(2,'designer','designer is...'),(3,'dba','dab is...');
create table topic(
tid int not null primary key,
title varchar(45) default null,
description varchar(100),
author_id varchar(45) default null
)
insert into topic values(1,'HTML','HTML IS...',1),(2,'CSS','CSS IS...',2),(3,'JAVASCRIPT','JAVASCRIPT IS...',3),(4,'DATABASE','DATABASE IS...',NULL);
drop table author
select * from author
select * from profile
select * from topic