The database INFORMATION_SCHEMA contains the database metadata, information about the MySQL server such as the name of a database or table, the data type of a column, or access privileges. Other terms that are sometimes used for this information are data dictionary and system catalog.
To pull the column names of a MySQL Table, you will have to use the below query -
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'youtube'
AND TABLE_NAME = 'videoslist';
- Log in to post comments