Ecco cosa ho scritto:
create database if not exists test;
use test;
create table if not exists stanza (
id varchar (10) primary key,
piano numeric (1)
);
create table if not exists autore (
nome varchar (20),
cognome varchar (30),
cf char (16) primary key
);
create table if not exists opera (
nome varchar (20) primary key,
autore varchar (30) references autore(cf),
stanza varchar (10) references stanza (id),
foreign key (autore, stanza)
);
ricevo:
Error Code: 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 ')' at line 6
autore e stanza vengono creati....

Rispondi quotando
