elementsky Posted April 3, 2006 at 11:52 AM Report Share #20688 Posted April 3, 2006 at 11:52 AM CREATE TABLE `clientes` ( `Nome` VARCHAR( 4 ) UNSIGNED NOT NULL , `Morada` VARCHAR( 6 ) UNSIGNED NOT NULL , `Telefone` VARCHAR( 7 ) UNSIGNED NOT NULL , `Nº Contribuinte` VARCHAR( 15 ) UNSIGNED NOT NULL , `E-mail` VARCHAR( 6 ) UNSIGNED NOT NULL ) O que é que está mal aqui. P.S. é a minha primeira tentativa de bd em mysql O meu Blog:http://damnit.blogs.sapo.pt Link to comment Share on other sites More sharing options...
deathseeker25 Posted April 3, 2006 at 11:56 AM Report Share #20689 Posted April 3, 2006 at 11:56 AM Falta a chave-primária, isto é a PRIMARY KEY... 😛 Link to comment Share on other sites More sharing options...
elementsky Posted April 3, 2006 at 12:29 PM Author Report Share #20694 Posted April 3, 2006 at 12:29 PM inda vou ter k estudar esses conceitos poderias-me dizer o k significa esse ? O meu Blog:http://damnit.blogs.sapo.pt Link to comment Share on other sites More sharing options...
Dabubble Posted April 3, 2006 at 12:31 PM Report Share #20695 Posted April 3, 2006 at 12:31 PM a chave primaria de uma tabela (kk que seja o formato string ou numero) define uma caracteristica que tem de ser unica (nao pode ser igual em duas linhas) e que te permite identificar univocamente uma linha de uma tabela. Link to comment Share on other sites More sharing options...
pedrotuga Posted April 20, 2006 at 03:44 AM Report Share #23052 Posted April 20, 2006 at 03:44 AM o que te esta a dar erro é o facto de nao teres um ponto e virgula no fim em sql as instruções sao dadas por um ponto e virgula... assim sendo... CREATE TABLE `clientes` ( `Nome` VARCHAR( 4 ) UNSIGNED NOT NULL , `Morada` VARCHAR( 6 ) UNSIGNED NOT NULL , `Telefone` VARCHAR( 7 ) UNSIGNED NOT NULL , `Nº Contribuinte` VARCHAR( 15 ) UNSIGNED NOT NULL , `E-mail` VARCHAR( 6 ) UNSIGNED NOT NULL ) ; Link to comment Share on other sites More sharing options...
ouvi_dizer Posted April 20, 2006 at 12:22 PM Report Share #23080 Posted April 20, 2006 at 12:22 PM Nomes de campos e de tabelas (e seja do que for) não podem ter caracteres especiais, pontuação e espaços. Uma tabela não requer chaves (primarias ou estrangeiras) indices ou seja que propriedade adicional for. Procura por DDL(data definition language) para saberes mais sobre a criação de tabelas, triggers, stored procedures e afins (standard sql). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now