Syntaxe de création de table
bonjour a tous,
je suis entrain de creer une base de donnees avec mysql j'utilise le wamp et j'arrive pas a executer la requete pour creer ma premiere table
voici ma requete:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| CREATE TABLE [dbo].[Collaborateur](
[identifiant] [bigint] IDENTITY(1,1) NOT NULL,
[nom] [nvarchar](50) COLLATE French_CI_AS NULL,
[prenom] [nvarchar](50) COLLATE French_CI_AS NULL,
[userid] [nvarchar](50) COLLATE French_CI_AS NULL,
[password] [nvarchar](50) COLLATE French_CI_AS NULL,
[travail] [nvarchar](50) COLLATE French_CI_AS NULL,
[tel] [nvarchar](50) COLLATE French_CI_AS NULL,
[mail] [nvarchar](50) COLLATE French_CI_AS NULL,
[id_entite] [bigint] NULL,
CONSTRAINT [PK_Collaborateur] PRIMARY KEY CLUSTERED
(
[identifiant] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
USE [Taxation]
GO
ALTER TABLE [dbo].[Collaborateur] WITH CHECK ADD CONSTRAINT [FK_Collaborateur_Entite] FOREIGN KEY([id_entite])
REFERENCES [dbo].[Entite] ([identifiant]) |
MySQL a répondu:
Citation:
#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 '[dbo].[Collaborateur](
[identifiant] [bigint] IDENTITY(1,1) NOT NULL,
[nom] ' at line 1
svp aidez moi a creer ma base de donnees
merci:D
declaration de clé etrangere
j'ai pu creer ma table mais j'ai une petite question si on a plusieurs clé etrangere comme dans cette table
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| CREATE TABLE appel(
identifiant BIGINT NOT NULL AUTO_INCREMENT ,
id_Poste BIGINT NULL ,
id_Telephone BIGINT NULL ,
id_Destinataire BIGINT NULL ,
date_debut DATETIME NULL ,
date_fin DATETIME NULL ,
type_jour_debut BIGINT NULL ,
type_jour_fin BIGINT NULL ,
duree BIGINT NULL ,
coutHT FLOAT NULL ,
coutTTC FLOAT NULL ,
CONSTRAINT PK_appel PRIMARY KEY ( identifiant ASC )
) ENGINE = INNODB |
mes clé entrangeres sont en GRAS comment je fais pour les definir???est ce que c'est obligatoir de les definir??
merci