欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

图书管理程序(一)

程序员文章站 2022-03-14 09:49:53
本级程序所用的数据表结构: # -------------------------------------------------------- # # 数据表的结构 'a...
本级程序所用的数据表结构:
# --------------------------------------------------------
#
# 数据表的结构 'author'
#

create table author (
   author_id int(6) default '0' not null auto_increment,
   first_name varchar(20) binary not null,
   last_name varchar(20) not null,
   address varchar(100) binary not null,
   zipcode varchar(10) not null,
   telephone varchar(10) not null,
   email varchar(50) not null,
   comment varchar(255) not null,
   primary key (author_id),
   key first_name (first_name),
   key last_name (last_name),
   key address (address),
   key zipcode (zipcode),
   key email (email)
);

# --------------------------------------------------------
#
# 数据表的结构 'books'
#

create table books (
   books_id int(6) default '0' not null auto_increment,
   books_name varchar(100) binary not null,
   publisher_id varchar(6) not null,
   date_pub datetime default '0000-00-00 00:00:00' not null,
   type varchar(6) not null,
   pages varchar(4) not null,
   price float(6,2) default '0.00' not null,
   comment varchar(255) binary not null,
   isbn varchar(25) not null,
   primary key (books_id),
   key name (books_name),
   key publisher (publisher_id),
   key date_pub (date_pub),
   key price (price),
   key pages (pages),
   key type (type),
   key isbn (isbn)
);
# --------------------------------------------------------
#
# 数据表的结构 'books_author'
#

create table books_author (
   id int(6) default '0' not null auto_increment,
   books_id varchar(6) not null,
   author_id varchar(6) not null,
   author_type varchar(6) not null,
   primary key (id)
);

# --------------------------------------------------------
#
# 数据表的结构 'publisher'
#

create table publisher (
   publisher_id int(6) default '0' not null auto_increment,
   publisher_name varchar(100) binary not null,
   address varchar(100) not null,
   zipcode varchar(10) not null,
   telephone varchar(10) not null,
   telefax varchar(10) not null,
   email varchar(50) not null,
   primary key (publisher_id),
   key name (publisher_name),
   key address (address),
   key email (email)
);