oracle建表实例
2004-10-07 08:31
519 查看
rem ///BY MAXUAN 开始///
create table item(
type_id integer not null,
type varchar2(30),
constraint item_pk primary key(type_id)
);
create table product(
product_id integer not null,
title varchar2(30) not null,
type_id integer not null,
info varchar2(80),
price number(16,2) not null,
constraint product_pk primary key (product_id),
constraint product_fk foreign key(type_id) references item(type_id)
);
create table orders(
order_id integer not null,
name varchar2(20) not null,
address varchar2(100),
tel number(16),
email varchar2(30) not null,
btime date,
product_id integer not null,
uword varchar2(100),
constraint orders_pk primary key(order_id),
constraint orders_fk foreign key(product_id) references product(product_id)
);
create table admin(
admin_id integer not null,
adminname varchar2(20) not null,
password varchar2(20) not null,
constraint admin_pk primary key(admin_id)
);
create sequence type_id increment by 1 start with 1;
create sequence product_id increment by 1 start with 1;
create sequence order_id increment by 1 start with 1;
create sequence admin_id increment by 1 start with 1;
rem ///BY MAXUAN 结束///
create table item(
type_id integer not null,
type varchar2(30),
constraint item_pk primary key(type_id)
);
create table product(
product_id integer not null,
title varchar2(30) not null,
type_id integer not null,
info varchar2(80),
price number(16,2) not null,
constraint product_pk primary key (product_id),
constraint product_fk foreign key(type_id) references item(type_id)
);
create table orders(
order_id integer not null,
name varchar2(20) not null,
address varchar2(100),
tel number(16),
email varchar2(30) not null,
btime date,
product_id integer not null,
uword varchar2(100),
constraint orders_pk primary key(order_id),
constraint orders_fk foreign key(product_id) references product(product_id)
);
create table admin(
admin_id integer not null,
adminname varchar2(20) not null,
password varchar2(20) not null,
constraint admin_pk primary key(admin_id)
);
create sequence type_id increment by 1 start with 1;
create sequence product_id increment by 1 start with 1;
create sequence order_id increment by 1 start with 1;
create sequence admin_id increment by 1 start with 1;
rem ///BY MAXUAN 结束///
相关文章推荐
- Oracle 实例恢复详解
- Oracle的几个概念:数据库名,全局数据库名,SID,实例,命名空间,schema
- 【转】Oracle实例和Oracle数据库(Oracle体系结构)
- Oracle 数据库和数据库实例
- eclipse 下 seam + oracle 运行实例
- Oracle 分区表的统计信息实例
- Oracle创建实例的最少参数需求
- Oracle数据字典的应用实例
- Oracle游标练手实例
- oracle实例crash,报错信息ORA-00600、ORA-27091、ORA-27072
- Oracle Tiger触发器实例
- Oracle实例与数据库的概念详细解释
- Oracle 实例名/服务名 请问SID和Service_Name有什么区别啊?
- Oracle的几个概念:数据库名,全局数据库名,SID,实例,命名空间,schema
- Oracle 中关于%type、%rowtype的两个小实例
- oracle查看实例EM端口号、SID设制与一些命令
- oracle 有用实例
- 主库为oracle 10G ASM RAC,备库为单实例ASM的DATAGUARD
- 关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID
- Oracle 重启数据库实例