← prev | next →
piterden 2020-03-02 09:06:12
There should be a company_id in the prices table
Joshua Serry 2020-03-02 09:09:14
I use stock and company interchangeable. They are a entity listed on the stock exchange for which daily prices are recorded.
Joshua Serry 2020-03-02 09:10:25
The problem is more making sure I would be structuring this in a way which might be considered best practice rather than cobbled together.
piterden 2020-03-02 09:11:44
Joshua Serry 2020-03-02 09:10:25
The problem is more making sure I would be structuring this in a way which might be considered best practice rather than cobbled together.
There is only one practice if you have two tables which you have described
piterden 2020-03-02 09:12:19
m-1 relation
Joshua Serry 2020-03-02 09:14:17
What about if I have the tables that also store analysis. Such as which stock has met some criteria to invest and on what date(s).
piterden 2020-03-02 09:16:19
It depends on your goal itself. It will be implemented near the m-1 relative two tables
Joshua Serry 2020-03-02 09:37:48
My goal is to setup tables which automatically identify a stock as meeting a single criteria. Then I can calculate various combinations of the criteria to look at investment strategy and performance.
smlkw 2020-03-02 09:48:29
Joshua Serry 2020-03-02 08:48:55
I want to store in two tables some basic stock market data for the ASX (Australian market). 1. List of company names, code and industry and 2. Daily Price data for each of 2500 odd companies.
The problem I was trying to solve is structuring those tables and how to go about getting the data in.
I think pre defined data is ideal (from web scraping). Then the auto id sequential method is another way to solve for it.
After that I need to consider structure of tables to perform analysis of the stocks prices against various criteria.
In the end state I could query: show me all the stocks that met all the 10 criteria last week. Etc
Maybe it’s better to store timeseries data in another database, designed for this type.
Joshua Serry 2020-03-02 09:52:38
smlkw 2020-03-02 09:48:29
Maybe it’s better to store timeseries data in another database, designed for this type.
That’s a good idea. I’ve not used a TSDB before but I was thinking of influxdb. Unless can you recommend one?
So store the prices in the TSDB and store the analysis criteria in a SQL relational db.
smlkw 2020-03-02 09:58:05
Joshua Serry 2020-03-02 09:52:38
That’s a good idea. I’ve not used a TSDB before but I was thinking of influxdb. Unless can you recommend one?
So store the prices in the TSDB and store the analysis criteria in a SQL relational db.
Yes, mix them. I can recommend InfluxDB it’s a good choice. Also take a look on VictoriaMetrics, it’s a young project from guys which are locating in Kyiv and it’s really a fast engine in this industry.
smlkw 2020-03-02 09:59:47
Also, there’s good project called Clickhouse DB from Russian company Yandex, but I’m not sure about financial data. They use this to store clicks and other integer-only data.
smlkw 2020-03-02 10:00:17
Clickhouse is mature at the moment.
Joshua Serry 2020-03-02 10:00:33
I see. I’ll have a look at those thanks!
And in terms of learning more of best practice and how to structure databases for analytics can you or anyone else recommend a particular source: book, website, course etc.
smlkw 2020-03-02 10:01:13
Have a look at this project
smlkw 2020-03-02 10:01:16
https://github.com/alpacahq/marketstore
GitHub – alpacahq/marketstore: DataFrame Server for Financial Timeseries Data –
GitHubDataFrame Server for Financial Timeseries Data. Contribute to alpacahq/marketstore development by creating an account on GitHub.
smlkw 2020-03-02 10:01:58
From this project you can gain important information about storing financial data
Joshua Serry 2020-03-02 10:03:14
smlkw 2020-03-02 10:01:16
https://github.com/alpacahq/marketstore
Thanks that looks exactly like my use case
smlkw 2020-03-02 10:16:59
Joshua Serry 2020-03-02 10:03:14
Thanks that looks exactly like my use case
You’re welcome
Joshua Serry 2020-03-02 22:43:40
Is there a new way too structure an SQL Alchemy connection string from python to connect to mysql database.
I’ve got MySQL, Jupyter notebook and others in Docker compose but the normal connection string: user, pass, up, port etc doesn’t work. Say if up is 192.168.0.12 I always get error can’t connect to 127.0.0.0. it’s like no matter what I type is always trying to connect to a default address and won’t accept anything different. I’m currently using MySQL.connector in the format as described in the docs
piterden 2020-03-02 22:57:27
Joshua Serry 2020-03-02 22:43:40
Is there a new way too structure an SQL Alchemy connection string from python to connect to mysql database.
I’ve got MySQL, Jupyter notebook and others in Docker compose but the normal connection string: user, pass, up, port etc doesn’t work. Say if up is 192.168.0.12 I always get error can’t connect to 127.0.0.0. it’s like no matter what I type is always trying to connect to a default address and won’t accept anything different. I’m currently using MySQL.connector in the format as described in the docs
Please show your connection string
Joshua Serry 2020-03-03 00:32:57
engine = create_engine(‘mysql://root:root@ipaddr:port/dbname’)
https://docs.sqlalchemy.org/en/13/core/engines.html
Joshua Serry 2020-03-03 04:56:25
I’ve tried the default library and a number of others with no luck.
piterden 2020-03-03 05:31:06
Joshua Serry 2020-03-03 00:32:57
engine = create_engine(‘mysql://root:root@ipaddr:port/dbname’)
https://docs.sqlalchemy.org/en/13/core/engines.html
I know how to make it. I asked for your
Joshua Serry 2020-03-03 06:22:55
I don’t have my PC Infront of me. But from memory it was:
engine = create_engine(‘mysql://root:root@192.168.0.12:8080/stocks’)
Then the standard pandas pd.to_sql referring to the above connection. I can clarify in the evening
https://docs.sqlalchemy.org/en/13/core/engines.html
piterden 2020-03-03 06:53:33
Usually MySQL runs on 3306 port
Joshua Serry 2020-03-03 09:10:37
Ah I stupidly included my phpmyadmin port. I’ll try that tonight.
Is there a better free database GUI to use? I find phpmyadmin so bad.
piterden 2020-03-03 09:17:33
PHPMyAdmin is the worst
piterden 2020-03-03 09:18:04
Try official MySQL Workbench client or DBeaver
MasterZiv 2020-03-03 11:34:27
Joshua Serry 2020-03-02 22:43:40
Is there a new way too structure an SQL Alchemy connection string from python to connect to mysql database.
I’ve got MySQL, Jupyter notebook and others in Docker compose but the normal connection string: user, pass, up, port etc doesn’t work. Say if up is 192.168.0.12 I always get error can’t connect to 127.0.0.0. it’s like no matter what I type is always trying to connect to a default address and won’t accept anything different. I’m currently using MySQL.connector in the format as described in the docs
This is not mysql question
Joshua Serry 2020-03-03 12:57:33
piterden 2020-03-03 06:53:33
Usually MySQL runs on 3306 port
Thanks for the reminder to use the right port. I feel so silly.
sysdump 2020-03-03 20:29:55
Joshua Serry 2020-03-03 09:10:37
Ah I stupidly included my phpmyadmin port. I’ll try that tonight.
Is there a better free database GUI to use? I find phpmyadmin so bad.
try to use mysql workbench
Joshua Serry 2020-03-03 21:45:05
I’ll give MySQL workbench a go I couldn’t find a Docker container or compose script for DBeaver
MasterZiv 2020-03-03 22:30:17
Joshua Serry 2020-03-03 21:45:05
I’ll give MySQL workbench a go I couldn’t find a Docker container or compose script for DBeaver
What ?
MasterZiv 2020-03-03 22:30:43
Joshua Serry 2020-03-03 21:45:05
I’ll give MySQL workbench a go I couldn’t find a Docker container or compose script for DBeaver
DBeaver in Docker ?
Joshua Serry 2020-03-03 23:41:11
Yes as a Docker file or docker-compose file
MasterZiv 2020-03-04 00:42:12
Joshua Serry 2020-03-03 23:41:11
Yes as a Docker file or docker-compose file
Why?
MasterZiv 2020-03-04 00:43:15
Joshua Serry 2020-03-03 23:41:11
Yes as a Docker file or docker-compose file
Is it your faith that everything must be run in it’s own Doker?
Joshua Serry 2020-03-04 00:46:16
No I just seem to clog up my system with installs of software when I’m trying it out and so it’s easier for me if I can run everything in Docker. If not available I will install locally to avoid phpmyadmin pains.
zamir 2020-03-05 20:27:27
Any one give me idea what is fetch_status
Paynalton 2020-03-05 21:09:37
mmm, mysql dont have fetch_status
MasterZiv 2020-03-06 00:52:24
zamir 2020-03-05 20:27:27
Any one give me idea what is fetch_status
Anyone give ME idea what “fetch status” is
Manogna 2020-03-07 14:36:07
Can we learn talend in 2 days?
madno 2020-03-09 13:06:50
What is the meaning of block nested loop
MasterZiv 2020-03-09 14:28:09
madno 2020-03-09 13:06:50
What is the meaning of block nested loop
What is this “block nested loop”?
Explain your question in more details
madno 2020-03-09 14:28:45
MasterZiv 2020-03-09 14:28:09
What is this “block nested loop”?
Explain your question in more details
I got this when I did explain on a query
MasterZiv 2020-03-09 14:30:12
madno 2020-03-09 14:28:45
I got this when I did explain on a query
So post the query, the plan, ddl, and all details you thins area reasonable, and then ask
Ayush1705199 2020-03-09 15:21:14
Guys I want to study mysql . Anyone pls suggest from which book I should start
Ayush1705199 2020-03-10 12:19:21
Thanks bro
Joshua Serry 2020-03-10 14:24:23
Ayush1705199 2020-03-10 12:19:21
Thanks bro
I’ve also found lynda.com (now linkedin helpful)
← prev | next →