数据库.网上书店实验报告
数据库课程设计实验报告
网上书店
目 录
1.引言·························································· 2
1.1实验目的·················································· 2
1.2 问题描述················································· 2
2.系统概述····················································· 2
2.1 功能简述················································· 2
2.2 性能需求················································· 2
2.3 数据库中的关系模型······································ 2
3.整体设计······················································ 3
4.软件环境和高级语言的使用·································· 3
5.详细设计······················································ 4
5.1数据库的建立·············································· 4
5.1.1 建立客户账户信息的表······························ 4
5.1.2 建立出版商的表···································· 4
5.1.3 建立图书表········································· 4
5.1.4 建立用户登录的表·································· 4
5.1.5 插入图书信息······································ 5
5.2 功能实现的部分代码······································· 5
6.系统测试····················································· 17
7.实验总结····················································· 20
引言
1.1实验目的
巩固复习曾经学习过的数据库课程,并通过实际的实验对所学的知识加以巩固以达到模拟现实生活中实际用例的目的。
问题描述
设计一个网上书店系统,满足用户需求。
系统设计
2.1功能简述
网上书店主要分为前台浏览和后台管理两个部分。
前台浏览部分,主要由普通的顾客进行操作,主要功能有浏览图书、查看图书详细信息,添加购物车和结账。
后台管理部分的用户是系统管理员,主要功能包括图书的增、删、改、查。
网上书店功能结构图
2.2 性能需求
网上书店应该能够提供友好的用户界面,使各类用户的工作量最大限度系统具有良好的运行效率CREATE TABLE `bookorder` (
`orderId` int(11),
`username` varchar(20),
`zipcode` varchar(8),
`phone` varchar(20) ,
`creditcard` varchar(20),
`total` double,
PRIMARY KEY (`orderId`)
)
5.1.2 建立出版商的表
CREATE TABLE `publishers` (
`publisherID` int(11),
`publisherName` varchar(30),
PRIMARY KEY (`publisherID`)
)
5.1.3 建立图书表
CREATE TABLE `titles` (
`isbn` varchar(20),
`title` varchar(100),
`editionNumber` int(11),
`copyright` varchar(4),
`publisherID` int(11),
`imageFile` varchar(100),
`price` double,
`summary` varchar(200),
PRIMARY KEY (`isbn`)
)
5.1.4