Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 312505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:01:20+00:00 2026-05-12T08:01:20+00:00

I have a form on a website which has a lot of different fields.

  • 0

I have a form on a website which has a lot of different fields. Some of the fields are optional while some are mandatory. In my DB I have a table which holds all these values, is it better practice to insert a NULL value or an empty string into the DB columns where the user didn’t put any data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:01:20+00:00Added an answer on May 12, 2026 at 8:01 am

    By using NULL you can distinguish between “put no data” and “put empty data”.

    Some more differences:

    • A LENGTH of NULL is NULL, a LENGTH of an empty string is 0.

    • NULLs are sorted before the empty strings.

    • COUNT(message) will count empty strings but not NULLs

    • You can search for an empty string using a bound variable but not for a NULL. This query:

      SELECT  *
      FROM    mytable 
      WHERE   mytext = ?
      

      will never match a NULL in mytext, whatever value you pass from the client. To match NULLs, you’ll have to use other query:

      SELECT  *
      FROM    mytable 
      WHERE   mytext IS NULL
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database which has form authentication tables for an website [let say
I have a recruiter table in my database which has different attributes and one
Hi just looking for some direction, I have a HTML form which has several
On my website, I have a button which when clicked displays a feedback form
I had developed one website purely in HTML .I have my form with fields
I have a windows form application which has a text box and 3 buttons.
I have a website (my college website) for which each student has a username/password
I have Site A, which has a form on it. That passes the form
On a website if I have a form where the user can input some
We have in the company a asp.net website which has a pages that depends

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.