How to Create Database Tables with SQL Updated on October 26, 2021 by Christopher Maiorana 1 Minutes, 29 Seconds to Read We have already learned what SQL is and how we can use basic select statements to get information out of our database. We can use that information we’ve selected to draw insights from potentially complicated databases. In this article, we’re going to learn how to create database tables with SQL. Remember that tables are basically database items that contain organized columns of data. In the article about select statements, we were working with a table called “respondents”. This table contained a vast list of people who had repsonded to an email campaign indicating that they would like to receive new emails. The columns of this table included a unique identification number for each respondent as well as their name, email, and IP address. In the following example we’re going to show you the code used to create the respondents table: CREATE TABLE respondents ( id INT, first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(50), ip_address VARCHAR(20) ); Notice, in the code block above, the first line starts the “CREATE TABLE” statement followed by open parenthesis. Each new line (followed by a comma) introduces the name of a new column in the table and what kind of “datatype” it will hold. For example, numbers can be held within an INT (integer) datatype. For the most detailed and expansive information about acceptable SQL datatypes you should check out the documentation provided by Oracle or various books about database administration. You now have a better understanding of the syntax and usage of the “create table” statement in SQL. And, you have an example of how this statmement is used in the wild. Be sure to leave a comment if you have any questions. If you’re looking for an all-in-one database solution, consider getting your own managed dedicated hosting for limitless resources and customization. Share this Article CM Christopher Maiorana Content Writer II Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog. More Articles by Christopher Related Articles How To Create a PHP Redirect (301, 302, and Dynamic Redirect Examples) Connect to SFTP for Shared Hosting Accounts Using FileZilla FTP Basics for Dedicated Servers How to Install Jekyll and Launch a New Site How to Host AI-Prompt Generated Websites on Shared Hosting What is your default PHP.ini file? Getting Started Guide: FTP Configuring your site in WS_FTP Schedule Social Media Posts With Buffer FTP Error – 421 Too Many Connections