Database in StockTrack

Overview of the database structure for the StockTrack platform, which includes data storage for predictions, user profiles, financial metrics, stock prices, and more.

Predictions (AWS RDS)

The `Predictions` table stores historical stock price predictions and actual values.

ColumnTypeDetails
idintPrimary Key, auto-increment
symbolvarchar(4)Stock symbol (e.g., AAPL)
actualdecimal(7,2)Actual stock price
predicteddecimal(7,2)Predicted stock price
DatedatetimeDate and time of prediction

Django MySQL

User Table

The `User` table stores user profiles, including email, name, and group memberships.

ColumnTypeDetails
idintPrimary Key, auto-increment
emailvarchar(225)User's email, must be unique
first_namevarchar(12)User's first name
last_namevarchar(12)User's last name
passwordvarchar(12)User's Password

Company Table

The `Company` table holds information about different companies, including their stock symbol, sector, and industry.

ColumnTypeDetails
idintPrimary Key, auto-increment
symbolvarchar(4)Unique company stock symbol
namevarchar(25)Company name
sectorvarchar(12)Industry sector
industryvarchar(12)Industry type
descriptionvarchar(225)Brief company description

Financial Metrics Table

The `Financial Metrics` table stores key financial indicators such as P/E ratio, earnings per share, and others for each company.

ColumnTypeDetails
companyForeignKey (Company)Company linked to financial data
pe_ratiodecimal(7,2)Price-to-earnings ratio
epsdecimal(7,2)Earnings per share

Stock Price Table

The `Stock Price` table stores real-time stock price data.

ColumnTypeDetails
companyForeignKey (Company)Company linked to stock price
pricedecimal(7,2)Stock price at a given time
dateDateTimeDate and time of stock price

News Articles Table

The `News Articles` table stores articles related to stocks and financial news.

ColumnTypeDetails
headlinevarchar(225)Article headline
urlvarchar(25)Link to the full article
publish_dateDateTimeDate and time of publication

AWS Cloud Function for Data Population

An AWS Cloud function is integrated with the platform to automatically populate the database with the latest stock data, predictions, and other metrics.

This function pulls data from reliable financial APIs, processes it, and updates the database every hour, ensuring that users always have access to the most up-to-date information.