SQL Review – Useful queries for mySQL

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…

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.


Print Share Comment Cite Upload Translate
APA
Jo | Sciencx (2024-03-29T15:31:53+00:00) » SQL Review – Useful queries for mySQL. Retrieved from https://www.scien.cx/2021/04/21/sql-review-useful-queries-for-mysql/.
MLA
" » SQL Review – Useful queries for mySQL." Jo | Sciencx - Wednesday April 21, 2021, https://www.scien.cx/2021/04/21/sql-review-useful-queries-for-mysql/
HARVARD
Jo | Sciencx Wednesday April 21, 2021 » SQL Review – Useful queries for mySQL., viewed 2024-03-29T15:31:53+00:00,<https://www.scien.cx/2021/04/21/sql-review-useful-queries-for-mysql/>
VANCOUVER
Jo | Sciencx - » SQL Review – Useful queries for mySQL. [Internet]. [Accessed 2024-03-29T15:31:53+00:00]. Available from: https://www.scien.cx/2021/04/21/sql-review-useful-queries-for-mysql/
CHICAGO
" » SQL Review – Useful queries for mySQL." Jo | Sciencx - Accessed 2024-03-29T15:31:53+00:00. https://www.scien.cx/2021/04/21/sql-review-useful-queries-for-mysql/
IEEE
" » SQL Review – Useful queries for mySQL." Jo | Sciencx [Online]. Available: https://www.scien.cx/2021/04/21/sql-review-useful-queries-for-mysql/. [Accessed: 2024-03-29T15:31:53+00:00]
rf:citation
» SQL Review – Useful queries for mySQL | Jo | Sciencx | https://www.scien.cx/2021/04/21/sql-review-useful-queries-for-mysql/ | 2024-03-29T15:31:53+00:00
https://github.com/addpipe/simple-recorderjs-demo