Documente Academic
Documente Profesional
Documente Cultură
TABLE OF CONTENTS
OBJECTIVE 2
Situation 2
Intended users, expectations and features facilitating the job 2
ANALYSIS 4
Different relational database management systems 4
Different ways of transmitting information 5
Requirements of the server 6
Choice of IT tools 6
DESIGN 8
Entity-Relationship Diagram 8
Tables and attributes in the database 9
Network diagram 11
Specification and explanation of the network design 12
IMPLEMENTATION 13
Creating tables in the database 13
Creating relationships between tables 14
Inputting data for testing purpose 14
Data verification and validation 15
Creating views 16
Output features 18
Sample user interface (using Microsoft Visual Basic) 19
TESTING AND EVALUATION 20
Testing of views 20
Other things to test 24
CONCLUSION AND DISCUSSION 25
REFERENCES 26
Source Codes Appendix I
Guidelines on how to attach the database to MS SQL Server Appendix II
1
D6
OBJECTIVE
Situation
A book shop has 4 branches in different regions in Hong Kong. The owner has
employed workers to run the shop, for example, cashiers, people who manage the
inventories and some staff who answer customers’ question and help them to get the
books they want. Every weekend, after the business hours, all of them have to stay
and count the number of books sold and profits they earned that week, and then write
the records on the sheets designed and given by the main branch. On the last day of
each month, the manager of each branch has to send the forms to the main shop.
Everything is done manually.
The owner has received feedbacks from employees, saying that there is too much
workload because they have to be very careful so that they will not be making any
mistakes in recording of the goods sold and the revenue. Some people also
complained that when they come to the book stores asking for a book, the staff has to
spend a lot of time searching for it.
In addition, if the owner wants to extend his business, he could not continue to
rely on the workers to do the work manually.
2. Membership administration
The owner plans to develop a member system and give discounts to members
according to how long they have been a member.
Features: The database will have a table containing members’ information.
3. Inventory control
Shopkeepers want to have an organized way in accessing the information of the
books easily. Besides, they want to know the quantity of the books in stock with the
new system so that they can order books from publishers effectively.
Features: The database will contain information for the books and inventory.
2
D6
Besides, when a transaction is made, the quantity left will be changed automatically.
Publishers’ information will also be stored in the database.
4. Financial control
The owner wants to have information on how profitable his business is.
Features: The database will provide information on the cost and revenue of the
book store.
5. Others
Cashiers suggest a bar code scanner be added to facilitate transactions so that
they can get the price of the book quickly.
Features: After adding the bar code scanner, the database can use the ISBN of
the book to obtain information of the book.
3
D6
ANALYSIS
Different relational database management systems
Characteristics
Oracle 10g Microsoft SQL PostgreSQL MySQL
Server 2005
Maintainer Oracle Corporation Microsoft PostgreSQL Global MySQL AB
Development Group
Operating systems Windows/ Mac OS X/ Windows Windows/ Mac OS X/ Windows/ Mac OS X/
support Linus/ UNIX/ z/OS Linus/ BSD/ UNIX Linus/ BSD/ UNIX
Fully Relational - Yes Yes Yes does not support
affects data storage, foreign key
retrieval and integrity constraints
Language PL/SQL - considered Transact-SQL - PL/pgSQL - MySQL Dialect -
more powerful than considered easy to use resembles Oracle's difficult to use with
Transact-SQL but and more powerful procedural language limited power
more difficult to use than MySQL Dialect PL/SQL.
Open Source No No Yes Yes
Maintainability Difficult Easy Difficult Difficult
Reliability High High Medium Medium
Application support ODBC, JDBC, ODBC, JDBC, ODBC, JDBC, ODBC, JDBC,
ADO.Net, OLEDB, ADO.Net, etc. C/C++, Embeded C/C++, .NET/Mono,
etc. (Microsoft Visual SQL (in C), Tcl/Tk, ADO.Net, OLEDB,
Studio to provide Perl, Python, PHP Delphi, Perl, Python,
end-to-end application PHP, etc.
development
capabilities)
Pricing
Oracle 10g Microsoft SQL Server 2005
Standard Standard Edition $15,000 Standard Edition $5,999
Total Cost $15,000 $5,999
Enterprise Enterprise Edition $40,000 Enterprise Edition $24,999
Management Packs $6,000 Management Tools Included
Advanced Security $10,000 Network Encryption, Single Included
sign-on, PKI
Business Intelligence (OLAP and $40,000 Integration, Reporting and Analysis Included
BI add-on) services
Subtotal $96,000 $24,999
High Additional database instance for $96,000 Additional database instance Included
availability high availability
Subtotal $192,000 $24,999
Multicore Cost of additional core (dual-core $192,000 Cost of additional core Included
processor)
Total $384,000 $24,999
Enterprise
Cost
* PostgreSQL and MySQL are free open-source database software.
4
D6
Choice of IT tools
Database – Microsoft SQL Server 2005
The main reason for choosing MS SQL Server is its graphical user interface
which is more user friendly. Since most of the staff are more familiar with Microsoft
Windows, the time required to train them for this new system would be shorter.
Other languages are more difficult to learn, the staff in the store may not be able
to handle the problems. The cost of employing technicians is also higher.
Moreover, Oracle requires a much higher cost in purchasing a whole set of its
enterprise edition. It is not suitable for a small book store which has just started to
develop a new POS system.
Another extra advantage is that SQL Server has a tight integration with Microsoft
Office products like Word, Excel which are very commonly used in the companies
nowadays.
The following is a list of features of Microsoft SQL Server 2005.
y Rich XML Support: Simplify the integration of the back-end systems and
data transfer across firewalls using XML.
6
D6
y Integration with Windows Server System—BizTalk Server and Commerce
Server: SQL Server 2005, in conjunction with other Microsoft Windows
Server System™ integrated server software, provides even more power for
e-business.
y Security: Ensure applications to be secure in any networked environment,
with role-based security and file and network encryption.
y Full-Text Search: Use and manage both structured and unstructured data,
including searching through Microsoft Office documents.
y High Availability: Maximize the availability of business applications with
log shipping, online backups, and failover clusters.
y Scalability: Scale the applications up to 32 CPUs and 64 gigabytes (GB) of
RAM.
y Indexed Views: Gain performance from the existing hardware by storing
query results and reducing response times.
y Simplified Database Administration: Automatic tuning and maintenance
features enable administrators to focus on other critical tasks.
y Improved Developer Productivity: User-defined functions, cascading
referential integrity, and the integrated Transact-SQL debugger allow the
reuse of code to simplify the development process.
y English Query: Enable users to pose questions in English instead of using
multi dimensional expressions (MDX).
7
D6
DESIGN
Entity-Relationship Diagram
8
D6
9
D6
STAFF – Storing information of the employees
Attribute Name Type Example
Sta_ID smallint 10
Sta_Name char(25) Ada Chan
Sta_Sex char(1) F
Sta_DOB datetime 28/7/1980 00:00:00
Sta_Tel char(8) 21521521
Sta_Address char(80) Flat A, 10/F, 1 Hoi King Road, Kowloon
Sta_Salary money 6000.0000
Sto_ID tinyint 1
10
D6
Network diagram
11
D6
12
D6
IMPLEMENTATION
Creating tables in the database
13
D6
14
D6
This picture shows that the column ISBN does not allow NULL values since this
property is set when the table is created.
15
D6
In the prototype, my focus is on the "Business administration" function.
Therefore, I have created some views to show the performance of the book store.
Creating views
16
D6
17
D6
Output features
18
D6
19
D6
20
D6
2. Showing the number of books sold for each category in September 2006
3. Showing the number of books sold for each category in October 2006
21
D6
4. Showing the total sales revenue in each month for all the stores
22
D6
23
D6
The above views successfully show the necessary data for the business
administration department, including sales revenue of each branch, which book and
which kind of book is the most popular among customers, etc.
24
D6
One of the reasons for my slow process in this project is that I do not understand
how much I have to do for the prototype. At the beginning, I thought that I have to
create a graphical user interface that can facilitate the work of the staff and it makes
me hesitate to start doing it.
Moreover, it is very difficult to start writing the project without adequate
knowledge and experience on networking. This is because the project requires
students to analyze different connection methods and network designs.
25
D6
REFERENCES
1. Beauchemin, Bob, and Dan Sullivan. A Developer's Guide to SQL Server 2005 (Microsoft .NET
2. Balter, Alison. Microsoft(R) Sams Teach Yourself SQL Server(TM) 2005 Express in 24 Hours. Sams, 2006.
3. "Virtual private network". Wikipedia. 16 Feb 2007 <http://en.wikipedia.org/wiki/Vpn>.
10. "SQL Server 2005 Enterprise System Requirements." Microsoft SQL Server. Microsoft. 7 November 2005.
11. "Comparing SQL Server 2005 and Oracle." Microsoft SQL Server. Microsoft. 16 Feb 2007
<http://www.microsoft.com/sql/prodinfo/compare/oracle/default.mspx>.
12. "SQL Server and Oracle Total Cost of Administration." Microsoft SQL Server. Alinean Study. 16 Feb 2007
<http://www.microsoft.com/sql/prodinfo/compare/oracle/sqlserver2005-oracle-tca.mspx>.
<http://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems>.
14. "Comparison of Oracle, MySQL and PostgreSQL DBMS ." 16 Feb 2007
<http://www-css.fnal.gov/dsg/external/freeware/mysql-vs-pgsql.html>.
17. "Microsoft Business Solutions from TrainEase LImited - Specialists in MS Access and MS SQL Server."
18. "SQL Server 2005 Overview." 17 March 2006. Vesigo Studios, Inc.. 22 Feb 2007
<http://www.vesigo.com/SQLServer/SQLServer2000Overview.aspx>.
19. "SQL Server 2005 Features." 17 March 2006. Vesigo Studios, Inc.. 16 Feb 2007
<http://www.vesigo.com/SQLServer/SQLServer2000Features.aspx>.
20. "Database Server Comparison: SQL Server vs MySQL vs Oracle." 5 June 2006. Vesigo Studios, Inc.. 16 Feb
2007 <http://www.vesigo.com/SQLServer/DatabaseServerComparison.aspx>.
26