i have a problem in choosing data type for this column in SQL..can anybody help me???

result (tournament_id*, player_id*, round)
i've done the first 2 columns, i'm confused about the data type of round=='...i wondered if it was cstring or text or numeric
here's my code :

tournament_id int,
    player_id int,
    PRIMARY KEY (tournament_id,player_id) REFERENCES tournament(id),player(id),
    round  ???

and the request is
The result round of a player at a tournament can be one of these values: ‘Won’, ‘Final’, ‘Semi’, ‘Quarter’, ‘4’, ‘3’, ‘2’ and ‘1 round’. Except for ‘Won’, the value denotes in which round of the tournament the player lost.

I'd use a linked table so you can use an id, but also show the string.

Hi Ken,

You can maintain separate master table to store the different types of round data that you want

EX:

RoundMaster
(
Round_id integer primary key,
Round varchar(100)
)

Then reference the Round column in result table with Round_id of type integer.

Hope this will solve your problem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.