Skip to content

AlexandrosKyriakakis/DataBase

Repository files navigation

Database Project

Python Build Status Dependencies GitHub Issues mysql_connector pandas License

Overview

Serious Company is a website built from scratch for an academic project on lesson NTUA-DATABASES at Nation Technical University of Athens. The website contains random data simulating market database.

  • mysql 8.0.19
  • flask 1.1.2
  • mysql_connector 2.2.9
  • numpy 1.17.4
  • pandas 0.25.3

ER-Diagram

Relational Model

Installation

  1. At first, initialize a mysql database at either a localhost or a server
  2. Then, run the folowing command in terminal, using your credentials in order to connect in mysql host:
	 $ mysql -h "server-name" -u "your_username" -p "your_password"

Run the following inside mysql command prompt, strictly at this order,

  1. AlexJohnChris.sql to create the database.
  2. indexes.sql to create the indexes.
  3. view1.sql and view2.sql to create the views.
  4. past_price_trigger.sql to create the trigger for auto-update past prices.
  5. addStores.sql to add all the stores.

Back in the terminal

  1. Run,
	$ git clone https://github.com/AlexandrosKyriakakis/DataBase.git
	$ cd DataBase
	$ git clone https://github.com/AlexandrosKyriakakis/MarketDataset.git
  1. Add your database credentials at the top '****' of each of the following files,
  2. Run the following strictly at this order,
	$ pip3 install -r requirements.txt
	$ python3 ./addData/addCustomersAndPhone.py
	$ python3 ./addData/addProductsPastPricesHas.py
	$ python3 ./addData/addTransactionsBought.py
  1. Now, that the database is full with random generated data, start the back-end server to finish the installation,
	$ python3 server_guest.py
  1. Open your favorite browser and type http://localhost:8587/ to preview the website.

Sql Queries

Queries to construct database,

Here we show all the queries used in the site at each page,

Authors

YouTube

Explaining in Greek language how to use our Site.
https://www.youtube.com/watch?v=YaeIKbiKvYA&feature=youtu.be

Licence

This project uses MIT license