Check the Schema of a table in MySQL Example

Let us look at an example, where we will check the schema of a table in MySQL.

First, let’s create a database and demo table.

Query:

CREATE DATABASE w3wikiDatabase;

USE w3wikiDatabase;

CREATE TABLE Geeks (
GeekID INTEGER PRIMARY KEY,
GeekName VARCHAR(255) NOT NULL,
GeekRank INTEGER NOT NULL,
GeekSchool VARCHAR(255) NOT NULL
);

Display the table structure (Schema) in MySQL

Here is the MySQL query to display the table schema

Query:

DESCRIBE w3wikiDatabase.Geeks;

Output:

Table Schema

How to Show Schema of a Table in MySQL Database?

A table schema in MySQL database defines the structure of table, including columns, data types, relationships between columns, etc. It is a blueprint for the table, describing how data is organized in the table and how it relates to other tables in the database.

To see the schema of a table in MySQL database, use the DESCRIBE command.

Similar Reads

How to Check Table Schema in MySQL Database

To check a table schema in MySQL, use the following command syntax:...

Check the Schema of a table in MySQL Example

Let us look at an example, where we will check the schema of a table in MySQL....

Check the Table Schema in Other DBMS

Here we have provided the query syntax to check table schema in other DBMS....