Sunteți pe pagina 1din 27

D6

Point of Sale System


D6

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.

Intended users, expectations and features facilitating the job


1. Business administration
Users want to have information such as the sales revenue of each branch and
which kind of book is the most popular among customers. They need these kinds of
information to plan promotions for the store.
Features: The database will provide data on the statistics they need.

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

Different ways of transmitting information


Intranet (Dedicated Leased Line Connection)
An intranet is a private computer network that uses Internet protocols, network
connectivity, and public telecommunication system so that people can share
information and operations within an organization. The Intranet environment is
completely owned by the organization and is generally not accessible from the
Internet. Clients and servers running on the Internet protocol suite are used to build an
intranet. HTTP and other Internet protocols are commonly used as well, especially
FTP and e-mail.
Intranets can help employees to find and view information and applications
quickly, according to their roles so that they can finish their job quickly and accurately.
It can also support business operations and decisions across the inter-networked
enterprise.
It also has some disadvantages, for example, there would be some security
concerns with who has the right to access certain information in the intranet, besides,
it could be difficult for the managers to control materials provided by the intranet.
However, to set up a Wire Area Network for an intranet is very expensive, which
is not suitable for this small book store.

Internet (Virtual Private Network)


The internet is the worldwide, publicly accessible network of interconnected
computer networks that transmit data by packet switching using the standard Internet
Protocol. It is a network containing a lot of networks from all over the world, for
example, academic, business, domestic networks, etc. The functions provided by the
internet include email, instant messaging, file transferring, web browsing, etc.
Its function is similar to that of intranet but the major difference is that the
internet is almost opened to everyone who has internet connection. Thus, this is also a
disadvantage if the company stores its information using the internet server because
people outside the company may get into the server and disclose the information.
To use the internet for data communication in a more secure way for the book
store, a virtual private network may help.
A VPN is a private network that uses a public network (usually the Internet) to
connect remote sites or users together. Instead of using a dedicated, real-world
connection such as a leased line, a VPN uses "virtual" connections routed through the
Internet from a private network to a remote site. It provides users with secure access
to their own network. In practice, by encrypting data at the sending end and
decrypting it at the receiving end, it prevents data from being altered during
transmission, maintaining data integrity and security. In addition, it also encrypts the
5
D6
address of the originating and receiving network to ensure that only authorized users
can access the network.
VPN server software should be installed in the LAN with a VPN connection. The
remote users in other branches need to install a VPN client software.

Requirements of the server


Operating system:
Network Operating System which manages the network and entertains requests
from clients.
Processors:
Use multiple processors so that the speed of processing can be increased.
RAM:
Use larger and more reliable RAM so that the server can perform better.
Fault-tolerant Features:
1. RAID System
Improve the speed of the server and prevent data loss in case of disk failure.
2. UPS
It provides temporary power supply to the computer when the mains fails.
3. Backup Server
It holds an updated copy of the important information of the store.

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).

Connection Links – Virtual Private Network


Since private leased lines are very expensive and is usually used by larger
organizations, VPN should be used. It can also perform security measures such as
encryption, authentications and prevent message alteration.
This technology is widely used today because it allows users to access "intranet"
in a different geographical location.

7
D6

DESIGN
Entity-Relationship Diagram

8
D6

Tables and attributes in the database


BOOK – Storing information of the books
Attribute Name Type Example
ISBN char(13) 0141030089
Bk_Title char(150) Freakonomics (Revised Edition)
Bk_Author char(50) Steven D. Levitt, Stephen J. Dubner
Bk_Price money 96.0000
Pub_ID smallint 10
Bk_Category char(20) Political Science

INVENTORY – Recording how many books are left in each store


Attribute Name Type Example
Sto_ID tinyint 1
ISBN char(13) 0141030089
Bk_Qty numeric(18,0) 40

MEMBER – Storing information of members


Attribute Name Type Example
Mem_ID int 100
Mem_Name char(25) Hilda Chan
Mem_Sex char(1) F
Mem_DOB datetime 01/02/1988 00:00:00
Mem_Tel char(8) 23545654
Mem_Address char(80) Flat B, 1/F, 2 Sun Street, Hong Kong
Mem_DOApplication datetime 03/09/2006 00:00:00

ORDER – Recording the ordering of books from the publishers


Attribute Name Type Example
Order_ID int 1000
Order_Date datetime 01/10/2006 00:00:00
ISBN char(13) 0141014253
Sto_ID tinyint 3
Order_Qty int 40

PUBLISHER – Storing information of the publishers


Attribute Name Type Example
Pub_ID smallint 1
Pub_Name char(25) FormAsiaBooks
Pub_Tel char(8) 20000001
Pub_Address char(80) 1 Amoy Street, Mongkok, Kowloon

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

STORE – Storing the telephone number and address of each branch


Attribute Name Type Example
Sto_ID tinyint 1
Sto_Tel char(8) 21000001
Sto_Address char(80) 4 Lock Road, Tsim Sha Tsui, Kowloon

TRANSACTION – Records of all the transactions


Attribute Name Type Example
T_ID int 110011
T_DateTime datetime 02/09/2006 11:35:56
Sto_ID tinyint 1
ISBN char(13) 0006471250
T_Qty int 1
Mem_ID int NULL

10
D6

Network diagram

11
D6

Specification and explanation of the network design


In each store, CAT5 UTP cables will be used to connect all the devices because
the cost is lower and it can be easily installed. Wireless connection is not chosen
because of its higher cost. In addition, fiber-optic cable is not used because it is more
suitable for building a network backbone but not in a LAN.
Switches are used instead of hubs because hub creates data collision easily and it
has the bandwidth will be smaller because it uses broadcasts.
Printers connected to each cashier are for printing receipts. A laser printer is
connected to one of the workstations in the management department for printing
documents, etc.
Every branch will connect to Shop 1 through using VPN connection. Virtual
private networks can be a cost-effective and secure way for different companies to
provide users access to the company’s network and for remote networks to
communicate with each other across the Internet. VPN connections are more
cost-effective than dedicated private lines; usually a VPN involves two parts: the
protected or "inside" network, which provides physical and administrative security to
protect the transmission; and a less trustworthy, "outside" network or segment
(usually through the Internet). Therefore, the network in shop 1 will be the "inside"
network and the networks in shops 2, 3 and 4 will be those "outside" networks.
In case the internet connection fails and the other branches cannot communicate
with the server in shop 1, the server in shops 2, 3 and 4 should store a copy of the data.
This is done manually by one of the shop assistants every week.
A full backup performs every Sunday at 3a.m., an incremental backup performs
every day except on Sunday at 3a.m. Files will be stored in the server of Shop 1’s
management department.

12
D6

IMPLEMENTATION
Creating tables in the database

13
D6

Creating relationships between tables

Inputting data for testing purpose

14
D6

Data verification and validation

The above picture shows that day cannot exceed 31 in October.

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.

View name Description


BookSales_2006 Shows the number of copies sold for each book in year 2006
CategorySales_2006_09 Shows the number of books sold for each category in September 2006
CategorySales_2006_10 Shows the number of books sold for each category in October 2006
SalesRevenue Shows the total sales revenue in each month for all the stores
SalesRevenue_Store1 Shows the total sales revenue in each month for Store 1
SalesRevenue_Store2 Shows the total sales revenue in each month for Store 2
SalesRevenue_Store3 Shows the total sales revenue in each month for Store 3
SalesRevenue_Store4 Shows the total sales revenue in each month for Store 4
StaffList Shows the whole list of staff

Creating views

16
D6

17
D6

Output features

18
D6

Sample user interface (using Microsoft Visual Basic)

19
D6

TESTING AND EVALUATION


Testing of views
1. Showing the number of copies sold for each book in year 2006

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

5. Showing the total sales revenue in each month for Store 1

6. Showing the total sales revenue in each month for Store 2

22
D6

7. Showing the total sales revenue in each month for Store 3

8. Showing the total sales revenue in each month for Store 4

23
D6

9. Showing the whole list of staff in ascending order of their ages

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.

Other things to test


y Check the cables using cable tester
y Check if the servers are working properly with an acceptable speed of
responding clients’ requests
y Check if the workstations in other stores can connect to the VPN server
y Check if the clients can use the services provided by the server
y Check if the backups are performing at the scheduled time and whether the data
can be restored successfully with the backup files

24
D6

CONCLUSION AND DISCUSSION


Generally speaking, the system meets the requirements of users mentioned in the
"Objective" section of the report. However, there are also shortcomings of the system.
Firstly, some views have to be created by the users manually for another month
or another year, such as the views for the number of books sold in a year, the number
of the books in a category sold in a particular month. Also, there will be a lot of views
after a period of time.
Secondly, the system has not yet implemented features like granting discounts to
members because the focus in the prototype is not on the membership administration.
Therefore, the total revenue shown in the views are over-estimated.
Thirdly, it is better to employ programmers to design a graphical user interface
for the users so that they do not need to enter SQL command themselves.

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.

Microsoft SQL Server is a very user-friendly tool. It provides a very convenient


user interface. It does not require user to input SQL commands when creating tables,
inserting data or creating views. Theoretically, it is better to choose a database
management system which can be used on Linux environment because experienced
users will find that Linux is more stable. However, Microsoft’s products are famous
for their easiness to use. Therefore, it suits users who do not have enough experiences
in using database software. In the book shop’s situation, if the owner wish to do a
small-sized business and does not want to employ too many technicians, Microsoft
SQL Server should be a good choice of database development tool.

25
D6

REFERENCES
1. Beauchemin, Bob, and Dan Sullivan. A Developer's Guide to SQL Server 2005 (Microsoft .NET

Development Series) (Paperback). 1st ed. Addison-Wesley Professional, 2006.

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>.

4. "Oracle database". Wikipedia. 16 Feb 2007 <http://en.wikipedia.org/wiki/Oracle_database>.

5. "Microsoft SQL Server". Wikipedia. 16 Feb 2007 <http://en.wikipedia.org/wiki/Microsoft_SQL_Server>.

6. "MySQL". Wikipedia. 16 Feb 2007 <http://en.wikipedia.org/wiki/MySQL>.


7. "PostgreSQL". Wikipedia. 16 Feb 2007 <http://en.wikipedia.org/wiki/Postgresql>.

8. "Intranet." Wikipedia. 16 Feb 2007 <http://en.wikipedia.org/wiki/Intranet>.

9. "Internet." Wikipedia. 16 Feb 2007 <http://en.wikipedia.org/wiki/Internet>.

10. "SQL Server 2005 Enterprise System Requirements." Microsoft SQL Server. Microsoft. 7 November 2005.

22 Feb 2007 <http://www.microsoft.com/sql/editions/enterprise/sysreqs.mspx>.

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>.

13. "Comparison of relational database management systems." Wikipedia. 16 Feb 2007

<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>.

15. "Open Source Database Software Comparison." 16 Feb 2007


<http://www.geocities.com/mailsoftware42/db/>.

16. "Virtual Private Network." 16 Feb 2007 <http://cesy.qed.hkedcity.net/eng/res_kb_article.php?id=6&t=4>.

17. "Microsoft Business Solutions from TrainEase LImited - Specialists in MS Access and MS SQL Server."

TrainEase Ltd. 16 Feb 2007 <http://www.trainease.com/microsoft/microsoft.htm>.

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

S-ar putea să vă placă și