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 9174219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:43:03+00:00 2026-06-17T16:43:03+00:00

CREATE TABLE `test` ( `id` INT(10) UNSIGNED NOT NULL, `c1` VARCHAR(60) NULL DEFAULT NULL,

  • 0
CREATE TABLE `test` (
`id` INT(10) UNSIGNED NOT NULL,
`c1` VARCHAR(60) NULL DEFAULT NULL,
`c2` VARCHAR(60) NOT NULL,
PRIMARY KEY (`id`)
 )

In the information_schema.columns.COLUMN_DEFAULT contains NULL for both c1,c2 columns but c2 doesn’t have default value.

How to get the real COLUMN_DEFAULT value?

  • 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-06-17T16:43:04+00:00Added an answer on June 17, 2026 at 4:43 pm

    In information_schema.columns, if COLUMN_DEFAULT is NULL and IS_NULLABLE is NO then it doesn’t have a default.

    But basically you can see it as: the default, if not specified, is always NULL. So, c2 isn’t allowed to be NULL, but it will default to NULL, thus will always need to be specified on insert statements.

    Note: a field specified as NOT NULL doesn’t need to be able to represent NULL, thus it can theoretically take up (slightly) less space.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a table having create table test(id int not null primary key, day
Table: CREATE TABLE `test` ( `uid` int(11) unsigned NOT NULL AUTO_INCREMENT, `rating` smallint(5) unsigned
There is the table: CREATE TABLE `deal_keyword` ( `deal_id` int(11) unsigned NOT NULL default
When I'm adding some constraints, e.g: create table Test( IDTest int primary key, Credit
I have those tables CREATE TABLE [Test]( [Id] [int] NOT NULL, [Value] [int] NOT
Assume I've got the table: CREATE TABLE test ( ID INT AUTO_INCREMENT PRIMARY KEY,
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
Any idea how to get test_trigger working? Create table test ( book_id Int UNSIGNED
First the data: CREATE TABLE IF NOT EXISTS `calendar_events` ( `event_id` int(5) unsigned NOT
With this table: CREATE TABLE test_insert ( col1 INT, col2 VARCHAR(10), col3 DATE )

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.