This content originally appeared on DEV Community and was authored by Jo
This post will cover some useful mySQL queries that I am just now discovering and that would have been really helpful when I just started my journey of learning sql. Alas, we live and we learn.
Show databases
The
show databases;
command shows you a list of the databases available.
Use database_name
The
use database;
command allows you to switch between databases. I've found this one pretty helpful, pretty helpful I'd been double, triple, and quadrouple clicking a database name in mySQL in order to navigate among databases.
Show table
The
show table
command shows you the tables in a database (which could be especially useful after the use database command)
Desc table_name
The
DESC table_name;
command shows field, type, key, null value, and default values of a table. This is very helpful for troubleshooting.
Show Warnings
The
SHOW warnings
command shows what the warning message is if your query is not correct in some way.
This content originally appeared on DEV Community and was authored by Jo
Jo | Sciencx (2021-04-21T01:42:00+00:00) SQL Review – Useful queries for mySQL. Retrieved from https://www.scien.cx/2021/04/21/sql-review-useful-queries-for-mysql/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.