This article contains the SQL
CREATE TABLE syntax, as implemented by various database management systems (DBMSs). The syntax is listed exactly as each vendor has listed it on their website. Click on the applicable link to view more detail about the syntax for a particular vendor.
The DBMSs covered are MySQL, SQL Server, PostgreSQL, and Oracle Database.
This article is Part 1 of the Microsoft Access tutorial.
Here’s what’s included in this article:
- Create a database.
- Add a table to the database.
- Add four fields to the table, name/rename them, and set up their data type.
To create a table in the MySQL Workbench GUI:
- Under the appropriate database in the left navigation pane, right-click Tables and select Create Table...
- Enter the table name, add all column names, their data type, constraints, default values, and any other details as required, then click Apply
- Review the SQL statement that will be run against the database and click Apply
The table will now be created, and a message will display advising that the script was successful.
To create a table in SQL Server using the GUI:
- Ensuring that the right database is expanded in Object Explorer, right click on the Tables icon and select Table... from the contextual menu
- A new table will open in Design view. Add the columns, their data types, and column properties.
- Save the table (either from the File menu, or by right-clicking on the table tab and selecting Save Table1)
The table will appear in the Object Explorer under the Tables icon for the applicable database.
To create a table in Microsoft Access 2013 or 2016:
- Click CREATE from the Ribbon
- Click Table
Here’s what that button looks like on the Ribbon:
Clicking the “Table” icon from the “CREATE” tab creates a new table.
Those two steps create a blank table.
Once you’ve created your table, you will need to add fields (these will contain the data). You will also need to specify the type of data that the fields will contain (eg, text, number, date, etc).
You can also add extra rules about the type of data that can be entered into each field (eg, that phone numbers should be entered this way, dates should be entered that way, etc), as well as other properties for each field.