Javatpoint Logo
Javatpoint Logo

CREATE Table

In MariaDB, CREATE TABLE statement is used to create table within a selected database.

Syntax:

You can also specify a column_name as primary_key which must be a NOT NULL.

Example:

Create a table "Students" within "Javatpoint" database.

Mariadb Create table 1

Show tables

You can verify that whether the table is created by using SHOW TABLES command.

Output:

Mariadb Create table 2

Here you can see the created table "students".

See the table structure:

Mariadb Create table 3

Another way to create table

Go to selected database and right click.

Mariadb Create table 4

Click on table, you will see like this:

Mariadb Create table 5

Create a table "Students".

Mariadb Create table 6

You can add other options like:

Mariadb Create table 7

To add indexes:

Mariadb Create table 8

To add Foreign Key:

Mariadb Create table 9

Create code:

Mariadb Create table 10
Next TopicMariaDB Drop Table





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA