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. 

AI News

Here’s a concise roundup of the latest AI news from the past couple of days: AI Technology: Friend or Foe? Researchers and experts continue to debate the impact of artificial intelligence. Is it a boon or a threat? The discussion ranges from AI ethics to its potential in various fields. Read more here . 5 Ways Artificial Intelligence Will Change the World by 2050 Futurists predict that AI will revolutionize our lives in the coming decades. From healthcare to transportation, AI is set to transform industries. Explore the possibilities here . How AI Will Transform Businesses in 2023 Business leaders are embracing AI to enhance efficiency, decision-making, and customer experiences. Stay updated on the latest AI trends in the corporate world here . China’s High-Level AI Modules China is pushing the boundaries of AI with modular next-generation systems. These high-level AI technologies promise breakthroughs in fields like robotics, healthcare, and smart cities. Learn more here . The Future ...

Data Cleansing View in Snowflake

For part of one of my free ETLs I am using Zapps to transfer e-mails from Google Sheets and then Keboola to transfer the sheets into my Snowflake database. I am familiar with string searches and cleansing in Oracle and using python but have not had the chance to do this in Snowflake. I wanted to give it a go as a proof of concept if nothing else. There were some difference in functions between Oracle and Snowflake, no INSTR and using POSITION instead and some difference in working with dates / timestamps but overall it was very similar.  The code below is what I ended up using:  I think want to use this to create some overview graphics to allow me to track the success or failure of my ETLs. Assuming the aspects of Retool remain free you can see how much ETL is going on this link .  In case things aren't working, here is a table of the output I am producing.