Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Create a enum table and access it from other table in mysql

0

60 views

I have a table schema as follows:

[enumeration]

Status{

good, bad, high,low

}

Image{

id :string
name: string
quality : Status   

}

I have found that enum Table can be created as:

Create Table Status{ status enum ('good','bad','high','low') };

My question: Do i need to create a column for a table Status? How can i refer it in other table while creating a table schema?

asked March 21, 2011 2:35 pm CDT
posted via StackOverflow

1 Answers

0
 

You don't need a table for status. You declare a status enum column in your image table. Like so:

create table testo (status enum('foo', 'bar', 'baz'));
insert into testo(status) values('foo');

answered March 22, 2011 12:08 pm CDT

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions
Create table in hbase
February 22, 2011