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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:13:31+00:00 2026-06-08T06:13:31+00:00

Create Table employees ( emp_id char(5) not null, hourly_pay integer not null, emp_name varchar(30)

  • 0
Create      Table       employees (
emp_id          char(5)         not null,
hourly_pay      integer         not null,
emp_name        varchar(30)     not null,
emp_address     varchar(50)     not null,
gender          char(1)         not null,
email           varchar(30)     null,
contact_info    integer         not null,
outlet_id       char(5)         null,
supervisor_id   char(5)         null,
job             varchar(15)     not null,
PRIMARY     KEY (emp_id)
FOREIGN     KEY (supervisor_id) 
REFERENCES  employees(emp_id)
)

Data as shown above. SQL Server 2008 keeps throwing up an error of “Incorrect syntax near the keyword ‘FOREIGN’.”

  • 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-08T06:13:34+00:00Added an answer on June 8, 2026 at 6:13 am

    You’re missing a comma.

    Create      Table       employees (
    emp_id          char(5)         not null,
    hourly_pay      integer         not null,
    emp_name        varchar(30)     not null,
    emp_address     varchar(50)     not null,
    gender          char(1)         not null,
    email           varchar(30)     null,
    contact_info    integer         not null,
    outlet_id       char(5)         null,
    supervisor_id   char(5)         null,
    job             varchar(15)     not null,
    
    PRIMARY     KEY (emp_id),
    ------------------------^
    
    FOREIGN     KEY (supervisor_id) REFERENCES  employees(emp_id)
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query like CREATE TABLE EMPLOYEE_TBL (EMP_ID CHAR(9) NOT NULL, EMP_NAME VARCHAR(40)
CREATE TABLE DEPARTMENTS (Department_Id varchar(5) Primary Key NOT NULL, Department_Name char(20) NOT NULL, Manager_Id
Given the following tables: CREATE TABLE Employees ( first_name VARCHAR(50) NOT NULL, last_name VARCHAR(50)
create table employee (emp_id smallint unsigned not null auto_increment, fname varchar(20) not null, lname
Create Table: CREATE TABLE `category` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255)
CREATE TABLE emp_u ( id INT NOT NULL AUTO_INCREMENT, emailAddress VARCHAR(100) NOT NULL, username
CREATE TABLE `tbl_atn` ( `atn_id` int(15) NOT NULL AUTO_INCREMENT, `eng_id` int(15) DEFAULT NULL, `visit`
create table ImagenesUsuario { idImagen int primary key not null IDENTITY } This doesn't
create table snippet( id int not null auto_increment, primary key(id), idlanguage int not null,
CREATE TABLE #TEMPTABLE ( requestTime datetime2, NoOfSessions integer ) INSERT INTO #TEMPTABLE select convert(nvarchar(16),

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.