Please note, this is a STATIC archive of website www.javatpoint.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
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