1. Demand Analysis
In this experiment, I implemented a fund trading system.
The system is not actually operated by users, but by administrators. This system needs to realize several functions. First, you need to be able to view information about all funds in the current market, including serial numbers, fund names, and stock prices. Second, it is necessary to be able to generate fund transaction records, which include transaction numbers, transaction users, transaction funds, and the number of shares purchased. In addition to being able to generate new transactions, the system should also be able to delete transactions, modify old transactions, and find transactions. Third, you need to be able to view all transaction record information.
2. Database design
The database ER diagram is as follows:
A relational database has two tables.
The first table records fund information, which has three attributes, including fund number, fund name, and fund single share price. Where the primary key is the fund number. Each property has non-null constraints and are all string variables.
The second table records the transaction information, which has four attributes, including the transaction number, the name of the transaction user, the number of the transaction fund, and the number of shares traded. Where the primary key is the transaction number. Each attribute has a non-empty limit. The transaction number is an auto-increment primary key of Int type, and the rest are string variables.
A relational database is shown below
Table I:
Table II:
Relational database generation code:
CREATE DATABASE 'test1';
CREATE TABLE `test1`.`foundation` (
`foundationid` INT NOT NULL,
`foundation` VARCHAR(20) NOT NULL,
`price` DOUBLE NOT NULL,
PRIMARY KEY (`foundationid`));
CREATE TABLE `test1`.`people` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(10) NOT NULL,
`foundationid` VARCHAR(10) NOT NULL,
`shares` VARCHAR(10) NOT NULL,
PRIMARY KEY (`id`));
3. System display
The main interface of the system is as follows:
Clicking on the fund market will display the information of all funds in the current market, including the fund number, fund name, and fund single share price.
Clicking on the transaction record will display all the transaction information currently recorded, including the transaction number, the name of the transaction user, the fund number of the transaction, and the number of shares traded.
Clicking the transaction button will display the transaction window, where transaction information can be changed, including adding, deleting, modifying, and searching for transactions.
Adding a transaction will require input of user name, fund number and number of shares purchased. After entering the information and clicking Confirm, a transaction record will be added. For example, we add a transaction information, the user name is zhou, buy No. 3 fund, buy 400 shares.
After confirmation, a pop-up window will pop up
Go to the transaction record window to view the transaction information currently recorded and increase success
Modifying the transaction is similar to adding, for example, changing the transaction content just now to 500 shares
After clicking Confirm, check the transaction records and the modification is successful
The deletion operation only needs to enter the user name and the purchased fund number. For example, to delete the transaction where user zhou buys No. 3 fund:
Search can be searched by user name or fund number
For example, for a transaction like the following:
If you search for zhou by name, the results are as follows:
If you search for 4 by fund number, the results are as follows:
♻️ Resources
Size: 1.07MB
➡️ Resource download: https://download.csdn.net/download/s1t16/87547878
Note: If the current article or code violates your rights, please private message the author to delete it!