-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteamLimked.sql
115 lines (91 loc) ยท 3.79 KB
/
teamLimked.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
create database teamlimked;
USE teamlimked;
create table board(
seq int AUTO_INCREMENT primary key,
title varchar(100) not null,
content varchar(1000) not null,
nickname varchar(20),
regdate DATETIME DEFAULT CURRENT_TIMESTAMP(),
visited INT DEFAULT 0
);
select * from board order by regdate desc LIMIT 3, 5;
insert into board values(default, '์ํ ๊ธ ์ ๋ชฉ1์
๋๋ค.', '์ฌ๊ธฐ๋ ์ํ ๊ธ1์ ๋ํ ๋ด์ฉ์
๋๋ค.', 'admin', default, DEFAULT);
insert into board values(default, '์ํ ๊ธ ์ ๋ชฉ2์
๋๋ค.', '์ฌ๊ธฐ๋ ์ํ ๊ธ2์ ๋ํ ๋ด์ฉ์
๋๋ค.', 'admin', default, DEFAULT);
insert into board values(default, '์ํ ๊ธ ์ ๋ชฉ3์
๋๋ค.', '์ฌ๊ธฐ๋ ์ํ ๊ธ3์ ๋ํ ๋ด์ฉ์
๋๋ค.', 'admin', default, DEFAULT);
insert into board values(default, '์ํ ๊ธ ์ ๋ชฉ4์
๋๋ค.', '์ฌ๊ธฐ๋ ์ํ ๊ธ4์ ๋ํ ๋ด์ฉ์
๋๋ค.', 'admin', default, DEFAULT);
insert into board values(default, '์ํ ๊ธ ์ ๋ชฉ5์
๋๋ค.', '์ฌ๊ธฐ๋ ์ํ ๊ธ5์ ๋ํ ๋ด์ฉ์
๋๋ค.', 'admin', default, DEFAULT);
insert into board values(default, '์ํ ๊ธ ์ ๋ชฉ6์
๋๋ค.', '์ฌ๊ธฐ๋ ์ํ ๊ธ6์ ๋ํ ๋ด์ฉ์
๋๋ค.', 'admin', default, default);
SELECT * FROM board;
UPDATE board SET title='์ํ ๊ธ ์ ๋ชฉ7์
๋๋ค.', content='์ฌ๊ธฐ๋ ์ํ ๊ธ7์ ๋ํ ๋ด์ฉ์
๋๋ค.' WHERE seq=6;
CREATE TABLE member(id VARCHAR(20) PRIMARY KEY,
pw varchar(300) not null,
name varchar(50),
email varchar(100) not null,
tel varchar(20) not null,
addr1 varchar(200),
addr2 varchar(100),
postcode varchar(10),
regdate DATETIME DEFAULT CURRENT_TIMESTAMP(),
birth date,
pt int default 0,
visited int default 0
);
DESC MEMBER;
INSERT INTO member VALUES ('admin', '1234', '๊ด๋ฆฌ์',
'[email protected]', '0212341234',
'์์ธํน๋ณ์ ๊ธ์ฒ๊ตฌ ๋์งํธ๋ก9๊ธธ 23 (๋ง๋ฆฌ์ค2 ํจ์
ํ์)',
'11์ธต 1108ํธ', '08511', DEFAULT, '2023-12-25',
DEFAULT, DEFAULT);
INSERT INTO member VALUES ('dhxogns920', '1234', '์คํํ',
'[email protected]', '010-7329-7484',
'์์ธํน๋ณ์ ๊ธ์ฒ๊ตฌ ๊ฐ์ฐ๋ก9๊ธธ 54',
'์ฒ์ฌ๊ต๊ณผ์', '08513', DEFAULT, '1978-12-25',
DEFAULT, DEFAULT);
COMMIT;
UPDATE member SET pw='$2a$10$TMTp1e7vW8nx7l7B49a2d.0robqb2qUFTuBPntKHRvVILg0CmBkqW' WHERE id='admin';
UPDATE member SET pw='$2a$10$TMTp1e7vW8nx7l7B49a2d.0robqb2qUFTuBPntKHRvVILg0CmBkqW' WHERE id='dhxogns920';
SELECT * FROM member;
create table free(bno INT AUTO_INCREMENT PRIMARY KEY, -- ๊ธ๋ฒํธ
title VARCHAR(100) not null, -- ๊ธ์ ๋ชฉ
content VARCHAR(1500) not null, -- ๊ธ๋ด์ฉ
regdate DATETIME DEFAULT CURRENT_TIMESTAMP(), -- ์์ฑ์ผ
visited INT, -- ์กฐํ์
id VARCHAR(20), -- ์์ฑ์
rec INT -- ์ถ์ฒ์
);
DESC free;
CREATE TABLE fileinfo(NO INT AUTO_INCREMENT PRIMARY KEY, -- ๋ฒํธ
articleno varchar(45) DEFAULT NULL, -- ๊ธ๋ฒํธ
saveFolder varchar(45) DEFAULT NULL, -- ์ ์ฅ ๋๋ ํ ๋ฆฌ
originFile varchar(45) DEFAULT NULL, --
saveFile varchar(45) DEFAULT NULL
);
CREATE TABLE guestbook (
articleno int NOT NULL AUTO_INCREMENT PRIMARY KEY,
userid varchar(16) NOT NULL,
subject varchar(100) NOT NULL,
content varchar(2000) NOT NULL,
regtime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);
DESC guestbook;
CREATE TABLE fileobj (
no int NOT NULL AUTO_INCREMENT PRIMARY KEY,
postno INT NOT NULL,
savefolder VARCHAR(400),
originfile VARCHAR(400),
savefile VARCHAR(800),
filesize LONG,
uploaddate VARCHAR(100)
);
CREATE TABLE fileboard (
postno int NOT NULL AUTO_INCREMENT PRIMARY KEY, -- ๊ธ ๋ฒํธ
title VARCHAR(100) not null, -- ๊ธ์ ๋ชฉ
content VARCHAR(1500) not null, -- ๊ธ๋ด์ฉ
regdate DATETIME DEFAULT CURRENT_TIMESTAMP(), -- ์์ฑ์ผ
visited INT DEFAULT 0 -- ์กฐํ์
);
DESC fileboard;
SELECT * FROM fileobj;
SELECT * FROM fileboard;
UPDATE fileboard SET visited=0 WHERE postno=1;
ALTER TABLE fileboard MODIFY COLUMN visited INT DEFAULT 0;