Jump to content

Recommended Posts

when i put this in phpmyadmin i get errors... can anyone look over it and find a mistake..

 

CREATE TABLE Student {

SID int NOT NULL default,
SNAME varchar(200) NOT NULL default,
ADDRESS text NOT NULL default,
POST_CODE varchar(10) NOT NULL default,
PHOTO mediumblob NOT NULL default,

Primary Key (SID)


} ENGINE=INNODB



CREATE TABLE Course {

CID int NOT NULL default,
CNAME varchar(200) NOT NULL default,
DEPARTMENT text NOT NULL default,

Primary Key (CID)

} ENGINE=INNODB


CREATE TABLE Student-Course {
SID int NOT NULL default,
CID int NOT NULL default,
GRADE varchar(200) NOT NULL default,
COMMENTS text NOT NULL default,

Primary Key (SID,CID),
FOREIGN KEY (CID) REFERENCES Course (CID)  ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (SID) REFERENCES Student (SID) ON UPDATE CASCADE ON DELETE CASCADE
} ENGINE=INNODB

Link to comment
https://forums.phpfreaks.com/topic/223335-help-with-mysql-table-structure/
Share on other sites

CREATE TABLE Student{SID int( 8 ) NOT NULL AUTO_INCREMENT ,
SNAME varchar( 200 ) NOT NULL default,
ADDRESS text NOT NULL default,
POST_CODE varchar( 10 ) NOT NULL default,
PHOTO mediumblob NOT NULL default,
PRIMARY KEY ( SID ) } ENGINE = INNODB;

 

for this i get this error

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{ SID int(8) NOT NULL auto_increment, SNAME varchar(200) NOT NULL default, ' at line 1

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.