Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![saravanan p](https://secure.gravatar.com/avatar/4a8c18477d087a22c29a2ce2ebecd403?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
saravanan p
4,766 PointsDatabase
How to create table using Primary key
1 Answer
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsHere's a very generic example.
The syntax may vary slightly depending on which database you use, but for a generic example:
CREATE TABLE new_table
( Id int NOT NULL,
PRIMARY KEY (Id)
);
In future, if you name your database and/or provide a link to the course video or challenge, it would make a more specific answer possible.
Ken Alger
Treehouse TeacherKen Alger
Treehouse TeacherWe're going to need more information than that to be helpful. What database are you using? Does this revolve around a particular course or code challenge?
Please post back and I'm sure we can get you headed in the right direction.
Thanks,
Ken