Skip to main content

MySQL - Free

 So I was looking at trying to get a cloud based database that was always on. I wanted to build some visuals over whatever data I ended up building and have the DB accessible from a cloud server seemed like the easy way. I wanted to keep it free because I hate spending when I don't need to, so that others could use it for free and because I was sure there must be options out there. In the end my life was made much easier by spending £10 but you can go with the same free option on this site.

https://www.freemysqlhosting.net/

Although not super fast or super sized it gives you a free and easily accessible database. So far I have easily connected using phpAdmin, BeeKeeper Studio, Python, Google Data Studio and Keboola. I have had no issues at all unlike several other solutions I have tried including Heroku. 

To setup the DB you just set your location and hit start, you will then be e-mailed the connection details and then use your favourite MySQL IDE and you are in. 


Above is a snapshot of me connected and using the database through Bee Keeper Studio. For me personally it is a great chance to get experience using MySQL, having mostly been limited to the Oracle stack this is great. So far I haven't done much more than create a few tables and views. 

Below is the full code of the view that I cobbled together using Google / Stackoverflow. Given I have 10 years experience in Oracle it is not surprise that currently I feel Oracle is head and shoulders easier to use. 




create or replace view v_parkrun_result as
select
substr(mailtext,
locate('Your time was',mailtext)+14,
8) event_time,
cast(substr(mailtext,
locate('Congratulations on completing your ',mailtext)+35,
3) as DECIMAL) parkrun_number,
-- get place
trim(substr(mailtext,
locate('Hello Gary',mailtext)+18,
locate('results for event ',mailtext)
- (locate('Hello Gary',mailtext)+18)
)) parkrun_place,
-- get position
cast(substr(mailtext,
locate('today. You finished in',mailtext)+22,
3) as DECIMAL) parkrun_position,
-- get total participants
cast(substr(mailtext,
locate('out of a field of ',mailtext)+18,
4) as DECIMAL) total_field,
-- age category
substr(mailtext,
locate('category VM',mailtext)+9,
7) age_category,
-- age grading (as percentage)
cast(substr(mailtext,
locate('You achieved an age-graded score of ',mailtext)+36,
5) as DECIMAL(4,2)) age_rating,
date(cast(date as datetime)) event_date
from ext_tab_parkrun_email
union all
select '00:21:15' event_time, 192 parkrun_number,'Eastbourne parkrun' place, 30, 343 , 'VM35-39' , 62.04, date('2022-03-05') union all
select '00:21:22' event_time, 191 parkrun_number,'Eastbourne parkrun' place, 28, 338 , 'VM35-39' , 61.7, date('2022-02-26') union all
select '00:22:52' event_time, 190 parkrun_number,'Eastbourne parkrun' place, 37, 318 , 'VM35-39' , 57.61, date('2022-02-12') union all
select convert('00:19:37',time) event_time, 189 parkrun_number,'Eastbourne parkrun' place, 15, 355 , 'VM35-39' , 67.2, date('2022-02-05')
;
create or replace view v_parkrun_processed as
select TIME_FORMAT(STR_TO_DATE(event_time, '%H:%i:%s'),'%H:%i:%s') event_time,
extract(MINUTE FROM TIME_FORMAT(STR_TO_DATE(event_time, '%H:%i:%s'),'%H:%i:%s')) * 60
+ extract(SECOND FROM TIME_FORMAT(STR_TO_DATE(event_time, '%H:%i:%s'),'%H:%i:%s')) total_seconds,
(extract(MINUTE FROM TIME_FORMAT(STR_TO_DATE(event_time, '%H:%i:%s'),'%H:%i:%s')) * 60
+ extract(SECOND FROM TIME_FORMAT(STR_TO_DATE(event_time, '%H:%i:%s'),'%H:%i:%s')))/60 decimal_minute,
parkrun_number,
parkrun_position,
total_field,
age_category,
event_date,
parkrun_place,
age_rating
-- time in seconds and deciaml time in minute.
from v_parkrun_result

Comments

Popular posts from this blog

AWS training cloud academy free course

One of the things I like about this course are the instructors are really clear but also that it provides free labs that allow you to actually sign into AWS and perform some actions to actually create and do things without worrying that you are going to incur a cost.  Today I complete one of the hands on labs.  This was to create a lambda function, in this case it was a very basic python script that was searching a website for a keyword. I then placed this into a schedule and used cloudwatch to create a dashboard that monitored the running of this function. Overall it was a very simple use case but it was also a very simple process to setup.  I don't have much to add to this other than it is well worth signing up to cloud academy for the free training if nothing else, I am tempted, once i have done some more training, to give the paid for option a go to get the full sandboxes. 

Gen AI news 29-04-2024

Here are some recent updates and insights related to Generative AI (gen AI) : Enterprise Hits and Misses - Robotics and Gen AI Converge : This article discusses the convergence of robotics and generative AI. It explores breakthroughs needed in the field, the FTC’s policy change regarding non-competes, and the impact on AI model sizes for enterprises 1 . Read more All You Need To Know About The Upcoming AI-Powered OLED iPad Pro : This piece provides a summary of rumors surrounding the next-gen AI-fused OLED iPad Pro, powered by the new Apple M4 chip 2 . Read more Delivering on the Promise of Gen AI : New Electronics reflects on NVIDIA GTC and key announcements that contribute to delivering on the promises made for generative AI 3 . Read more The Future of Generative AI - An Early View in 15 Charts (McKinsey): Since the release of ChatGPT in November 2022, generative AI has been making headlines. McKinsey research estimates that gen AI features could add up to $4.4 trillion to the globa...

dbt - more stuff

The more I used dbt the more I like it. I am finding many of its features really useful and I haven't even done the training on macros and packages yet so I feel there is more to come yet. In the meantime I have now start to, just of the fun of it, create some downstream views with dependencies on other steps and a function in SQL. Happy to say it is all working really well and using jinja (and my Snowflake function ) has saved me heap of time coding.  Sources yml:  View using the source function (results in SQL) View that references the output from previous steps, allows them to be linked:  Assuming you create your sources in the yml file and reference previous steps using the reference function rather than calling the resulting table (dbt handles that for you) (as shown above) it will automatically work out the dependencies, run things in the right order and produces a lovely lineage graph like so.  I am hoping to stop playing with what I know of dbt and might make...