DEV Community

Rakesh Sagar
Rakesh Sagar

Posted on

[TIL] More Mysql Stuff

1) You can get the create statement that was used to create a
table with the query

    SHOW CREATE TABLE table_name;
Enter fullscreen mode Exit fullscreen mode

2) JSON type in mysql an can be created by the query

CREATE TABLE table_name(col_name JSON);
Enter fullscreen mode Exit fullscreen mode

(obligatory crud tutorial coming soon)

3) MySQL has ENUM datatype which can be used to store flag values.

CREATE TABLE table_name(status_flag ENUM('success' 'failed'));
Enter fullscreen mode Exit fullscreen mode

This is better than storing string values as enums are indexed by the database.

4) using markdown text editor of this site.(It's pretty cool actually).

Conclusion (da ta daaa) this flimsy article was written so that i don't break the habit of writing flimsy articles. Any form of constructive criticism is always welcome with open arms. So.. see you around i guess ${insert awkward goodbye}.

Top comments (0)