Sql#QueryBrowser

  • #1
T

tbu

Guest
Hi@all,
da ich für mein praktikum gerade dabei bin c# zu lernen, fange ich ersteinmal an mit SQL, da dies
die Grundlage dieses Projektes ist! Nun habe ich ein tutorial gefunden, welches mit dem Querybrowser sowie mysqlserver arbeitet! (Quelle: mysql.com).
Nun lautet, nachdem man mithilfe des queryb auf den server connectet hat und ein schema ausgewählt hat, die fehlermeldung:

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->artikelnummer integer not null default 0,
bezeichnung varchar(10) not null defa' at line 2

wenn man eine tabelle mithilfe von:

create table artikel
artikelnummer integer not null default 0,
bezeichnung varchar(10) not null default ,
einkaufspreis double not null default 0,
verkaufspreis double not null default 0,
primary key(artikelnummer)
)

anlegen will! ich verstehe leider nicht was daran nun falsch sein solle, vllt kann mir ja jm. helfen! thx schonmal!
 
  • #2
Hi,

versuch's mal damit:

create table artikel (
artikelnummer integer not null default->0',
bezeichnung varchar(10) not null default->',
einkaufspreis double not null default->0',
verkaufspreis double not null default->0',
primary key(artikelnummer)
)



Gruß
Sven
 
  • #4
wofuer ist eig die keydef am ende?
was bringt die?
der rest ist mir klar, tabelle mit spalten blubb blabb und furz wird angelegt aber....?!
 
  • #5
rox schrieb:
wofuer ist eig die keydef am ende?

A PRIMARY KEY is a unique index where all key columns must be defined as NOT NULL. If they are not explicitly declared as NOT NULL, MySQL declares them so implicitly (and silently). A table can have only one PRIMARY KEY. If you do not have a PRIMARY KEY and an application asks for the PRIMARY KEY in your tables, MySQL returns the first UNIQUE index that has no NULL columns as the PRIMARY KEY.

-->

Gruß
Sven
 
Thema:

Sql#QueryBrowser

ANGEBOTE & SPONSOREN

Statistik des Forums

Themen
113.839
Beiträge
707.962
Mitglieder
51.492
Neuestes Mitglied
Janus36
Oben