Project Report
Project Report
Required Installs:
MySql setup:
Features:
REGISTER/LOGIN:
-User can register to the system if not already registered. The password is
encrypted using SHA1.
INSERT INTO users(name , lastname, email, username, password) VALUES(%s, %s, %s,
%s, %s)", (name, lastname, email, username, password)
-The user can then login using his/her registered username and password.
SELECT * FROM users WHERE username = %s", [username]
-The user can enter the number of stocks(> 0) he/she wants to buy and hit "Buy".
-if the user doesn't have enough cash(the user's total available cash is
displayed at the top right corner of the page)
-the transaction is blocked.
-else
-the user's cash is correspondingly reduced.
-the volume of stocks bought is subtracted from the all stocks table.
-the transcation is recorded.
UPDATE users SET cash=cash-%s WHERE username=%s", (bill, session['username'])
UPDATE stocks SET avail_volume=avail_volume-%s WHERE ticker=%s", (volume, ticker)
INSERT INTO transactions(ticker, volume, type, current_price, id) VALUES(%s, %s,
%s, %s, %s)", (ticker, volume, 'Buy', price, session['id'])
-The user can enter the number of stocks(> 0) he/she wants to sell and hit "Sell".
-the volume of stocks sold is added to the all stocks table.
-the user's cash is correspondingly increased.
-the transcation is recorded.
UPDATE users SET cash=cash+%s WHERE username=%s", (credit, session['username'])
UPDATE stocks SET avail_volume=avail_volume+%s WHERE ticker=%s", (volume, ticker)
INSERT INTO transactions(ticker, volume, type, current_price, id) VALUES(%s, %s,
%s, %s, %s)", (ticker, -volume, 'Sell', current_price, session['id'])
-The user can also view all his/her own transactions (in reverse chronological
order) in the "My transactions" table
SELECT * FROM transactions WHERE id=%s ORDER BY trans_date DESC", (session['id'],)
MySQL (DBMS):
MySQL is an open-source relational database management system based on Structured
Query Language(SQL). MySQL runs on virtually all platforms, including Linux, UNIX,
and Windows. Although it can be used in a wide range of applications, MySQL is most
often associated with web-based applications and online publishing.