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 trialsaravanan p
4,766 PointsDatabase
How to create table using Primary key
1 Answer
Steven Parker
231,248 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