I am trying to create three tables however I am getting error as 

```
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 'REFERENCES personal_details(personID)
)'

```

The above error is for third table i.e. table `hobbies_person`.

I am creating tables as follow.

```
CREATE TABLE personal_details (
    personID   INT PRIMARY KEY,
    firstName  varchar(30),
    middleName varchar(30),
    lastName   varchar(30),
    age        INT,
    aboutMe    varchar(500)
);

CREATE TABLE hobbies (
    hobbID    INT PRIMARY KEY,
    hobbName  varchar(30)
);

CREATE TABLE hobbies_person (
    personID INT,
    hobbID   INT,
    PRIMARY KEY (personID, hobbID),
    FOREIGN KEY personID REFERENCES personal_details(personID)
);

```

I also tried with 

```
CREATE TABLE hobbies_person (
    personID INT,
    hobbID   INT,
    PRIMARY KEY (personID, hobbID),
    FOREIGN KEY personID REFERENCES personal_details(personID),
    FOREIGN KEY hobbID   REFERENCES hobbies(hobbID)
);

```

but still same error.

[Link to check query](http://sqlfiddle.com/#!2/417b4)
-----------------------------------------------------

Any idea how to tackle this?

NOTE
----

In table `hobbies_person` I am using **composite primary key** as `PRIMARY KEY (personID, hobbID),`