1nstan7 Posted February 28, 2015 Share Posted February 28, 2015 Well Did I do w3schoolhelp and overclock Right? CREATE TABLE W3schoolhelp (aircraft_code CHAR(5) primary key,HTML CHAR(20),);CREATE TABLE Overclock_test(purchase_order_no NUMBER(3) primary key,coding CHAR(4) not null,PC INT(4),CONSTRAINT f_coding FOREIGN KEY (coding}REFERENCES coder(coding) ); I'm not sure if I did the caps or if I missed anything?Also if you look at stackoverflow_help it has overclocking which is a primary key and a Forgien? How do I do that?Anyway all help is appreciated! Link to comment Share on other sites More sharing options...
justsomeguy Posted March 3, 2015 Share Posted March 3, 2015 The column names in the diagram don't match the SQL statements. I don't see much of a reason to have something be both a primary and a foreign key. If it is a primary key that means it's unique in the table. If it's a foreign key that means it's also in another table. If you have unique data like that then it can all go in one table. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now