From the course: MySQL Essential Training

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Finding databases, tables, and columns

Finding databases, tables, and columns - MySQL Tutorial

From the course: MySQL Essential Training

Finding databases, tables, and columns

- [Bill] Hi, I'm Bill Weinman. MySQL provides a set of statements for finding metadata about your database. These statements are specific to MySQL. Other database systems will have different statements for these functions. This lesson we'll use the scratch database, so here in Workbench I'll just type USE scratch. Now, if we want to see a list of databases available on this server connection, I can say SHOW databases. And again, this is specific to MySQL, but that'll give us a list of the databases available here. Now we have our album, scratch, and world databases, along with other system information databases which we're not concerned with for our purposes here. But within the scratch database, I can say SHOW tables and it'll give me a list of the tables in the scratch database. And so I have to use scratch in order to SHOW tables like that. If I want to see a description of the customer table, I can simply say, DESCRIBE customer, and this will give me information about the columns…

Contents