- 浏览: 254870 次
- 性别:
- 来自: 西安
文章分类
- 全部博客 (91)
- hibernate (6)
- javaScript (9)
- flex (18)
- linux (3)
- vc (2)
- vs (0)
- arcgis (4)
- java (11)
- eclipse (5)
- php (3)
- arcgissde (3)
- arcgis server (5)
- myeclipse (1)
- spring (7)
- junit (1)
- ehcache (2)
- svn (2)
- SQL (7)
- webService (1)
- http://code.svnspot.com/ (0)
- spring security3 (8)
- maven (3)
- struts (2)
- tomcat (4)
- apache (1)
- vmware (0)
- mysql (2)
- android (2)
- jms (0)
- dbvisulizer (1)
- 百度地图 (2)
- openlayers (1)
最新评论
-
jobsccnu:
非常感谢,到处找这个代码呢
flex导出图片 -
li1045460568:
...
HibernateDao.java -
li1045460568:
[flash=200,200][flash=200,200][ ...
HibernateDao.java -
zz210891470:
会报这个错啊Exception in thread " ...
cxf webService简单例子 -
jie66989:
主要就是这个类了,这是前段时间学习的时候用的一部分,那个时候只 ...
HibernateDao.java
USE Master
GO
IF EXISTS(SELECT * FROM sysdatabases WHERE name = 'library')
DROP DATABASE library
GO
CREATE DATABASE library
GO
USE library
GO
--书籍信息表
CREATE TABLE [dbo].[bookInfo](
[bookId] [int] IDENTITY(2001,1) NOT NULL,
[bookName] [nvarchar](30) NOT NULL,
[tid] [int] NOT NULL,
[author] [nvarchar](20) ,
[publish] [nvarchar](30) ,
[isbn] [nvarchar](20) ,
[introduce] [nvarchar](100) ,
[Price] [float] NOT NULL,
[vipPrice] [float] NOT NULL,
[imagePath] [nvarchar](50) ,
[publishDate] [datetime] ,
[outDate] [datetime] ,
CONSTRAINT [PK_bookId] PRIMARY KEY CLUSTERED
(
[bookId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [UK_bookId] UNIQUE NONCLUSTERED
(
[bookId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('洋文连篇','1003','march','北京大学出版社','SS001','学习书籍',20,16,'image1/1.jpg','2011-3-9 0:00:00','2011-3-9 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('我的美女老板','1005','天下第二','华东师范大学出版社','SS003','学习书籍',35,28,'image1/2.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('球事儿','1006','杜庆峰','西安工业大学出版社','SS004','说事书籍',25,20,'image1/3.jpg','2011-3-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('奥林霹客','1007','魏国福','西安工业大学出版社','SS006','故事书籍',18,14.4,'image1/4.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('童言无忌','1008','金晨','武汉工业大学出版社','SS007','明理书籍',30,24.4,'image1/5.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('挑食宝贝','1009','王锦锦','西安工程大学出版社','SS008','营养书籍',31,25,'image1/6.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('丰田的方式','1010','申达慧','西北工业大学出版社','SS009','管理书籍',30,26,'image1/7.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('神兵小将','1011','吴磊','南京邮电大学出版社','SS010','管理书籍',28,25,'image1/8.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('风光','1012','燕子小三','南京邮电大学出版社','SS011','言情书籍',18,10,'image1/9.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('薛丁山征西','1013','浪子小三','南京大学出版社','SS012','历史书籍',40,34.8,'image1/10.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('倒悬的天空','1014','幽灵','南京大学出版社','SS013','悬疑书籍',17,10.5,'image1/11.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('咖啡红茶','1015','风光无限','南京大学出版社','SS014','生活书籍',35,15.5,'image1/12.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
--管理员表
CREATE TABLE [dbo].[managerInfo](
[adminId] [nvarchar](18) NOT NULL,
[adminPwd] [nvarchar](18) NOT NULL,
[alastLoginTime] [datetime] ,
[aloginCount] [int] ,
[aregister] [datetime] ,
CONSTRAINT [PK_adminId] PRIMARY KEY CLUSTERED
(
[adminId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [UK_adminId] UNIQUE NONCLUSTERED
(
[adminId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO managerInfo (adminId,adminPwd,alastLoginTime,aloginCount,aregister)
VALUES ('admin','admin','2011-05-01',2,'2011-01-01');
INSERT INTO managerInfo (adminId,adminPwd,alastLoginTime,aloginCount,aregister)
VALUES ('zxn','123','2011-02-01',1,'2011-01-01');
--用户表
CREATE TABLE [dbo].[memberInfo](
[muid] [nvarchar](18) NOT NULL,
[mpwd] [nvarchar](18) NOT NULL,
[memail] [nvarchar](30) ,
[mquestion] [nvarchar](30) ,
[manswer] [nvarchar](30) ,
[mname] [nvarchar](20) ,
[mregister] [datetime] ,
CONSTRAINT [PK_muid] PRIMARY KEY CLUSTERED
(
[muid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [UK_muid] UNIQUE NONCLUSTERED
(
[muid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO memberInfo (muid,mpwd,memail,mquestion,manswer,mname,mregister)
VALUES ('zxn','zxn','8057@qq.com','one','大脸猫','叶子','2011-4-19 0:00:00');
INSERT INTO memberInfo (muid,mpwd,memail,mquestion,manswer,mname,mregister)
VALUES ('zhangxiaoni','123','zhangxiaoni@qq.com','two','qwqw','qweq','2011-4-19 0:00:00');
--订单人表
CREATE TABLE [dbo].[orderFormInfo](
[orderId] [int] IDENTITY(3001,1) NOT NULL,
[muid] [nvarchar](18) NOT NULL,
[buyerName] [nvarchar](20) NOT NULL,
[buyerTel] [nvarchar](15) NOT NULL,
[postcode] [nvarchar](15) NOT NULL,
[postAddress] [nvarchar](50) NOT NULL,
[email] [nvarchar](30) NOT NULL,
[payModel] [int] NOT NULL,
[orderDatetime] [datetime] NOT NULL CONSTRAINT [DF_orderDatetime] DEFAULT (''),
CONSTRAINT [PK_orderId] PRIMARY KEY CLUSTERED
(
[orderId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [UK_orderId] UNIQUE NONCLUSTERED
(
[orderId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[orderFormInfo] WITH CHECK ADD CONSTRAINT [FK_muid] FOREIGN KEY([muid])
REFERENCES [dbo].[memberInfo] ([muid])
GO
ALTER TABLE [dbo].[orderFormInfo] CHECK CONSTRAINT [FK_muid]
GO
ALTER TABLE [dbo].[orderFormInfo] WITH CHECK ADD CONSTRAINT [CK_payModel] CHECK (([payModel] like '[1,2,3]'))
GO
ALTER TABLE [dbo].[orderFormInfo] CHECK CONSTRAINT [CK_payModel]
GO
INSERT INTO orderFormInfo (muid,buyerName,buyerTel,postcode,postAddress,email,payModel,orderDatetime)
VALUES ('zxn','wrwr','wrw','rwr','wrwr','rrwe',1,'1900-1-12 0:00:00');
INSERT INTO orderFormInfo (muid,buyerName,buyerTel,postcode,postAddress,email,payModel,orderDatetime)
VALUES ('admin','qqqq','11111','11111111','1111111','11111',1,'1930-6-4 0:00:00');
INSERT INTO orderFormInfo (muid,buyerName,buyerTel,postcode,postAddress,email,payModel,orderDatetime)
VALUES ('admin','wewe','weqwe','weq','eqwe','eqe',1,'1905-6-2 0:00:00');
--订单表
CREATE TABLE [dbo].[orderProduceInfo](
[orderId] [int] NOT NULL,
[bookId] [int] NOT NULL,
[bookCount] [int] NOT NULL CONSTRAINT [DF_bookCount] DEFAULT 0,
[allPrice] [float] NOT NULL CONSTRAINT [DF_allPrice] DEFAULT 0.0,
CONSTRAINT [PK_orderId_bookId] PRIMARY KEY CLUSTERED
(
[orderId] ASC,
[bookId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[orderProduceInfo] WITH CHECK ADD CONSTRAINT [FK_bookId] FOREIGN KEY([bookId])
REFERENCES [dbo].[bookInfo] ([bookId])
GO
ALTER TABLE [dbo].[orderProduceInfo] CHECK CONSTRAINT [FK_bookId]
GO
ALTER TABLE [dbo].[orderProduceInfo] WITH CHECK ADD CONSTRAINT [FK_orderId] FOREIGN KEY([orderId])
REFERENCES [dbo].[orderFormInfo] ([orderId])
GO
ALTER TABLE [dbo].[orderProduceInfo] CHECK CONSTRAINT [FK_orderId]
GO
--评价书表
CREATE TABLE [dbo].[reviewInfo](
[reviewId] [int] IDENTITY(4001,1) NOT NULL,
[muid] [nvarchar](18) NOT NULL,
[bookId] [int] NOT NULL,
[content] [nvarchar](500) NOT NULL,
[reviewTime] [datetime] NOT NULL CONSTRAINT [DF_reviewTime] DEFAULT (GETDATE()),
CONSTRAINT [PK_reviewId] PRIMARY KEY CLUSTERED
(
[reviewId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[reviewInfo] WITH CHECK ADD CONSTRAINT [FK_bookId2] FOREIGN KEY([bookId])
REFERENCES [dbo].[bookInfo] ([bookId])
GO
ALTER TABLE [dbo].[reviewInfo] CHECK CONSTRAINT [FK_bookId2]
GO
ALTER TABLE [dbo].[reviewInfo] WITH CHECK ADD CONSTRAINT [FK_muid2] FOREIGN KEY([muid])
REFERENCES [dbo].[memberInfo] ([muid])
GO
ALTER TABLE [dbo].[reviewInfo] CHECK CONSTRAINT [FK_muid2]
GO
GO
IF EXISTS(SELECT * FROM sysdatabases WHERE name = 'library')
DROP DATABASE library
GO
CREATE DATABASE library
GO
USE library
GO
--书籍信息表
CREATE TABLE [dbo].[bookInfo](
[bookId] [int] IDENTITY(2001,1) NOT NULL,
[bookName] [nvarchar](30) NOT NULL,
[tid] [int] NOT NULL,
[author] [nvarchar](20) ,
[publish] [nvarchar](30) ,
[isbn] [nvarchar](20) ,
[introduce] [nvarchar](100) ,
[Price] [float] NOT NULL,
[vipPrice] [float] NOT NULL,
[imagePath] [nvarchar](50) ,
[publishDate] [datetime] ,
[outDate] [datetime] ,
CONSTRAINT [PK_bookId] PRIMARY KEY CLUSTERED
(
[bookId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [UK_bookId] UNIQUE NONCLUSTERED
(
[bookId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('洋文连篇','1003','march','北京大学出版社','SS001','学习书籍',20,16,'image1/1.jpg','2011-3-9 0:00:00','2011-3-9 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('我的美女老板','1005','天下第二','华东师范大学出版社','SS003','学习书籍',35,28,'image1/2.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('球事儿','1006','杜庆峰','西安工业大学出版社','SS004','说事书籍',25,20,'image1/3.jpg','2011-3-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('奥林霹客','1007','魏国福','西安工业大学出版社','SS006','故事书籍',18,14.4,'image1/4.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('童言无忌','1008','金晨','武汉工业大学出版社','SS007','明理书籍',30,24.4,'image1/5.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('挑食宝贝','1009','王锦锦','西安工程大学出版社','SS008','营养书籍',31,25,'image1/6.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('丰田的方式','1010','申达慧','西北工业大学出版社','SS009','管理书籍',30,26,'image1/7.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('神兵小将','1011','吴磊','南京邮电大学出版社','SS010','管理书籍',28,25,'image1/8.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('风光','1012','燕子小三','南京邮电大学出版社','SS011','言情书籍',18,10,'image1/9.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('薛丁山征西','1013','浪子小三','南京大学出版社','SS012','历史书籍',40,34.8,'image1/10.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('倒悬的天空','1014','幽灵','南京大学出版社','SS013','悬疑书籍',17,10.5,'image1/11.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
INSERT INTO [library].[dbo].[bookInfo] ([bookName],[tid],[author],[publish],[isbn]
,[introduce],[Price],[vipPrice],[imagePath],[publishDate],[outDate])
VALUES ('咖啡红茶','1015','风光无限','南京大学出版社','SS014','生活书籍',35,15.5,'image1/12.jpg','2011-4-19 0:00:00','2011-4-19 0:00:00');
--管理员表
CREATE TABLE [dbo].[managerInfo](
[adminId] [nvarchar](18) NOT NULL,
[adminPwd] [nvarchar](18) NOT NULL,
[alastLoginTime] [datetime] ,
[aloginCount] [int] ,
[aregister] [datetime] ,
CONSTRAINT [PK_adminId] PRIMARY KEY CLUSTERED
(
[adminId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [UK_adminId] UNIQUE NONCLUSTERED
(
[adminId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO managerInfo (adminId,adminPwd,alastLoginTime,aloginCount,aregister)
VALUES ('admin','admin','2011-05-01',2,'2011-01-01');
INSERT INTO managerInfo (adminId,adminPwd,alastLoginTime,aloginCount,aregister)
VALUES ('zxn','123','2011-02-01',1,'2011-01-01');
--用户表
CREATE TABLE [dbo].[memberInfo](
[muid] [nvarchar](18) NOT NULL,
[mpwd] [nvarchar](18) NOT NULL,
[memail] [nvarchar](30) ,
[mquestion] [nvarchar](30) ,
[manswer] [nvarchar](30) ,
[mname] [nvarchar](20) ,
[mregister] [datetime] ,
CONSTRAINT [PK_muid] PRIMARY KEY CLUSTERED
(
[muid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [UK_muid] UNIQUE NONCLUSTERED
(
[muid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO memberInfo (muid,mpwd,memail,mquestion,manswer,mname,mregister)
VALUES ('zxn','zxn','8057@qq.com','one','大脸猫','叶子','2011-4-19 0:00:00');
INSERT INTO memberInfo (muid,mpwd,memail,mquestion,manswer,mname,mregister)
VALUES ('zhangxiaoni','123','zhangxiaoni@qq.com','two','qwqw','qweq','2011-4-19 0:00:00');
--订单人表
CREATE TABLE [dbo].[orderFormInfo](
[orderId] [int] IDENTITY(3001,1) NOT NULL,
[muid] [nvarchar](18) NOT NULL,
[buyerName] [nvarchar](20) NOT NULL,
[buyerTel] [nvarchar](15) NOT NULL,
[postcode] [nvarchar](15) NOT NULL,
[postAddress] [nvarchar](50) NOT NULL,
[email] [nvarchar](30) NOT NULL,
[payModel] [int] NOT NULL,
[orderDatetime] [datetime] NOT NULL CONSTRAINT [DF_orderDatetime] DEFAULT (''),
CONSTRAINT [PK_orderId] PRIMARY KEY CLUSTERED
(
[orderId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [UK_orderId] UNIQUE NONCLUSTERED
(
[orderId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[orderFormInfo] WITH CHECK ADD CONSTRAINT [FK_muid] FOREIGN KEY([muid])
REFERENCES [dbo].[memberInfo] ([muid])
GO
ALTER TABLE [dbo].[orderFormInfo] CHECK CONSTRAINT [FK_muid]
GO
ALTER TABLE [dbo].[orderFormInfo] WITH CHECK ADD CONSTRAINT [CK_payModel] CHECK (([payModel] like '[1,2,3]'))
GO
ALTER TABLE [dbo].[orderFormInfo] CHECK CONSTRAINT [CK_payModel]
GO
INSERT INTO orderFormInfo (muid,buyerName,buyerTel,postcode,postAddress,email,payModel,orderDatetime)
VALUES ('zxn','wrwr','wrw','rwr','wrwr','rrwe',1,'1900-1-12 0:00:00');
INSERT INTO orderFormInfo (muid,buyerName,buyerTel,postcode,postAddress,email,payModel,orderDatetime)
VALUES ('admin','qqqq','11111','11111111','1111111','11111',1,'1930-6-4 0:00:00');
INSERT INTO orderFormInfo (muid,buyerName,buyerTel,postcode,postAddress,email,payModel,orderDatetime)
VALUES ('admin','wewe','weqwe','weq','eqwe','eqe',1,'1905-6-2 0:00:00');
--订单表
CREATE TABLE [dbo].[orderProduceInfo](
[orderId] [int] NOT NULL,
[bookId] [int] NOT NULL,
[bookCount] [int] NOT NULL CONSTRAINT [DF_bookCount] DEFAULT 0,
[allPrice] [float] NOT NULL CONSTRAINT [DF_allPrice] DEFAULT 0.0,
CONSTRAINT [PK_orderId_bookId] PRIMARY KEY CLUSTERED
(
[orderId] ASC,
[bookId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[orderProduceInfo] WITH CHECK ADD CONSTRAINT [FK_bookId] FOREIGN KEY([bookId])
REFERENCES [dbo].[bookInfo] ([bookId])
GO
ALTER TABLE [dbo].[orderProduceInfo] CHECK CONSTRAINT [FK_bookId]
GO
ALTER TABLE [dbo].[orderProduceInfo] WITH CHECK ADD CONSTRAINT [FK_orderId] FOREIGN KEY([orderId])
REFERENCES [dbo].[orderFormInfo] ([orderId])
GO
ALTER TABLE [dbo].[orderProduceInfo] CHECK CONSTRAINT [FK_orderId]
GO
--评价书表
CREATE TABLE [dbo].[reviewInfo](
[reviewId] [int] IDENTITY(4001,1) NOT NULL,
[muid] [nvarchar](18) NOT NULL,
[bookId] [int] NOT NULL,
[content] [nvarchar](500) NOT NULL,
[reviewTime] [datetime] NOT NULL CONSTRAINT [DF_reviewTime] DEFAULT (GETDATE()),
CONSTRAINT [PK_reviewId] PRIMARY KEY CLUSTERED
(
[reviewId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[reviewInfo] WITH CHECK ADD CONSTRAINT [FK_bookId2] FOREIGN KEY([bookId])
REFERENCES [dbo].[bookInfo] ([bookId])
GO
ALTER TABLE [dbo].[reviewInfo] CHECK CONSTRAINT [FK_bookId2]
GO
ALTER TABLE [dbo].[reviewInfo] WITH CHECK ADD CONSTRAINT [FK_muid2] FOREIGN KEY([muid])
REFERENCES [dbo].[memberInfo] ([muid])
GO
ALTER TABLE [dbo].[reviewInfo] CHECK CONSTRAINT [FK_muid2]
GO
发表评论
-
sql优化
2012-11-07 10:20 1033经常查询索引列中的数据时,才需要在表上创建索引。索引占用磁盘空 ... -
ssh
2012-04-25 23:28 975ssh整合时候jar包冲突是因为hibernate和strut ... -
sqlserver tcp/ip连接失败
2012-03-21 19:33 1178在 SQL Server 2005 里面,如果出现到主机的 T ... -
mysql
2012-03-21 19:32 938mysql的远程连接命令: my ... -
oracle提示
2012-03-21 17:34 1524=============================== ... -
oracle笔记
2012-03-21 17:33 908oracle配置信息目录: product\11.1.0\db ...
相关推荐
标题提到的“Excel根据表格,批量生成sqlserver语句,生成建表语句,自行到数据库中执行”,就是一种利用Excel宏自动化生成SQL Server建表语句的方法。这种方法适用于已有数据结构清晰的Excel表格,通过特定的规则...
可以支持导出单表的建表语句,也可以支持单库所有建表语句的导出以及同服务器跨库建表语句的导出。
在部署Quartz时,根据选用的数据库(如MySQL、Oracle、SQL Server等),需要将"quartz-数据库建表语句.zip"中的相应SQL脚本运行在数据库上,以创建这些必要的表。这一步是Quartz配置中的关键部分,确保Quartz能够...
4. SQL建表语句:根据JSON数据的结构,你需要生成对应的SQL CREATE TABLE语句。这包括确定字段名、数据类型和约束条件。例如,JSON对象的键将对应于表的列名,JSON值的类型将决定SQL字段的数据类型。对于嵌套的JSON...
每个数据库都有其特定的SQL建表语句,确保与特定数据库系统的兼容性。这些语句通常可以在Quartz的官方文档或源代码中的资源文件中找到。 1. **MySQL**: MySQL的建表语句通常遵循ANSI SQL标准,但可能需要根据...
用SQL语句j查SQLServer的表结构 用SQL语句j查SQLServer的表结构
首先,标题中的"sqlserver自动生成sql语句工具"指的是可以分析SQL Server数据库结构和数据,自动生成对应的SQL创建语句的软件。这种工具通常能帮助数据库管理员快速获取数据库的定义,便于备份、迁移或在其他环境中...
* 在 SQL Server Management Studio 中,单击标准工具栏的“新建查询”按钮,启动 SQL 编辑器窗口,在光标处输入 T-SQL 语句,单击“执行”按钮。 二、创建数据表 创建数据表是 SQL Server 数据库管理系统的基本...
通过excel创建n个sheet页,每个sheet页的内容为数据库表见表字段,一键生成数据库见表语句
2. 转换规则应用:根据SQL Server的语法特性,工具会将MySQL的SQL语句转化为相应的SQL Server语法。 3. 数据导出:将MySQL中的数据导出为SQL脚本,或者直接导入到SQL Server中。 4. 验证与调整:迁移后,需要验证...
sqlserver数据表向oracle转换,输入的参数是表名,输出的是建表语句
不可错过的sql试题(含建表语句及详解)。自学mysql数据库,目前找到的最易理解的sql试题,二刷把题目和详解整理了下
本文将深入探讨SQL Server 2000中的查询语句和建表语句,帮助读者更好地理解和掌握这个系统的核心操作。 一、SQL Server 2000查询语句 查询语句是SQL中最基本也是最重要的部分,它允许我们从数据库中检索信息。SQL...
以下是根据提供的文件内容,对达梦数据库建表操作SQL语句所涉及知识点的详细解析: 1. 新建表(CREATE TABLE): 新建表是数据库操作的基础,其SQL语句的一般格式为 `CREATE TABLE [表名] (...)`。在达梦数据库中,...
万年历数据库,从1970年1月1月开始到2100年12月31日,完整的万年历MySQL数据库的sql建表语句以及插入语句,整理不易,欢迎使用。 创建完数据库自己直接拉入进去就可以,编码格式是utf8的,创建的时候注意一下编码...
支持sqlserver与oracle自动生成sql创建表语句,一键自动生成,非常强大。
此外,“快速连接对应数据库”指出这个工具还支持快速连接到各种数据库系统,如MySQL、Oracle、SQL Server、PostgreSQL等,用户可以方便地在不同的数据库环境中应用这些生成的SQL语句。 标签“数据库”表明了这个...
导出一个库中的所有表的结构,包括表说明及字段说明
### SQL Server 2000查询与建表语句详解 #### 一、数据库表结构创建 在SQL Server 2000中,创建表是数据库管理的基础操作之一。通过以下示例,我们可以详细了解如何使用SQL语句创建具有特定结构的表。 ##### 1. ...
在 SQL Server Management Studio 中,单击标准工具栏的“新建查询”按钮,启动 SQL 编辑器窗口,在光标处输入 T-SQL 语句,单击“执行”按钮。SQL 编辑器将提交用户输入的 T-SQL 语句,然后发送到服务器执行,并...