+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 13 of 13

Thread: Whats preferable in field - null or empty?

  1. #11
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    2,386
    Blog Entries
    5
    Real Name
    Wolff
    Rep Power
    15

    Just another 2 cents worth:

    As one example of where NULL might make sense would be something like as TestScore field in a table. In this case, NULL would indicate that a Student has not yet taken the test and thus a Score would be undefined. When using NULLs like this, aggregate functions like COUNT() and SUM() and AVERAGE() would work correctly whereas, if a value such as -1 was use, they would have some problems.

    Realize that (for strings at least) NULL and '' as symatically different -- use NULLable fields only when the 'no value' condition makes sense.
    Wolffy
    .-- ----- ..-. ..-. -.--
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Void where prohibited by law. Not valid in California. Your mileage may vary.

  2. #12
    Moderator don94403 is a jewel in the rough don94403 is a jewel in the rough don94403 is a jewel in the rough don94403's Avatar
    Join Date
    Mar 2008
    Location
    San Mateo, CA, USA
    Posts
    313
    Blog Entries
    8
    Real Name
    Don Ravey
    Rep Power
    6

    Quote Originally Posted by Wolffy View Post
    use NULLable fields only when the 'no value' condition makes sense.
    Precisely. In everyday life, we tend to think rather casually about the distinction between "No" and "no information", but in database design, we can't afford to be so casual. In many applications, it really makes a difference, and when it does, Nulls are essential.

  3. #13
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    Ok people, i think i get your point here.
    Nulls should be used where they should be

    thanx e1

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. validate empty textbox js
    By tulz in forum JavaScript Programming
    Replies: 1
    Last Post: February 11th, 2009, 06:13 AM
  2. show datagrid even if empty
    By micky in forum .NET Development
    Replies: 3
    Last Post: December 9th, 2008, 08:39 AM
  3. Replies: 3
    Last Post: November 18th, 2008, 03:16 AM
  4. Field that is a link (rs) and/or text field question
    By Rebelle in forum ASP Development
    Replies: 14
    Last Post: August 12th, 2008, 09:43 AM
  5. Replies: 8
    Last Post: June 17th, 2008, 10:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO