From the course: MySQL Essential Training (2019)

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Finding databases, tables, and columns

Finding databases, tables, and columns - MySQL Tutorial

From the course: MySQL Essential Training (2019)

Finding databases, tables, and columns

- [Instructor] People often ask, how do I find out what tables are in a database? Or how do I find out what columns are in a table? MySQL provides a set of statements for finding this kind of metadata about your database. These statements are specific to MySQL. Other database systems will have different statements for these same functionalities. So for this lesson, we'll use the Scratch database. I'll say use Scratch. And if I want to find a list of the databases available on this server connection, I would say show databases. And this will tell me all of the databases that are available on this server. If I need just a list of tables in a given database. I use that database. So I'm going to use Scratch and I say show tables. I can make that capital because that's actually part of the statement. And I'll execute both of these and we get a list of the tables in Scratch. If I need a list of the columns in a particular table, I can say describe and then the name of the table. And that…

Contents