-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathttss.sql
405 lines (384 loc) · 7.67 KB
/
ttss.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
alter system set deferred_segment_creation=false;
create user wangwu identified by wangwu;
grant connect,resource to wangwu;
--drop table TUSER;
--drop table t_orderItem;
--drop table t_order;
--drop table t_liuyan;
--drop table t_lianjie;
--drop table t_goods;
--drop table t_gonggao;
--drop table t_catelog;
--drop table t_admin;
--drop sequence tuser_id;
--drop sequence orderItem_id;
--drop sequence order_id;
--drop sequence liuyan_id;
--drop sequence lianjie_id;
--drop sequence goods_id;
--drop sequence gonggao_id;
--drop sequence catelog_id;
--drop sequence admin_id;
----------------------------------------------
create table TUSER
(
userid NUMBER(*) not null,
username NVARCHAR2(255),
userpw NVARCHAR2(255),
phonenumber NVARCHAR2(255),
usertype NUMBER(*),
userrealname NVARCHAR2(255),
useraddress NVARCHAR2(255),
usersex NVARCHAR2(255),
usertel NVARCHAR2(255),
useremail NVARCHAR2(255),
userqq NVARCHAR2(255),
userman NVARCHAR2(255),
userage NVARCHAR2(255),
userbirthday NVARCHAR2(255),
userxueli NVARCHAR2(255),
userdel NVARCHAR2(255),
userjf nvarchar2(255) default '500' ,
userQDtime nvarchar2(255)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 8K
minextents 1
maxextents unlimited
);
alter table TUSER
add primary key (USERID)
using index
tablespace USERs
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
---------------------------------------------
create table t_orderItem
(
orderItemId NUMBER(*) not null,
orderId NUMBER(*) ,
goodsId NUMBER(*),
goodsQuantity NUMBER(*)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 8K
minextents 1
maxextents unlimited
);
alter table t_orderItem
add primary key (orderItemId)
using index
tablespace USERs
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
CREATE sequence orderItem_id
start with 1
increment by 1
---------------------------------------------
create table t_order
(
orderId NUMBER(*) not null,
orderBianhao NVARCHAR2(255),
orderDate NVARCHAR2(255),
orderZhuangtai NVARCHAR2(255),
odderSonghuodizhi NVARCHAR2(255),
odderFukuangfangshi NVARCHAR2(255),
orderJine NUMBER(*) ,
orderUserId NUMBER(*)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 8K
minextents 1
maxextents unlimited
);
alter table t_order
add primary key (orderId)
using index
tablespace USERs
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
CREATE sequence order_id
start with 1
increment by 1
-------------------------------------------------
create table t_liuyan
(
liuyanId NUMBER(*) not null,
liuyanTitle NVARCHAR2(255),
liuyanContent clob,
liuyanDate NVARCHAR2(255),
liuyanUser NVARCHAR2(255)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 8K
minextents 1
maxextents unlimited
);
alter table t_liuyan
add primary key (liuyanId)
using index
tablespace USERs
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
CREATE sequence liuyan_id
start with 1
increment by 1
---------------------------------------
create table t_lianjie
(
lianjieId NUMBER(*) not null,
lianjieWeb NVARCHAR2(255),
lianjieName NVARCHAR2(255)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 8K
minextents 1
maxextents unlimited
);
alter table t_lianjie
add primary key (lianjieId)
using index
tablespace USERs
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
CREATE sequence lianjie_id
start with 1
increment by 1
-----------------------------------------
create table t_goods
(
goodsId NUMBER(*) not null,
goodsMiaoshu clob,
goodsName NVARCHAR2(255),
goodsPic NVARCHAR2(255),
goodsYanse NVARCHAR2(255),
goodsShichangjia NVARCHAR2(255),
goodsTejia NUMBER(*),
goodsIsnottejia NVARCHAR2(255),
goodsIsnottuijian NVARCHAR2(255),
goodsCatelogId NUMBER(*),
goodsKucun NUMBER(*),
goodsDel NVARCHAR2(255)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 8K
minextents 1
maxextents unlimited
);
alter table t_goods
add primary key (goodsId)
using index
tablespace USERs
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
CREATE sequence goods_id
start with 1
increment by 1
-----------------------------
create table t_gonggao
(
gonggaoId NUMBER(*) not null,
gonggaoTitle NVARCHAR2(255),
gonggaoContent clob,
gonggaoData clob,
gonggaoFabuzhe NVARCHAR2(255),
gonggaoDel NVARCHAR2(255),
gonggaoOne1 NVARCHAR2(255),
gonggaoOne2 NVARCHAR2(255),
gonggaoOne3 NVARCHAR2(255),
gonggaoOne4 NVARCHAR2(255),
gonggaoOne5 NVARCHAR2(255),
gonggaoOne6 NVARCHAR2(255),
gonggaoOne7 NVARCHAR2(255),
gonggaoOne8 NVARCHAR2(255)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 8K
minextents 1
maxextents unlimited
);
alter table t_gonggao
add primary key (gonggaoId)
using index
tablespace USERs
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
CREATE sequence gonggao_id
start with 1
increment by 1
-----------------------------------------------
create table t_catelog
(
catelogId NUMBER(*) not null,
catelogName NVARCHAR2(255),
catelogMiaoshu NVARCHAR2(255),
catelogDel NVARCHAR2(255)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 8K
minextents 1
maxextents unlimited
);
alter table t_catelog
add primary key (catelogId)
using index
tablespace USERs
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
CREATE sequence catelog_id
start with 1
increment by 1
----------------------------------------
create table t_admin
(
userId NUMBER(*) not null,
userName NVARCHAR2(255),
userPw NVARCHAR2(255)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 8K
minextents 1
maxextents unlimited
);
alter table t_admin
add primary key (userId)
using index
tablespace USERs
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
CREATE sequence admin_id
start with 1
increment by 1
CREATE sequence tuser_id
start with 1
increment by 1
insert into TUSER values (tuser_id.nextval, 'admin', 'admin', '15389071915',1,'高鑫', '陕西省西安市','男','15389071915','[email protected]','945912173','sa','30','11月13','研究生','no','10000','20180906');
insert into t_admin values (admin_id.nextval,'sa','sa');
------------------------------------------
select * from TUSER