473,378 Members | 1,142 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Problems creating tables.

Ive setup the MySQL server and am using heidi to create the tables, Ive had no trouble creating any new databases or certain tables.

But my problem im running into right now, im trying to create a tabel called customer_nfo with one variable for ID not null unsigned auto increment, then another with first_name not null.

ill post the code that heidisql posts

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE customer_info (ID MEDIUMINT (10) UNSIGNED DEFAULT '0' NOT NULL AUTO_INCREMENT)
  2. SELECT CONNECTION_ID()
  3. USE test
  4.  
But to no avail, kinda self teaching myself sql and its just the beginning im having problems with. Could anyone enlighten me on what I may be doing wrong,

Thanks,

Greg
Apr 6 '07 #1
2 1216
Hi

Once you are specifying the field as a Auto Increment Field then
U must have to specify that as a key field and u cannot set the default value for that field.

Here is the Syntax...

CREATE TABLE customer_info (ID MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY);



Thanks,
Scarlet.
Apr 6 '07 #2
Ah I see, but I can also apply other fields , ie first name or what not, or would i want to leave the auto increment field by itself in the table?
Apr 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Martin Gill | last post by:
I am a novice user of MySQL so please excuse my ignorance. I recently installed MySQL and have a third party tool using it to update data in a database. Recently it started creating erorr...
2
by: mb12036 | last post by:
All- Having a problem installing a DB2 client on a machine running AIX version 5.0. Client appeared to install one time succesfully, then was uninstalled and a reinstall was attempted. For...
2
by: Joseph Macari | last post by:
I recently installed Office2003 on my computer. I had imported (not linked) a couple of tables from an Access 2000mdb into an Access 2003mdb. I had composed various queries and forms with these...
1
by: news.microsoft.com | last post by:
I have used typed datasets by creating a Data Component (data.vb) by creating a new component in a vb or asp/vb.net project, dragging data tables onto the component, which generates the connection...
5
by: DeanL | last post by:
Hi all, I'm having a few problems with a shared access 97 db. I have the database split with the tables on the server and everything else in "client" front ends with links to the tables, e.g....
1
by: Ir0neagle | last post by:
I am generating upgrade/new install scripts for my project. I am able to do this in oracle and sql server but an running into problems in db2. What I am trying to do is to use some logic to only...
2
by: Iyhamid | last post by:
Hi Every 1 I have a big problem If any 1 can help me.... Here it is I am working on a access project for customers who have pos (point of sale machines). They do everyday transactions on those...
6
by: Wesley Peace | last post by:
I hate to cross post, but I've gotten no answer yet on a problem I'm having with visual studio 2008. I've created a series of forms with controls to access a Access database tables. The...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.