MySQL CREATE TABLE in PHPMyAdmin – with examples.

Found in cPanel, XAMPP, and similar environments, PHPMyAdmin is powerful interface, providing a visual MySQL working experience. I use PHPMyAdmin quite often in my day job, developing a LAMP stack application, and want to share some common, everyday uses. PHPMyAdmin beginners – like me – who continuously learn through online resources such as: blog posts, videos, and how-to tutorials will benefit the most from this post. Keep reading to see how you can utilize PHPMyAdmin to carryout CREATE TABLE commands…

icons on computer screen
Photo by Webaroo on Unsplash

If you enjoy the content written here, by all means, share this blog and your favorite post(s) with others who may benefit from or like it as well. Since coffee is my favorite drink, you can even buy me one if you would like!

The initial display for CREATE TABLE in PHPMyAdmin looks like this:

interface to create table in PHPMyAdmin
Create table with 6 columns in PHPMyAdmin

In this section, I choose the name of the table and how many columns it will have. In this example, I specify 6 columns for the ‘walking_stats’ table. You can add in additional columns, or take them away as you progress from here if desired.

However, I’ll move forward with the process by clicking the Go button, which proceeds to the next display.

In this display, all of the columns are defined. There are 12 Headers that comprise this structured interface, each representing a different aspect of the column definition. The Header labels are:

  • Name
  • Type
  • Length/Values
  • Default
  • Collation
  • Attributes
  • Null (check box)
  • Index
  • A.I. (check box for AUTO_INCREMENT
  • Comments
  • Virtuality
  • Move columns

PHPMyAdmin column definition and structure interface
Column data types and structure in PHPMyAdmin…

You can see, that all columns at the very least, are defined with:

  • A name
  • A Data type
  • A data type size/length – if applicable – (E.g., DECIMAL(4,2))

Notice I make the ‘day_walked’ column the PRIAMARY KEY for the ‘walking_stats’ table via the PRIMARY drop down under the INDEX heading. I have also included a COMMENT under the COMMENT heading for the ‘mph’ column, providing additional information about the data that particular column stores.

Just below this section are 5 additional choices:

  • Table comments:
  • Collation
  • Storage Engine
  • Partition by:
  • Partitions

I’ll keep Storage Engine: the default, InnoDB, and click the Save button, completing the CREATE TABLE process.

And creating a table in PHPMyAdmin. Pretty simple right?
In a future post, I’ll cover populating a table with data from a CSV file. Thanks for reading!

Like what you have read? See anything incorrect? Please comment below and thanks for reading!!!

A Call To Action!

Thank you for taking the time to read this post. I truly hope you discovered something interesting and enlightening. Please share your findings here, with someone else you know who would get the same value out of it as well.

Visit the Portfolio-Projects page to see blog post/technical writing I have completed for clients.

Have I mentioned how much I love a cup of coffee?!?!

To receive email notifications (Never Spam) from this blog (“Digital Owl’s Prose”) for the latest blog posts as they are published, please subscribe (of your own volition) by clicking the ‘Click To Subscribe!’ button in the sidebar on the homepage! (Feel free at any time to review the Digital Owl’s Prose Privacy Policy Page for any questions you may have about: email updates, opt-in, opt-out, contact forms, etc…)

Be sure and visit the “Best Of” page for a collection of my best blog posts.

Josh Otwell has a passion to study and grow as a SQL Developer and blogger. Other favorite activities find him with his nose buried in a good book, article, or the Linux command line. Among those, he shares a love of tabletop RPG games, reading fantasy novels, and spending time with his wife and two daughters.

Disclaimer: The examples presented in this post are hypothetical ideas of how to achieve similar types of results. They are not the utmost best solution(s). The majority, if not all, of the examples provided, is performed on a personal development/learning workstation-environment and should not be considered production quality or ready. Your particular goals and needs may vary. Use those practices that best benefit your needs and goals. Opinions are my own.

3 thoughts on “MySQL CREATE TABLE in PHPMyAdmin – with examples.

Hey thanks for commenting! Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.