2.3: Create Table

Using the SQL_Library database, create a query that creates a table for Products. The table should have the following data:

Name

Type

Null?

ProductID

int/Primary Key

Not

ProductName

varchar(25)

Not

Price

money

Yes

ProductDescription

text

Yes

Below you will find a step-by-step guide to setting up a new query in pgAdmin. 1. Open pgAdmin.

  1. Click on the plus sign next to "Servers."

  2. Click on the plus sign next to the specific server where your the SQL_Library database is located.

  3. Enter the password for that server.

  4. Click on the plus sign next to "Databases."

  5. Right click on the SQL_Library database. A new menu will pop up.

  6. Click on "Query Tool." A new view will pop up on the right side of your pgAdmin screen. You can use to the screenshot below as a reference to see the initial format of this view. Since this view is customizable, your screen might not be identical to the view shown below.

    • Your SQL queries will be typed in the top half of the view (red box in screenshot).

    • Click the lightning bolt (circled in yellow) to run the query.

    • Your query output will be in the bottom half of the screen (green box).

To see the solution for this challenge, click on 2.12 Solutions. Then, continue to Part 2.4: Insert.

Last updated