Question

Create a procedure to update the sales history table following the requirements below. A table creation...

Create a procedure to update the sales history table following the requirements below. A table creation script is provided below.

a) Call the procedure: UPDATE_SALES_HISTORY (The procedure name is important for our scripts to test and grade your code; please do not rename it (otherwise our scripts will not run and your score will be 0).

b) The procedure takes 2 parameters: (4-digit-year, 2-digit-month). Both parameters will be numeric, e.g., (2019, 11) will denote 2019 (year) and November (month). The order of the parameters is important (you can name the parameters at your discretion).

c) If any of the following conditions hold, raise an application error (along with a custom error message decided by you) and exit the procedure:

o The year and month combination are in the future (e.g., any month in 2020 would be a future month). o The year is < 2016
o The month is not valid

d) The procedure should ensure that columns in the SALES_HISTORY table (except for the column: SV_Change_Previous_Month) are populated for each model in our database across all months in the provided year (up to and including the provided month). Do not re-run the procedure / over-write data for existing months. E.g., suppose data already exists in SALES_HISTORY up to (i.e., inclusive of) March 2019, and if we call the procedure as follows:
EXEC UPDATE_SALES_HISTORY (2019, 08);
Then the procedure should start with April 2019 and run through August 2019 (both months inclusive) and update sales history data for all models in the MODELS table. If data already exists through August 2019, raise an application error (with a custom error message) and exit the procedure.

e) To summarize, for each (model, year, month) combination, we should have the following statistics. As an example, let us consider Model-X for (2019, 3), i.e., sales_history for Model-X in March 2019 .

o Num_Sales: how many Model-X units (i.e., cars) were sold in March 2019. If there are no sales in March 2019, this is 0.

o YTD_Num_Sales: how many units (of Model-X) were sold in that year (2019) up to and including that month (March). Since this is March, the YTD would sum up data for January – March.

o Sales_Value: The dollar value of sales for Model-X in March 2019. If there are no sales in March 2019, this is 0.

o YTD_Sales_Value: The dollar value of sales for Model-X in the entire 2019 year up to March (in this case that's January - March).

Note: for simplicity, ignore SV_Change_Previous_Month column (if you want a [non-graded] challenge, you can populate this column with the change in sales value over the previous month. Note: if the current month is January 2019, then the previous month is December 2018).

SCRIPT:

drop table SALES_HISTORY;
drop table SALES;
drop table SERVICE;
drop table SALESPERSONS;
drop table MANAGERS;
drop table EMPLOYEES;
drop table CUSTOMERS;
drop table CUSTOMER_CATEGORIES;
drop table CARS;
drop table MODELS;

CREATE TABLE CUSTOMER_CATEGORIES
(
   Cust_Category char (5),
   Category_Name varchar2 (20),
Points_Required number (4),
Service_Discount number (4,3), -- percentage represented as decimal, e.g., 0.10 means 10% discount
CONSTRAINT cust_category_pk PRIMARY KEY (Cust_Category),
   CONSTRAINT service_discount_check CHECK (Service_Discount >= 0 and service_discount < 1.0)
);


CREATE TABLE CUSTOMERS
(
   Cust_ID char (7),
   Last_Name varchar2 (20),
First_Name varchar2 (20),
DOB DATE,
Annual_Income number (5),
Credit_Score number (3),
Cust_Category char (5),
Email VARCHAR2 (20),
City VARCHAR2 (20),
State char (2),
Zipcode char (5),
CONSTRAINT customers_pk PRIMARY KEY (Cust_ID),
   CONSTRAINT credit_check CHECK (Credit_Score <= 900),
FOREIGN KEY (Cust_Category) REFERENCES CUSTOMER_CATEGORIES (Cust_Category)
);

CREATE TABLE MODELS
(
   Model_ID char (3),
   Door_Type varchar2 (20),
Horse_Power number (3),
Engine_Type varchar2 (20),
Cylinders number (2),
isPremium number (1), -- recorded as 1 if premium, 0 otherwise
Sales_Rank number (2),
Model_Cost number (10,2),
CONSTRAINT models_pk PRIMARY KEY (Model_ID),
CONSTRAINT isPremium_Boolean CHECK (isPremium IN (1,0))
);

CREATE TABLE CARS
(
   Car_ID char (7),
   Color varchar2 (20),
Warranty_Expiry DATE,
Condition VARCHAR2 (20),
Model_ID char (3),
VIN VARCHAR2 (20),
CONSTRAINT cars_pk PRIMARY KEY (Car_ID),
   CONSTRAINT cars_vin_unq UNIQUE (VIN),
FOREIGN KEY (Model_ID) REFERENCES MODELS (Model_ID)
);


CREATE TABLE SERVICE
(
   Service_ID char (9),
   Service_Type varchar2 (20),
Service_Date DATE,
Car_ID char (7),
Cust_ID char (7),
Bill_Amount number (7,2),
Discount_Amount number (7,2),
Net_Bill_Amount number (7,2),
CONSTRAINT service_pk PRIMARY KEY (Service_ID),
FOREIGN KEY (Car_ID) REFERENCES CARS (Car_ID),
FOREIGN KEY (Cust_ID) REFERENCES CUSTOMERS (Cust_ID)
);


CREATE TABLE EMPLOYEES
(
   Emp_ID char (4),
   Designation varchar2 (20),
Lname varchar2 (20),
Fname varchar2 (20),
Hire_Date DATE,
CONSTRAINT emp_pk PRIMARY KEY (Emp_ID)
);


CREATE TABLE MANAGERS
(
   Manager_ID char (4),
   Highest_Degree_Earned varchar2(20),
Bonus_Eligible number (1), -- recorded as 0 if not eligible, 1 if eligible
CONSTRAINT Managers_pk PRIMARY KEY (Manager_ID),
FOREIGN KEY (Manager_ID) REFERENCES EMPLOYEES (Emp_ID),
CONSTRAINT Bonus_Eligible CHECK (Bonus_Eligible IN (1,0))
);


CREATE TABLE SALESPERSONS
(
   Salesperson_ID char (4),
   sQuota number (7),
Commission_Rate number (4,3),
YTD_Commission number (7),
Manager_ID char (4),
Bonus_Eligible number (1), -- recorded as 0 if not eligible, 1 if eligible
Contact varchar2(6), -- extension number
CONSTRAINT Salesperson_pk PRIMARY KEY (Salesperson_ID),
FOREIGN KEY (Salesperson_ID) REFERENCES EMPLOYEES (Emp_ID),
FOREIGN KEY (Manager_ID) REFERENCES Managers (Manager_ID),
   CONSTRAINT SP_comm_rate CHECK (Commission_Rate BETWEEN 0 AND 0.5 ),
CONSTRAINT SP_Bonus_Eligible CHECK (Bonus_Eligible IN (1,0))
);

CREATE TABLE SALES
(
   Sale_ID char (8),
   Emp_ID char (4),
Car_ID char (7),
Cust_ID char (7),
Sale_Date DATE,
Additional_Warranty number (1),
Sale_Amount number (10,2),
CONSTRAINT Sale_pk PRIMARY KEY (Sale_ID),
FOREIGN KEY (Emp_ID) REFERENCES SALESPERSONS (Salesperson_ID),
FOREIGN KEY (Car_ID) REFERENCES CARS (Car_ID),
FOREIGN KEY (Cust_ID) REFERENCES CUSTOMERS (Cust_ID),
CONSTRAINT Additional_Warranty CHECK (Additional_Warranty IN (1,0))
);


CREATE TABLE SALES_HISTORY
(
   Model_ID char (3),
   sYear number (4), -- year for which sales history data is being recorded
sMonth number (2), -- month for which sales history data is being recorded
Num_Sales number (6),
   YTD_Num_Sales number (6),
Sales_Value number (12,2),
   YTD_Sales_Value number (14,2),
SV_Change_Previous_Month number (12,2),
CONSTRAINT Sales_history_pk PRIMARY KEY (Model_ID,sYear,sMonth),
FOREIGN KEY (Model_ID) REFERENCES Models (Model_ID)
);


insert into customer_categories values ('CAT01','ELITE',100,0.2);
insert into customer_categories values ('CAT02','PROFESSIONAL',50,0.1);
insert into customer_categories values ('CAT03','REGULAR',0,0); -- Default Category

insert into customers values ('C000001','Johnson','Anthony','06-Jun-1994',90000,830,'CAT02','[email protected]','Tucson','AZ','85719');
insert into customers values ('C000002','Hart','Eve','12-Dec-1980',70000,799,'CAT01','[email protected]','Phoenix','AZ','85001');
insert into customers values ('C000003','Klein','Rebecca','01-Jan-1990',61000,720,null,'[email protected]','Irvine','CA','92606');
insert into customers values ('C000004','Schneider','Mike','18-Jul-1989',42000,740,'CAT03','[email protected]','Fremont','CA','94555');

insert into models values ('M01','2D',500,'V_engine',8,1,1,55000);
insert into models values ('M02','4D',300,'Inline',6,0,2,30000);
insert into models values ('M03','4D',110,'Inline',4,0,3,18000);

insert into cars values ('CA00001','red',add_months(trunc(sysdate),-34+24+mod(extract(day from sysdate),12))-1,'New','M02','P123');
insert into cars values ('CA00002','blue',add_months(trunc(sysdate),-22+12+mod(extract(day from sysdate),12))-1,'New','M03','P234');
insert into cars values ('CA00003','white',add_months(trunc(sysdate),-21+24+mod(extract(day from sysdate),12))-1,'New','M01','L123');
insert into cars values ('CA00004','red',add_months(trunc(sysdate),-10+12+mod(extract(day from sysdate),12))-1,'New','M02','L234');
insert into cars values ('CA00005','blue',null,'Used','M03','M987');
insert into cars values ('CA00006','white',null,'New','M02','L345');


insert into service values ('S00000001','Routine','02-May-2019','CA00001','C000004',250,25,225);
insert into service values ('S00000002','Routine','11-Aug-2019','CA00002','C000002',500,100,400);
insert into service values ('S00000003','Accident','04-Sep-2019','CA00003','C000001',7000,700,6300);
insert into service values ('S00000004','Routine','17-Oct-2019','CA00001','C000004',1000,0,1000);

insert into employees values ('E001','Salesperson','Wildcat','Wilma','01-Jan-2016');
insert into employees values ('E002','Salesperson','Wildcat','Wilbur','02-Jan-2016');
insert into employees values ('E003','Salesperson','Doe','John','03-Jan-2017');
insert into employees values ('E004','Salesperson','Doe','Jane','14-Jun-2018');
insert into employees values ('E005','Manager','Clark','Kent','03-May-2016');
insert into employees values ('E006','Manager','Prince','Diana','07-Aug-2015');
insert into employees values ('E007','Salesperson','Allen','Barry','07-Jan-2016');

insert into managers values ('E005','MBA',0);
insert into managers values ('E006','MS Marketing',0);

insert into SALESPERSONS values ('E001',30000,0.01,null,'E005',0,'1234');
insert into SALESPERSONS values ('E002',60000,0.015,null,'E005',0,'2345');
insert into SALESPERSONS values ('E003',90000,0.02,null,'E005',0,'3456');
insert into SALESPERSONS values ('E004',50000,0.015,585,'E006',0,'5678');
insert into SALESPERSONS values ('E007',35000,0.01,null,'E006',0,'1245');

insert into sales values ('SA000001','E001','CA00001','C000004',add_months(trunc(sysdate),-34+mod(extract(day from sysdate),12)),1,36000);
insert into sales values ('SA000002','E002','CA00002','C000002',add_months(trunc(sysdate),-22+mod(extract(day from sysdate),12)),0,25000);
insert into sales values ('SA000003','E003','CA00003','C000001',add_months(trunc(sysdate),-21+mod(extract(day from sysdate),12)),1,70000);
insert into sales values ('SA000004','E004','CA00004','C000003',add_months(trunc(sysdate),-10+mod(extract(day from sysdate),12)),0,39000);

commit;


select * from SALES_HISTORY;
select * from SALES;
select * from SERVICE;
select * from SALESPERSONS;
select * from MANAGERS;
select * from EMPLOYEES;
select * from CUSTOMERS;
select * from CUSTOMER_CATEGORIES;
select * from CARS;
select * from MODELS;

--------------------Testing--------------------
set serveroutput on;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CREATE OR REPLACE PROCEDURE UPDATE_SALES_HISTORY

   (saleyear IN number,

   salemonth IN number)

IS

   lasthistorymonth number;

   lasthistorymonthloop number;

   ytdnumsalestilllastmonth number(6);

   ytdsalesvaliuetilllastmonth number(14, 2);

   l_exst number;

   modelid char(3);

   cursor carmodel is SELECT Model_ID FROM Models;

BEGIN

    -- Validate year for future date

    -- Any month in the current year also invalid

    IF saleyear >= extract(year from sysdate) THEN

        raise_application_error(-20001,'Year cannot be current or furture year');

        RETURN;

    END IF;

   

    -- If the year is less than 2016

    IF saleyear < 2016 THEN

        raise_application_error(-20001,'Year cannot be less than 2016');

        RETURN;

    END IF;

   

    -- IF Month is invalid

    IF salemonth < 0 OR salemonth > 12 THEN

        raise_application_error(-20001,'Invalid month passed');

        RETURN;

    END IF;

   

    -- Get the last history month for the given year

    lasthistorymonth := 0;

    SELECT MAX(sMonth) INTO lasthistorymonth FROM SALES_HISTORY WHERE sYear = saleyear;

   

    -- If record exists for the given month, then raise an application error

    IF lasthistorymonth >= salemonth THEN

        raise_application_error(-20001,'History record already exists for the given month');

        RETURN;

    END IF;

   

    lasthistorymonth := lasthistorymonth +1;

   

    IF lasthistorymonth is null then

      lasthistorymonth := 1;

      DBMS_OUTPUT.PUT_LINE('it is null');

    END IF;

           

    -- Open the cursor for each model

    OPEN carmodel;

    LOOP

        DBMS_OUTPUT.PUT_LINE('lasthistorymonth' || lasthistorymonth);

        

      

        -- Fetch model id from models table

        FETCH carmodel INTO modelid;

        EXIT WHEN carmodel%NOTFOUND;

       

        lasthistorymonthloop := lasthistorymonth;

       

      

        

         -- till given month

        WHILE lasthistorymonthloop <= salemonth

        LOOP

            DBMS_OUTPUT.PUT_LINE(lasthistorymonthloop);

             -- if do not have previous data

            BEGIN

                SELECT YTD_Num_Sales, YTD_Sales_Value INTO ytdnumsalestilllastmonth, ytdsalesvaliuetilllastmonth

                FROM SALES_HISTORY WHERE sYear = saleyear AND sMonth = (lasthistorymonthloop-1)

                AND Model_ID = modelid;

            EXCEPTION WHEN NO_DATA_FOUND THEN

                ytdnumsalestilllastmonth := 0;

                ytdsalesvaliuetilllastmonth := 0;

            END;

           

            

            BEGIN

                 SELECT

                        COUNT(*) INTO l_exst

                    FROM MODELS mo

                    LEFT JOIN CARS ca ON ca.Model_ID = mo.Model_ID

                    LEFT JOIN SALES sa ON ca.Car_ID = sa.Car_ID

                    WHERE extract(year from Sale_Date) = saleyear

                        AND extract(month from Sale_Date) = lasthistorymonthloop

                        AND mo.Model_ID = modelid

                    GROUP BY mo.Model_ID;

           

                INSERT INTO SALES_HISTORY(Model_ID, sYear, sMonth, Num_Sales, YTD_Num_Sales, Sales_Value, YTD_Sales_Value)

                    SELECT

                        mo.Model_ID AS Model_ID,

                        saleyear AS sYear,

                        lasthistorymonthloop AS sMonth,

                        COUNT(*) AS Num_Sales,

                        COUNT(*) + ytdnumsalestilllastmonth AS YTD_Num_Sales,

                        SUM(Sale_Amount) AS Sales_Value,

                        SUM(Sale_Amount) + ytdsalesvaliuetilllastmonth AS YTD_Sales_Value

                    FROM MODELS mo

                    LEFT JOIN CARS ca ON ca.Model_ID = mo.Model_ID

                    LEFT JOIN SALES sa ON ca.Car_ID = sa.Car_ID

                    WHERE extract(year from Sale_Date) = saleyear

                        AND extract(month from Sale_Date) = lasthistorymonthloop

                        AND mo.Model_ID = modelid

                    GROUP BY mo.Model_ID;

            EXCEPTION WHEN NO_DATA_FOUND THEN

                DBMS_OUTPUT.PUT_LINE('Here in the exception');

           

                    INSERT INTO SALES_HISTORY(Model_ID, sYear, sMonth, Num_Sales, YTD_Num_Sales, Sales_Value, YTD_Sales_Value)

                    SELECT

                        mo.Model_ID AS Model_ID,

                        saleyear AS sYear,

                        lasthistorymonthloop AS sMonth,

                        0 AS Num_Sales,

                        ytdnumsalestilllastmonth AS YTD_Num_Sales,

                        0 AS Sales_Value,

                        ytdsalesvaliuetilllastmonth AS YTD_Sales_Value

                    FROM MODELS mo

                    WHERE mo.Model_ID = modelid

                    GROUP BY mo.Model_ID;

            END;

           

            lasthistorymonthloop := lasthistorymonthloop + 1;

        END LOOP;

    END LOOP;

    CLOSE carmodel;

   

END;

Sample Run:

After executing:

EXEC UPDATE_SALES_HISTORY (2019, 05);

EXEC UPDATE_SALES_HISTORY (2019, 09);

1 SELECT * FROM Sales_history ме2 2018 Введе e2 2018 Введе 2 2018 Введе не2 2018 Ввеее мез 2018 2013 2018 2018 2018 2018 2018

******************************************************************************

Feel free to rate the answer and comment your questions, if you have any.

Please upvote the answer and appreciate our time.

Happy Studying!!!

******************************************************************************

Add a comment
Know the answer?
Add Answer to:
Create a procedure to update the sales history table following the requirements below. A table creation...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MICROSOFT SQL SERVER - Create the following views 1.List the employee assigned to the most projects...

    MICROSOFT SQL SERVER - Create the following views 1.List the employee assigned to the most projects 2.List the project with the most hours SCRIPT TO BUILD DATABASE create table department ( dept_ID int not null , dept_name char(50) NOT NULL, manager_ID int not null, manager_start_date date not null, constraint Dept_PK primary key (dept_ID), constraint D_Name_AK unique (dept_name) ); insert into department values(1,'abc',1,'2019-01-08'); insert into department values(2,'abc2',2,'2019-01-08'); insert into department values(3,'abc3',2,'2019-01-08'); insert into department values(4,'abc4',2,'2019-01-08'); /*project table done*/ create table project...

  • drop table department cascade constraints; create table department ( Dname   varchar2(15)   not null, Dnumber int   not...

    drop table department cascade constraints; create table department ( Dname   varchar2(15)   not null, Dnumber int   not null, Mgr_ssn   char(9)   not null, mgr_start_date   Date, primary key (Dnumber), Unique    (Dname)); insert into DEPARTMENT values ('Research', '5', '333445555', '22-May-1988'); insert into DEPARTMENT values ('Administration', '4', '987654321', '01-Jan-1995'); insert into DEPARTMENT values ('Headquarters', '1', '888665555', '19-Jun-1981'); drop table employee cascade constraints; create table employee ( Fname   varchar2(15) not null, Minit   char(1), Lname   varchar2(15) not null, Ssn   char(9), Bdate   date, Address   varchar2(30), Sex   char(1),...

  • Provide the syntax answers for the following script, doesn't matter what table or columns. CREATE TABLE...

    Provide the syntax answers for the following script, doesn't matter what table or columns. CREATE TABLE customer (c_id NUMBER(5), c_last VARCHAR2(30), c_first VARCHAR2(30), c_mi CHAR(1), c_birthdate DATE, c_address VARCHAR2(30), c_city VARCHAR2(30), c_state CHAR(2), c_zip VARCHAR2(10), c_dphone VARCHAR2(10), c_ephone VARCHAR2(10), c_userid VARCHAR2(50), c_password VARCHAR2(15), CONSTRAINT customer_c_id_pk PRIMARY KEY (c_id)); CREATE TABLE order_source (os_id NUMBER(3), os_desc VARCHAR2(30), CONSTRAINT order_source_os_id_pk PRIMARY KEY(os_id)); CREATE TABLE orders (o_id NUMBER(8), o_date DATE, o_methpmt VARCHAR2(10), c_id NUMBER(5), os_id NUMBER(3), CONSTRAINT orders_o_id_pk PRIMARY KEY (o_id), CONSTRAINT orders_c_id_fk FOREIGN...

  • I need help with the following SQL query for a company database (script given below). The...

    I need help with the following SQL query for a company database (script given below). The name of the Department. The number of employees working in that department. The number of different projects controlled by this department. The name of the project controlled by this department that has the maximum number of employees of the company working on it. The number of the above project. The cumulative sum of the number of employees of the company working on the projects...

  • I need help for SQL homework. the question: the code for part 1,2: drop table Customer;...

    I need help for SQL homework. the question: the code for part 1,2: drop table Customer; drop table Company; drop table Cruise; drop table TravelAgent; drop table Reservation; drop sequence customerID_seq; drop sequence cruiseID_seq; drop sequence travelAgentID_seq; drop sequence reservationID_seq; create table Customer( customerID number, firstName varchar2(15), lastName varchar2(15), address varchar2(30), phone number(10) not null, age number(3), Constraint Customer_PK Primary Key (customerID), constraint Customer_unique unique (firstName,lastName,phone), constraint Customer_check check(phone is not null) ); create sequence customerID_seq start with 1 increment...

  • Here is the P4 university database ---Drop tables --Drop Table FACULTY Cascade Constraints; --Drop Table OFFERING...

    Here is the P4 university database ---Drop tables --Drop Table FACULTY Cascade Constraints; --Drop Table OFFERING Cascade Constraints; --Drop Table STUDENT Cascade Constraints; --Drop Table COURSE Cascade Constraints; --Drop Table ENROLLMENT Cascade Constraints; Create Table STUDENT( Std_ID NUMBER(3) Constraint Student_STD_ID_FK PRIMARY KEY, Std_FN Varchar2 (9), Std_LN Varchar2 (8) , Std_City Varchar2 (10), Std_State Varchar2 (4), Std_Zip Number (5), Std_Major Varchar2 (6), Std_Class Varchar2 (3), Std_GPA NUMBER (3,2)); ---Insert records into Student Insert Into STUDENT Values( 101, 'Joe', 'Smith','Eau Clare','WI',18121,'IS','FR',3.8); Insert...

  • Still working on SQL, but now trying to run some commands to pull data from the...

    Still working on SQL, but now trying to run some commands to pull data from the databases. The last 3 statements Im getting errors but I am not sure how to fix them. What do I need to do differently to those statements to make it work? create table Employee( EmpID char(10), Name varchar2(50), Salery char(10), Address varchar2(50), HireDate date, Phone char(10), Primary key(EmpID)) ; create table Inventory( ProductID char(10), ProductName varchar2(50), UnitPrice char(10), CurrentInventory char(10), MonthlySales char(10), PrecentOfPrice char(10),...

  • -- drop tables DROP TABLE REQUEST CASCADE CONSTRAINTS; DROP TABLE FULLORDER CASCADE CONSTRAINTS; DROP TABLE PRODUCT...

    -- drop tables DROP TABLE REQUEST CASCADE CONSTRAINTS; DROP TABLE FULLORDER CASCADE CONSTRAINTS; DROP TABLE PRODUCT CASCADE CONSTRAINTS; DROP TABLE CUSTOMER CASCADE CONSTRAINTS; -- create and link tables CREATE TABLE CUSTOMER (    CustomerID   INTEGER,    Name       VARCHAR2(40),    City       VARCHAR2(20),    State       CHAR(2),    Zip       CHAR(5),    CONSTRAINT PK_CUSTOMER        PRIMARY KEY (CustomerID) ); CREATE TABLE PRODUCT (    ProductID   INTEGER,    Description   VARCHAR2(30),    Material   VARCHAR2(20),    Price       NUMBER(5,2),    CONSTRAINT PK_PRODUCT...

  • I try to insert data into one of the table causes but I got an error...

    I try to insert data into one of the table causes but I got an error message, I don't know how to resolve this SQL> CREATE TABLE Causes(cid NUMBER(5) PRIMARY KEY, name VARCHAR2(20) REFERENCES Signup, problem VARCHAR2(256), location VARCHAR2(200),fund NUMBER(30)); Table created. SQL> CREATE TABLE Causes(cid NUMBER(5) PRIMARY KEY, name VARCHAR2(20) REFERENCES Signup, problem VARCHAR2(256), location VARCHAR2(200),fund NUMBER(30)); Table created. SQL> describe Signup; Name                                      Null?    Type ----------------------------------------- -------- ---------------------------- USERNAME                                  NOT NULL VARCHAR2(50) PASSWORD                                           VARCHAR2(50) NAME                                      NOT NULL VARCHAR2(100) AGE                                               ...

  • An online company sells hundreds of office supply products on its e-Commerce store. It has asked...

    An online company sells hundreds of office supply products on its e-Commerce store. It has asked you to design and implement a sales order processing system which will be used by users in our Operations department to process sales orders. Here is an overview of the sales order process. Customers make purchases by placing orders. Each customer has a customer number and profile (such as name, shipping address). To simplify the matter, each time an order is placed, only one...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT