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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:48:37+00:00 2026-06-15T08:48:37+00:00

I got this example to work with some help on here: http://sqlfiddle.com/#!2/92e87/1 However, if

  • 0

I got this example to work with some help on here:

http://sqlfiddle.com/#!2/92e87/1

However, if I want to try and insert information for every child of the table, I cant seem to get it to work (using this code):

CREATE TABLE country (
    id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
    name varchar(255) NOT NULL
)
;

CREATE TABLE location (
    id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
    name varchar(255) NOT NULL,
    coordinate varchar(255) NOT NULL,
    country_id integer NOT NULL REFERENCES country (id)
)
;

CREATE TABLE item (
    id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
    title varchar(60) NOT NULL,
    description varchar(900) NOT NULL,
    date datetime NOT NULL,
    source varchar(255) NOT NULL,
    link varchar(255) NOT NULL,
    location_id integer NOT NULL REFERENCES location (id)
)
;

Insert Into item (title) values ('Title');
Insert Into item (description) values ('Description');
Insert Into item (date) values ('1995-12-31T23:59:59Z');
Insert Into item (source) values ('Source');
Insert Into item (link) values ('Link');
Insert Into item (location_id) values ('1');

Is this the correct way of doing this? Secondly, it tells me “description” doesnt have a default value, but does it need one if I will always be putting information into it?

Thank you for any help you can give

  • 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-15T08:48:38+00:00Added an answer on June 15, 2026 at 8:48 am
    Insert Into item (title, description, date, source, link, location_id) 
    values ('Title', 'Description','1995-12-31T23:59:59Z','source','Link',1);
    

    Each insert acts as inserting a new record. hence you need to combine all data into one insert statement as given above.

    The SQL asks for default value, because you have mentioned NOT NULL in the table definition which you have created.

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

Sidebar

Related Questions

I've placed panel from this example http://docs.sencha.com/ext-js/4-0/#!/example/dd/dnd_grid_to_grid.html to Ext.window.Window and got an issue: proxy
There is such function as bsxfun: http://www.mathworks.com/help/techdoc/ref/bsxfun.html however it work in element-by-element mode. I
First of all here is a jsFiddle example of my problem: http://jsfiddle.net/xJtAr/ I got
I have some URL which is in CP-1251 i believe. For example: http://domain.com/Test -
everyone, i have no idea why this doesn't work hopefully someone here can help
thank you for looking i got this example from my book but i cant
GridView CurrentGrid =Grd_UserList; Grd_UserList.Columns.Clear(); ı have got this example, ı use Columns.Clear(); fonc. with
For example I got this 2 table dbo.fc_states StateId Name 6316 Alberta 6317 British
I was trying to run a request factory example, but, I got this error
I got the example in this link . I can't understand the addmove ,

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.