Skip to content

Latest commit

 

History

History
63 lines (50 loc) · 1.36 KB

File metadata and controls

63 lines (50 loc) · 1.36 KB

SQLite DataBase Management

This is a setup script to view the basics for the SQLite DataBase management. It does the following:

  • Access SQLite in the Ubuntu remote server;
  • Access the SQLite DataBase;
  • Manages SQLite tables;

Access

SSH into your server and enter SQLite:

# default SQLite browser 
sqlite3

# suggested SQLite browser
sqlite3 -column -header

Open the option-data.db DataBase:

.open option-data.db

DataBase Management

Show the tables inside the DataBase:

.tables

Get the structure of the tables btc_option_data and eth_option_data inside the DataBase:

# BTC option data structure
.schema btc_option_data

# ETH option_data
.schema eth_option_data

Show tables via SQL commands:

# show all elements
SELECT * FROM btc_option_data;
SELECT * FROM eth_option_data;

# show 5 entries
SELECT * FROM btc_option_data LIMIT 5;
SELECT * FROM eth_option_data LIMIT 5;

# get instrument name, market price and timestamp
SELECT instrument_name, mark_price, timestamp FROM btc_option_data;
SELECT instrument_name, mark_price, timestamp FROM eth_option_data;

# get all the available data for a specific instrument
SELECT * FROM btc_option_data WHERE instrument_name = 'BTC-24SEP21-7000-P';

Quit

Exit SQLite

.quit

Supported version

This setup script has been tested against SQLite version 3.31.1