-- phpMyAdmin SQL Dump
-- version 4.9.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 17, 2022 at 10:31 PM
-- Server version: 10.3.32-MariaDB
-- PHP Version: 7.3.33

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `cyberswe_crypto`
--

-- --------------------------------------------------------

--
-- Table structure for table `exchange`
--

DROP TABLE IF EXISTS `exchange`;
CREATE TABLE `exchange` (
  `exch_id` int(6) NOT NULL,
  `exchange` varchar(25) DEFAULT NULL,
  `icon` varchar(40) DEFAULT NULL,
  `symbol` varchar(15) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `members`
--

DROP TABLE IF EXISTS `members`;
CREATE TABLE `members` (
  `mem_id` int(10) NOT NULL,
  `first` text DEFAULT NULL,
  `last` text DEFAULT NULL,
  `level` int(2) DEFAULT NULL,
  `password` varchar(20) DEFAULT NULL,
  `dos` date NOT NULL COMMENT 'date of signup'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tokens`
--

DROP TABLE IF EXISTS `tokens`;
CREATE TABLE `tokens` (
  `token_id` int(10) NOT NULL,
  `token_type` varchar(25) DEFAULT NULL COMMENT 'Etherum, BNB, etc',
  `icon` varchar(30) DEFAULT NULL,
  `token_name` varchar(40) DEFAULT NULL,
  `symbol` varchar(40) DEFAULT NULL COMMENT 'abreviated identifier',
  `start_date` date DEFAULT NULL COMMENT 'What day was it first available for trade'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tokens_owned`
--

DROP TABLE IF EXISTS `tokens_owned`;
CREATE TABLE `tokens_owned` (
  `token_o_id` int(10) NOT NULL,
  `mem_id` int(10) DEFAULT NULL,
  `exch_id` int(6) DEFAULT NULL COMMENT 'what exchange was it purchased from',
  `token_id` int(8) DEFAULT NULL COMMENT 'token itself',
  `do_purchase` date DEFAULT NULL COMMENT 'date of purchase or when coins were acquired',
  `pap` decimal(20,6) DEFAULT NULL COMMENT 'price at purchase',
  `cp` decimal(20,6) DEFAULT NULL COMMENT 'current price',
  `token_count` int(30) DEFAULT NULL COMMENT 'amount of tokens owned',
  `current_value` decimal(20,6) DEFAULT NULL COMMENT 'cp * token_count',
  `percent` decimal(10,4) DEFAULT NULL COMMENT 'percent gain/loss green or red blue for even',
  `holders` int(15) DEFAULT NULL,
  `mc` decimal(20,0) DEFAULT NULL COMMENT 'market cap',
  `ath` decimal(20,6) DEFAULT NULL COMMENT 'all time high',
  `tot_sup` decimal(30,4) DEFAULT NULL COMMENT 'total supply',
  `circ` decimal(30,4) DEFAULT NULL COMMENT 'circulation supply',
  `tot_cap` decimal(30,4) DEFAULT NULL COMMENT 'total capacity',
  `transfers` int(50) DEFAULT NULL COMMENT 'how many times has it been transferred',
  `sell_at` decimal(20,6) DEFAULT NULL COMMENT 'advised sell point',
  `do_sale` date DEFAULT NULL COMMENT 'date of sale',
  `sale_amount` decimal(20,6) DEFAULT NULL,
  `gain` decimal(20,6) DEFAULT NULL COMMENT 'positive or negative result from sale'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `exchange`
--
ALTER TABLE `exchange`
  ADD PRIMARY KEY (`exch_id`);

--
-- Indexes for table `members`
--
ALTER TABLE `members`
  ADD PRIMARY KEY (`mem_id`);

--
-- Indexes for table `tokens`
--
ALTER TABLE `tokens`
  ADD PRIMARY KEY (`token_id`);

--
-- Indexes for table `tokens_owned`
--
ALTER TABLE `tokens_owned`
  ADD PRIMARY KEY (`token_o_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `exchange`
--
ALTER TABLE `exchange`
  MODIFY `exch_id` int(6) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `members`
--
ALTER TABLE `members`
  MODIFY `mem_id` int(10) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tokens`
--
ALTER TABLE `tokens`
  MODIFY `token_id` int(10) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tokens_owned`
--
ALTER TABLE `tokens_owned`
  MODIFY `token_o_id` int(10) NOT NULL AUTO_INCREMENT;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
