DEV Community

Rakesh Sagar
Rakesh Sagar

Posted on

[TIL] Mysql Stuff

1) mysql has a json type and the subjectively less interesting spatial types (more r&d coming soon).

2) mysql has a decimal type where you can specify exact number of digits. egs:- some_col DECIMAL(5,2); where 5 is the scale ie number of digits and 2 is the precision ie the number of digits after the decimal.

3) the int column can be declared in these ways
...int, ...
...int(10), ...
...int(10) unsigned, ...
...int(10) unsigned zerofill, ...

4) the '8' int(8) refers to the number of padding to the left of the number not the size/length of the number, and it becomes obvious when zerofill is added.Here is a screen shot i took just for you
Zerofill screen shot

5) Timestamp converts data into utc and back where as date time stores data as is.
Here's a link to a post by someone who takes the chore of writing articles much more seriously.

Conclusion (da ta daaa) this is first of (hopefully) many articles (atleast one per week). Any form of constructive critisism is always welcome with open arms. So.. see you around i guess ${insert akward goodbye}.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay