Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm having some serious issues in troubleshooting a CREATE TABLE command in Apex Oracle. The error message I'm receiving when I run the code below

I'm having some serious issues in troubleshooting a CREATE TABLE command in Apex Oracle.

The error message I'm receiving when I run the code below is "ORA-00907: missing right parenthesis"

I've spent hours at this point combing it over and rewriting it 100 different ways. Any advice would be super appreciated

CREATE TABLE Employee (

Employee_ID NUMBER(4),

Employee_LastName VARCHAR2(20) NOT NULL,

Employee_FirstName VARCHAR2(20) NOT NULL,

Employee_StreetAddress VARCHAR2(50) NOT NULL,

Employee_City VARCHAR2(20) NOT NULL,

Employee_State VARCHAR2(2) DEFAULT'CA' NOT NULL,

Employee_Zipcode NUMBER(5) NOT NULL,

Employee_PhoneNumber NUMBER(10) NOT NULL,

Employee_Email VARCHAR(40) NOT NULL,

Employee_HireDate Date,

Employee_Title VARCHAR(50) NOT NULL,

Employee_Salary NUMBER(7) NOT NULL,

Sales_Commission NUMBER(2),

SubTypeSalesPerson CHAR(1) NOT NULL CHECK (SubTypeSalesPerson IN ('Y','N')),

SubTypeServicePerson CHAR(1) NOT NULL CHECK (SubTypeServicePerson IN ('Y','N')),

SubTypeManager CHAR(1) NOT NULL CHECK (SubTypeManager IN ('Y','N')),

CONSTRAINT emp_empID_pk PRIMARY KEY (Employee_ID),

CONSTRAINT chk_commission_per CHECK (30 > Sales_Commission > 20),

UNIQUE (Employee_PhoneNumber, Employee_Email),

CONSTRAINT EntA_Attr_CK CHECK (

(SubTypeSalesPerson = 'Y' AND SubTypeServicePerson = 'N' AND SubTypeManager = 'N' AND Sales_Commission IS NOT NULL)

(SubTypeSalesPerson = 'N' AND SubTypeServicePerson = 'Y' AND SubTypeManager = 'N' AND Sales_Commission IS NULL)

(SubTypeSalesPerson = 'N' AND SubTypeServicePerson = 'N' AND SubTypeManager = 'Y' AND Sales_Commission IS NULL)

(SubTypeSalesPerson = 'Y' AND SubTypeServicePerson = 'Y' AND SubTypeManager = 'N' AND Sales_Commission IS NOT NULL)

(SubTypeSalesPerson = 'N' AND SubTypeServicePerson = 'Y' AND SubTypeManager = 'Y' AND Sales_Commission IS NULL)

(SubTypeSalesPerson = 'Y' AND SubTypeServicePerson = 'N' AND SubTypeManager = 'Y' AND Sales_Commission IS NOT NULL)

(SubTypeSalesPerson = 'Y' AND SubTypeServicePerson = 'Y' AND SubTypeManager = 'Y' AND Sales_Commission IS NOT NULL)

(SubTypeSalesPerson = 'N' AND SubTypeServicePerson = 'N' AND SubTypeManager = 'N' AND Sales_Commission IS NULL)

)

);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions