Neon integration on Vercel: Create a branch for every Preview DeploymentLearn More

Set up a Neon project and add data

The steps that follow describe how to sign up for Neon, create a Neon project, and create a table and insert data using the Neon SQL Editor. You are also introduced to the Tables feature, which allows explore your data from the Neon Console.

Create a Neon account

If you do not have a Neon account, navigate to the Neon sign-in page and create one using your GitHub or Google account.

When you sign up, you are automatically enrolled in Neon's Free Tier. If you require larger compute and storage limits, Neon also offers paid plans. For more information, see Neon plans.

Neon sign-in page

Create a project

After you sign in, click Create a project. Enter a name for your project or let Neon generate one for you. Select a PostgreSQL version and a region, and click Create project.

  • Neon supports both PostgreSQL 14 and 15. PostgreSQL 15 is the default.
  • Neon supports several regions. For more information, see Regions.

Neon create project

You may have noticed that your project was created in just a few seconds. That’s one of the benefits of Neon’s serverless architecture. Neon is serverless PostgreSQL that separates compute and storage. A Neon compute is a stateless PostgreSQL instance, which allows Neon to provision PostgreSQL very quickly.

Another benefit of Neon's serverless architecture is that Neon can scale compute resources to zero after a period of inactivity to save on compute costs. This feature, referred to as Auto-suspend, suspends a compute after five minutes of inactivity, by default.

If you navigate to the Branches page in the Neon Console, you can watch how a compute switches between Active and Idle states. Active means that the compute is running. Idle means that the compute is suspended.

Neon endpoint active

tip

The Branches widget on the Neon Dashboard also shows the state of your compute endpoints.

To learn more about Neon's serverless architecture, refer to the Neon architecture documentation.

Create a table

This tutorial uses a table called elements, which contains data from the periodic table. The example is based on the Neon with Next.js and Prisma application, which you can find in our examples repo on GitHub.

In the following steps, you will use the Neon SQL Editor to create the elements table. The SQL Editor allows you to query your databases directly from the Neon Console. For more information about this feature, see Query with Neon's SQL Editor.

To create the elements table:

  1. Navigate to the Neon Console.
  2. Select your project.
  3. Select SQL Editor from the sidebar.
  4. Select a branch and a database. This tutorial uses the main branch and the default neondb database that is created with each Neon project.
  5. Enter the following query into the editor and click Run or use the ⌘+Enter shortcut.
CREATE TABLE elements (
  id INTEGER NOT NULL,
  elementName TEXT NOT NULL,
  atomicNumber INTEGER NOT NULL,
  symbol TEXT NOT NULL
);

The editor should report that the request ran successfully.

Insert data

In this step, you will add data to the elements table. In the SQL Editor, click New Query to clear the editor, and run the following INSERT query to add data to your table:

INSERT INTO elements (id, elementName, atomicNumber, symbol)
VALUES
  (1, 'Hydrogen', 1, 'H'),
  (2, 'Helium', 2, 'He'),
  (3, 'Lithium', 3, 'Li'),
  (4, 'Beryllium', 4, 'Be'),
  (5, 'Boron', 5, 'B'),
  (6, 'Carbon', 6, 'C'),
  (7, 'Nitrogen', 7, 'N'),
  (8, 'Oxygen', 8, 'O'),
  (9, 'Fluorine', 9, 'F'),
  (10, 'Neon', 10, 'Ne');

To view the data that you added, you can use the Tables feature in the Neon console, which allows you to explore the data in your Neon databases.

Select Tables from the sidebar and select the elements table. The data you inserted should be visible.

Neon tables

Edit this page
Was this page helpful?