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

  • Home
  • SEARCH
  • 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 8932701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:22:20+00:00 2026-06-15T09:22:20+00:00

This is my schema: CREATE TABLE item ( id integer NOT NULL PRIMARY KEY

  • 0

This is my schema:

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

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

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

CREATE TABLE company (
    id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
    name varchar(60) NOT NULL,
);

CREATE TABLE source (
    id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
    name varchar(60) NOT NULL,
);

It is telling me that there is invalid syntax on line four on http://sqlfiddle.com when I put it in and click build schema. I can see no error, can anyone shed some light please?

Also if I have done anything poorly or made any bad decisions please let me know.

  • 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-15T09:22:21+00:00Added an answer on June 15, 2026 at 9:22 am

    You have 2 faulty commas. One at the end of “CREATE TABLE company”, “CREATE TABLE source”.
    And create country before location.

    CREATE TABLE company (
        id SERIAL PRIMARY KEY,
        name varchar(60) NOT NULL
    );
    
    CREATE TABLE country (
        id SERIAL PRIMARY KEY,
        name varchar(255) NOT NULL
    );
    
    CREATE TABLE location (
        id SERIAL PRIMARY KEY,
        name varchar(255) NOT NULL,
        coordinate varchar(255) NOT NULL,
        location_id integer NOT NULL REFERENCES country (id)
    );
    
    CREATE TABLE source (
        id SERIAL PRIMARY KEY,
        name varchar(60) NOT NULL
    );
    
    CREATE TABLE item (
        id SERIAL PRIMARY KEY,
        title varchar(60) NOT NULL,
        description varchar(900) NOT NULL,
        company_id integer NOT NULL REFERENCES company (id),
        date timestamp NOT NULL,
        source_id integer NOT NULL REFERENCES source (id),
        link varchar(255) NOT NULL,
        location_id integer NOT NULL REFERENCES location (id)
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming I have an SQL table with this schema: CREATE TABLE( foo INTEGER, bar
I have an orders table with a schema like this. CREATE TABLE orders (
I have a schema that essentially looks like this: CREATE TABLE `data` ( `id`
For some reason, this MySQL fails: CREATE SCHEMA IF NOT EXISTS `partB` DEFAULT CHARACTER
I've defined table with this schema : CREATE TABLE [dbo].[Codings] ( [Id] [int] IDENTITY(1,1)
I have a table that looks like this: Id (PK, int, not null) ReviewedBy
I currently have a table like this: Stuff ---------- StuffId identity int not null
I have a table that has this schema: create table mytable (creation_date timestamp, value
I have this in my schema: create_table robots_matches, :force => true do |t| t.integer
I created a table like this CREATE TABLE pull_dtl ( source_schema VARCHAR2(4000), source_tablename VARCHAR2(4000),

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.