Search code examples
mysqldatabasedatabase-designdatabase-schema

Having questions as field name in database design


I was wondering if it ok to use a question as a field name or column on a table such as IsTheWetherNiceOutsite? is there any pros or cons, or is there any other way to archive this?


Solution

  • If I were you I'd avoid column names with special characters like ? in the table itself. Writing queries can get troublesome.

    But you can use column aliases if you want. For example,

    SELECT NOW() 'What time is it?',
           t.weatherNice 'Is the weather nice?'
      FROM table t