SQL Question

i can never figure it out

Page 1 of 1

3 Replies - 1528 Views - Last Post: 22 May 2002 - 09:14 AM Rate Topic: -----

#1 iamcenz  Icon User is offline

  • You wish you were my hand!
  • member icon

Reputation: 7
  • View blog
  • Posts: 2,442
  • Joined: 26-March 01

SQL Question

Posted 10 May 2002 - 10:08 PM

how would i do in 1 database make this
a Table say called PS2
then make the feilds: reviews, previews, gamelist, cheats
but have each feild like the reviews have its own custom id# and stuff like that and same for previews
and then do this for the rest of the consoles. get what i am saying.
Is This A Good Question/Topic? 0
  • +

Replies To: SQL Question

#2 kaizix  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 12-March 02

Re: SQL Question

Posted 17 May 2002 - 05:47 PM

well, you wouldn't really need a custom id# since you use the field name for it. i don't see why you would have each field have an id# anyway. you could either make a table for each console or have one table for all consoles and have each field with a name of ps2_reviews, xbox_reviews, ngc_reviews and use those. depending on what the records held, if it was number of reviews or the text of a review, would change the attributes of each field.
Was This Post Helpful? 0
  • +
  • -

#3 malkiri  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 3
  • View blog
  • Posts: 364
  • Joined: 29-March 01

Re: SQL Question

Posted 17 May 2002 - 09:16 PM

I think I might understand what you want...assuming review, previews, gamelist, and cheats can all be the same data type (column names changed to fit your own style, of course):
Table game_info
info_id      integer
info_type_id integer
info_text    long varchar

Depending on what you use this data for, you might need another table that has the info_types listed (ie. "Review", "Preview", etc):
Table info_type:
info_type_id   integer
info_type_name varchar(50)

Does that help you?

Was This Post Helpful? 0
  • +
  • -

#4


Reputation: 0

Re: SQL Question

Posted 22 May 2002 - 09:14 AM

I think you probably want to make 4 fields as opposed to 3
id - autoinc int
info_type (a dynamic list from another table) int
(review, preview, cheat, etc.)
console_type (also a dynamic list from another table) int
(x-box, playstation II, etc.)
body - longtext

that way when you add new categories (links, resources etc.) or game platforms (x-box2, PS3, etc.) you just add a record to the associated table and your whole site is updated with no hassles and without having to rememebr all the places you used a select box that is now out of date.

Hoopster

Was This Post Helpful? 0

Page 1 of 1