1.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 Visual Studio. 1. Open Visual Studio.

  1. Go to View, then click on "SQL Server Object Explorer."

  2. Click on "(localdb)\MSSQLLocalDB."

  3. Click on "Databases."

  4. Click on "SQL_Library."

  5. Click on the "New Query" icon (circled in purple in the screenshot below).

    • A new window will appear. This is where you will write your SQL query (green box).

    • When you are ready to run your query, click the green play button (circled in yellow).

    • Your query output will appear at the bottom of the screen (red box).

    • Make sure to click the blue arrow button (circled in aqua) every time you make a change to your database to refresh the view in your SQL Server Object Explorer window.

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

Last updated