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 trialBrian Bush
4,398 Pointscant figure out what im doing wrong?
Create a genres table called "tgenres" with an auto incrementing primary key called "pkid" and a unique column called "ukname" that can't be null. The "ukname" is a varchar of up to 45 characters.
and this is what typed
CREATE TABLE tgenres (pkid AUTO_INCREMENT PRIMARY KEY, ukname VARCHAR(45) NOT NULL UNIQUE KEY);
I even tried adding the INTEGER like this
CREATE TABLE tgenres (pkid INTEGER AUTO_INCREMENT PRIMARY KEY, ukname VARCHAR(45) NOT NULL UNIQUE KEY);
2 Answers
Michael Garcia
7,752 PointsDon't know if you still need the info, but this worked for me:
CREATE TABLE t_genres (pk_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, uk_name VARCHAR(45) NOT NULL UNIQUE KEY);
Bhawan Virk
20,615 Pointshow about try this one:
CREATE TABLE tgenres (pkid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ukname VARCHAR(45) NOT NULL UNIQUE KEY);
Brian Bush
4,398 PointsIt did not work either... I feel like their is a bug and nothing is working? Cause I feel like I have it entered correctly
Brian Bush
4,398 PointsBrian Bush
4,398 PointsI get this error if it helps any
ee28a200-5bb4-4770-bf3f-a1eb19ecd766.rb:38:in
eval': wrong number of arguments (at least 1) (ArgumentError) from (eval):11:in
<main>' from ee28a200-5bb4-4770-bf3f-a1eb19ecd766.rb:38:ineval' from ee28a200-5bb4-4770-bf3f-a1eb19ecd766.rb:38:in
<main>'