﻿---
title: Creating Your First Table
---

Data Tables look very similar to spreadsheets in that the table can be visualized in rows and columns. Each row is an individual item and each column is a piece of information about that item.

When designing a database, you need to define what columns you are going to have. For our purposes here, we are going to make a data table that is going to hold articles or other little "blurbs" about our bookstore.  There were three:

* Title
* Description
* Active

The first table we are going to create is going to have columns for those three pieces of information as well as the date the article was written which will be put in automatically.

## Steps to Creating the Table
:::stepper
:::step 
In MySQL Workbench, connect to your UML database
:::
:::step
Expand the options under your name and you should see Tables
:::
:::step
Either Right-Click on Tables and choose Create Table or click on the Create Table Icon in the toolbar.
:::
:::step
In the Table Name, enter `articles`.&#x20;
:::
:::step
Add the columns id, title, description, createdDate, and status by filling out the column area according to this info:

| Field Name | Primary Key | Data Type | Auto Increment | Default Value |
|:---------- | :----------:| :-------: | :------------: | :---------: |
|id| YES | INT | YES | |
|title| NO | Nvarchar(100) | NO | |
|description| NO | nvarchar(1000) | NO | |
|createdDate| NO | datetime | NO | CURRENT_TIMESTAMP |

:::
:::step 
When submitted, the SQL should look something like this:

```sql title="MySQL query to create the articles table"
create table articles
(
    id int auto_increment,
    primary key(id),
    title       nvarchar(100)                      null,
    description nvarchar(1000)                     null,
    createdDate datetime default CURRENT_TIMESTAMP null
);
```

Click on Apply.
:::

:::step
Your table should appear under the Tables section in the left hand column.
:::
:::
