List:GUI Tools« Previous MessageNext Message »
From:Kiskedee Date:May 8 2003 5:29pm
Subject:Why does data type change?
View as plain text  
Hi,
I'm learning SQL via "Teach Yourself SQL in 24 Hours" Sams, trust me, it'll 
be way more 
than 24 hours, :-) MySQL 4.1 and MySQLCC 0.9.2 (MCC) running on Win XP home 
ed.
I created a table, products_tbl, and it looked as expected in MCC, then I
created another table, products_tmp, based on the existing table. But..., 
when
I looked at it in MCC, two of the data types had changed and there was no 
primary key.
I tried it several times to be sure I wasn't typing the wrong command.
Is this normal? Anyone else notice this?
Thanks for your feedback.

Garth
"Sexism is Next to Racism"

Command:
create table products_tbl
(
Prod_ID    varchar(10)  not null  primary key,
Prod_Desc     varchar(40)  not null,
Cost              decimal(6,2) not null,);

Table: products_tbl
Prod_ID    varchar(10)  not null  pri
Prod_Desc     varchar(40)  not null
Cost              decimal(6,2) not null

Command:
create table products_tmp as
select * from products_tbl;

Table: products_tmp
Prod_ID    char(10)       not null
Prod_Desc     char(40)       not null
Cost              decimal(6,2) not null


Thread
Why does data type change?Kiskedee8 May
  • Re: Why does data type change?Adam Hooper9 May
Re: Why does data type change?Gearmorer20 May
  • Re: Why does data type change?Tracy Peterson21 May