Member-only story
SQL Creating Tables and Databases
In SQL we use commands to create and access information stored in tables that belong to a database. Think of tables as a container for holding related information. You can then think of a database as a repository or central location where similar tables exist.
This article will go over
- Creating a Database
- Creating a Table
- Inserting Data Into The Table
Creating a Database
Remember, a database is a central location where similar tables exist.
The command for this is simply CREATE DATABASE name_of_your_database
CREATE DATABASE name_of_your_database;
You would replace name_of_your_database with the name you would like your database to be called
See this example now
CREATE DATABASE TestLead;
This would create a database called TestLead
Creating a Table
Now let’s create a table for your database. You can have 1 or more tables in your database
CREATE TABLE name_of_your_table
(column1 dataType,
column2 dataType,