+1 (208) 254-6996 [email protected]
  

In this assignment you will create the FINANCING_PLANS, SALES_FINANCINGS, and SALESPERSONS tables and fully populate them. You will not be creating the other tables in the ERD. 

You will be making up your own data and in many cases you will need to reuse the same customer, vehicle, and financing plan data for your sales. 

Don't use plagiarized sources. Get Your Custom Essay on
SQL 2
Just from $13/Page
Order Essay

Project 2 is based on Project 1 information —– sql script is attached 

You should use one or more SQL script files to complete this assignment. 

Here are the specific assignment steps. In order to earn full credit you must keep your steps in order, number your steps, and put everything in a single file. 

1) Create the FINANCING_PLANS table and populate it with at least 5 (five) rows of data. 

2) Add more rows as necessary to your VEHICLES table so that you have at least 50 (fifty) rows of data total. Execute a “SELECT COUNT(*) FROM vehicles” statement after you have added all your new data. Show the INSERT SQL statements you used and the SELECT COUNT(*) statement. 

3) Create the SALESPERSONS table and populate it with at least 10 (ten) rows of data. Add a Dealer_ID column but don’t set it as a foreign key to the DEALERSHIPS table yet since you won’t be creating that table until a later project. 

4) Add more rows as necessary to your CUSTOMERS table so that you have at least 100 (one hundred) rows of data total. Execute a “SELECT COUNT(*) FROM customers” statement after you have added all your new data. Show the INSERT SQL statements you used and the SELECT COUNT(*) statement. 

5) Add more rows as necessary to your SALES table so that you have at least 200 (two hundred) rows of data total. Execute a “SELECT COUNT(*) FROM sales” statement after you have added all your new data. Show the INSERT SQL statements you used and the SELECT COUNT(*). 

Project 2

In this assignment you will be completing the creation of most of the tables for the Online Vehicle Sales (OVS), Inc. online transaction processing (OLTP) database based on the supplied ERD, and fully populating all the tables you create. You will also be performing a number of queries against the populated tables.

Your OLTP tables will be populated with a large number of rows since this is intended to simulate a large number of transactions which will make the data warehouse you’ll create in later assignments more realistic.

In Assignment #1 you already created the CUSTOMERS, VEHICLES, and SALES tables based on the ERD, and populated them with a few rows of data. In this assignment you will create the FINANCING_PLANS, SALES_FINANCINGS, and SALESPERSONS tables and fully populate them. You will not be creating the other tables in the ERD.

You will be making up your own data and in many cases you will need to reuse the same customer, vehicle, and financing plan data for your sales.

For all six tables, unless otherwise specified, you must include all necessary integrity constraints including primary keys, foreign keys (except to tables not created), CHECK constraints, UNIQUE constraints, and NOT NULL constraints. It is good practice, but not required, to explicitly name your constraints.

You can create your database in UGMC’s Virtual Lab Broker.

You should use one or more SQL script files to complete this assignment.

Here are the specific assignment steps. In order to earn full credit you must keep your steps in order, number your steps, and put everything in a single file.

1) Create the FINANCING_PLANS table and populate it with at least 5 (five) rows of data.

2) Add more rows as necessary to your VEHICLES table so that you have at least 50 (fifty) rows of data total. Execute a “SELECT COUNT(*) FROM vehicles” statement after you have added all your new data. Show the INSERT SQL statements you used and the SELECT COUNT(*) statement.

3) Create the SALESPERSONS table and populate it with at least 10 (ten) rows of data. Add a Dealer_ID column but don’t set it as a foreign key to the DEALERSHIPS table yet since you won’t be creating that table until a later project.

4) Add more rows as necessary to your CUSTOMERS table so that you have at least 100 (one hundred) rows of data total. Execute a “SELECT COUNT(*) FROM customers” statement after you have added all your new data. Show the INSERT SQL statements you used and the SELECT COUNT(*) statement.

5) Add more rows as necessary to your SALES table so that you have at least 200 (two hundred) rows of data total. Execute a “SELECT COUNT(*) FROM sales” statement after you have added all your new data. Show the INSERT SQL statements you used and the SELECT COUNT(*).

6) Create the SALES_FINANCINGS table and populate it with at least 200 (two hundred) rows of data (i.e. one per sale). Execute a “SELECT COUNT(*) FROM sales_financings” statement after you have added all your new data. Show the INSERT SQL statements you used and the SELECT COUNT(*) statement.

7) Via a single SELECT query display the total count of sales, and the lowest, average, and highest sale price. Show the SQL statement you used.

8) Via a single SELECT query display all customer IDs, names, and zip codes of customers having purchased 2 or more vehicles. Show the SQL statement you used.

9) Via a single SELECT query display the institution and loan type of the financing plan that was used for the most sales. Show the SQL statement you used.

10) Via a single SELECT query display the make of the vehicle involved in the most sales and all customers having purchased a vehicle of that make.

11) Via a single SELECT query display the total count of sales, by model and then by zip code, with the highest values first.

Your submission MUST include one or more .sql files. Please name them with your last name, project, and order to run them. For example: Smith_Project_2_Part_A.sql. Also include drop scripts to un-do the scripts. For example: Smith_Project_2_Part_A_drop.sql.

Project 2 grading rubric

AttributeMeetsDoes Not Meet
CREATE TABLE SQL statements15 pointsUses an SQL script file.Creates the FINANCING_PLANS, SALES_FINANCINGS, and SALESPERSONS tables.Includes all necessary integrity constraints including primary keys, foreign keys, CHECK constraints, UNIQUE constraints, and NOT NULL constraints.Uses an Oracle RDBMS.All SQL statements are syntactically correct and execute without error.0 pointsDoes not use an SQL script file.Does not create the FINANCING_PLANS, SALES_FINANCINGS, and SALESPERSONS tables.Does not include all necessary integrity constraints including primary keys, foreign keys, CHECK constraints, UNIQUE constraints, and NOT NULL constraints.Does not use an Oracle RDBMS.All SQL statements are not syntactically correct or execute without error.
INSERT SQL statements35 pointsPopulates the FINANCING_PLANS table with at least 5 (five) rows.Populates your VEHICLES table with at least 50 (fifty) rows.Populates your SALESPERSONS table with at least 10 (ten) rows.Add more rows as necessary to your CUSTOMERS table so that you have at least 100 (one hundred) rows of data total.Adds more rows as necessary to your SALES table so that you have at least 200 (two hundred) rows of data total.Populates the SALES_FINANCINGS table with at least 200 (two hundred) rows of data (i.e. one per sale).All SQL statements are syntactically0 pointsDoes not populate the FINANCING_PLANS table with at least 5 (five) rows.Does not populate your VEHICLES table with at least 50 (fifty) rows.Does not populate your SALESPERSONS table with at least 10 (ten) rows.Does not add more rows as necessary to your CUSTOMERS table so that you have at least 100 (one hundred) rows of data total.Does not add more rows as necessary to your SALES table so that you have at least 200 (two hundred) rows of data total.Does not populates the SALES_FINANCINGS table with at least 200 (two hundred) rows of

Project 1

You are part of a development team with Ace Software, Inc. who has recently been contracted to develop various database capabilities for Online Vehicle Sales, Inc. (OVS). OVS is a startup “dotcom” with about 10 dealership locations in Maryland, Virginia and Washington, D.C. They sell new and used cars (compacts, midsizes and full-sizes), sport utility vehicles (SUVs) and light trucks. Currently their business is just based on customers visiting one of the 10 dealership locations in person, but soon they plan to move the bulk of their business the Internet. Initially they have expressed a desire to have a custom OLTP database, and a custom DSS database, designed and built by your company. Each dealership has a staff of salespersons who assist customers in the purchase of different types of vehicles for which various financing plans are available. New and used vehicles are provided to each dealership based on sales and inventory needs.

An ERD for a 3NF normalized online transaction processing (OLTP) relational database for this application is provided.

Using an SQL Developer, create Oracle tables for the CUSTOMER, VEHICLE (i.e. SALE_VEHICLE), and SALE entities shown in the ERD. Use the plural form of the entity name for your table names (i.e. CUSTOMERS, VEHICLES, and SALES). Note that you are using the SALE_VEHICLE entity to create a VEHICLES table. Ignore the TRADE_IN_VEHICLE entity. You will create tables for some of the other entities in upcoming assignments.

You must include all necessary integrity constraints including primary keys, foreign keys, CHECK constraints, UNIQUE constraints, and NOT NULL constraints. It is a good practice, but not required, to explicitly name your constraints.

You can create your database on UMGC’s Virtual Lab Broker.

Populate the VEHICLES and CUSTOMERS tables with at least 10 (ten) rows each.

Populate your SALES table with at least 10 (ten) rows.

Run SELECT * statements on all three tables after they are populated to show their contents. To prevent excessive wrapping you might consider using the SQL*Plus LINESIZE and COLUMN commands.

Submit the SQL script file or files for this project. This should include.

1) All of your DROP TABLE, CREATE TABLE, and ALTER TABLE SQL.

2) All of your INSERT SQL statements.

3) The contents of all tables from SELECT * FROM tablename; statements.

Your submission MUST be one or more .sql SQL script files. Please name them with your last name, project, and order to run them. For example: Smith_Project_2_Part_A.sql. Also include drop scripts to un-do the scripts. For example: Smith_Project_2_Part_A_drop.sql.

Project 1 Grading Rubric

AttributeMeetsDoes Not Meet
CREATE TABLE SQL statements50 pointsUses an SQL script file.Creates Oracle tables for the CUSTOMER, VEHICLE (i.e. SALE_VEHICLE), and SALE entities shown in the ERD.Includes all necessary integrity constraints including primary keys, foreign keys, CHECK constraints, UNIQUE constraints, and NOT NULL constraints.Uses an Oracle RDBMS.All SQL statements are syntactically correct and execute without error.0 pointsDoes not uses an SQL script file.Does not create Oracle tables for the CUSTOMER, VEHICLE (i.e. SALE_VEHICLE), and SALE entities shown in the ERD.Does not includes all necessary integrity constraints including primary keys, foreign keys, CHECK constraints, UNIQUE constraints, and NOT NULL constraints.Does not use an Oracle RDBMS.All SQL statements are not syntactically correct or execute without error.
INSERT SQL statements30 pointsPopulates the VEHICLES and CUSTOMERS tables with at least 10 (ten) rows each.Populates your SALES table with at least 10 (ten) rows.All SQL statements are syntactically correct and execute without error.0 pointsDoes not populate the VEHICLES and CUSTOMERS tables with at least 10 (ten) rows each.Does not populate your SALES table with at least 10 (ten) rows.All SQL statements are not syntactically correct or execute without error.
SELECT SQL statements5 pointsRuns SELECT * statements on all three tables after they are populated to show their contents.Prevents excessive wrapping using the SQL*Plus LINESIZE and COLUMN commands.All SQL statements are syntactically correct and execute without error.0 pointsDoes not run SELECT * statements on all three tables after they are populated to show their contents.Does not prevent excessive wrapping using the SQL*Plus LINESIZE and COLUMN commands.All SQL statements are not syntactically correct or execute without error.
SQL script file(s)15 pointsSubmits SQL script file(s).0 pointsDoes not s ubmits SQL script file(s)

create table CUSTOMERS ( CustID number not null constraint table_1_pk primary key, LastName varchar2(60) not null, FirstName varchar2(60) not null, MI varchar2(1), Address varchar2(60) not null, Street varchar2(60) not null, City varchar2(60) not null, State varchar2(60) not null, Zip number not null ); create table sales ( Sale_ID number not null constraint sales_pk primary key, gross_sale_price number not null, vehicle_status varchar2(20) not null, mileage number not null, vehicle_date date not null, CustID number not null, VIN number not null ); create table VEHICLES ( VIN number not null constraint vehicles_pk primary key, model varchar2(60) not null, make varchar2(60) not null, wholesale_cost varchar2(10) not null, wherefrom varchar2(60) not null, type varchar2(60) not null ) ; INSERT ALL INTO CUSTOMERS values(123, ‘Nelson’, ‘Freeman’, ‘N’, ‘614-601-5147’, ‘Abdella Way’, ‘New York’, ‘New york’,12345) INTO CUSTOMERS values(16, ‘Mary’, ‘Mader’, ‘K’, ‘614-624-6628’, ‘Alwyne Avenue’, ‘Philadelphia’, ‘Philadelphia’, 43441) INTO CUSTOMERS values(3, ‘William’, ‘Mack’,’A’, ‘330-949-2522’, ‘Arcadia Lakes Drive’, ‘Alaska’, ‘Alaska’, 23423) INTO CUSTOMERS values(4, ‘Mary’, ‘Burbank’, ‘G’,’330-512-9725′, ‘Arruda Terrace’, ‘Summerville’, ‘Alabama’, 22323) INTO CUSTOMERS values(7, ‘Enoch’, ‘Whitman’, ‘S’, ‘216-848-9837’, ‘Atwood Way’, ‘Texas’, ‘Texas’, 33234) INTO CUSTOMERS values(8, ‘Rebecca’, ‘Gardner’, ‘H’, ‘210-332-4332′,’Avila Place’, ‘Rosecounty’, ‘Nevada’,67733) INTO CUSTOMERS values(2, ‘Samuel’, ‘Hunter’, ‘J’, ‘513-395-7045’, ‘Avila Place’,’Rosecounty’, ‘Nevada’,45374) INTO CUSTOMERS values(10, ‘Lucerna’, ‘Harlow’, ‘L’, ‘513-786-2650’, ‘Summerville’, ‘Texas’, ‘Texas’, 32344) INTO CUSTOMERS values(11, ‘David’, ‘Freeman’, ‘F’, ‘513-545-8812’, ‘Rosewood’,’Montana’, ‘Massachussetts’, 53626) INTO CUSTOMERS values(12, ‘Desiah’, ‘Mack’, ‘B’, ‘330-802-5776’, ‘Hollywood’, ‘Hollywood’, ‘Nebraska’, 23235) INTO CUSTOMERS values(13, ‘Nathanial’, ‘Whitman’, ‘M’, ‘216-596-6123’, ‘Springsfield’, ‘Alabama’, ‘Alabama’, 34323) INTO CUSTOMERS values(9, ‘Jane’, ‘Hunter’, ‘C’, ‘216-596-6321’, ‘Silicone Valley’, ‘Silicone valley’, ‘New York’, 34393) INTO CUSTOMERS values(14, ‘Joseph’, ‘Freeman’, ‘J’,’312-893-2254′, ‘Bloomberg’, ‘Bloomberg’, ‘New Mexico’, 63423) INTO CUSTOMERS values(15, ‘Abigale’, ‘Whitman’, ‘W’, ‘773-254-8919’, ‘Texas’, ‘Texas’, ‘Texas’, 32466) INTO CUSTOMERS values(5, ‘Samuel’, ‘Freeman’,’P’,’321-323-3343′, ‘Houston’, ‘Houston’, ‘New York’, 89676) INTO CUSTOMERS values(6, ‘Jessica’, ‘Freeman’,’S’, ‘614-719-9213’, ‘Neverland’,’Hollywood’, ‘New York’, 45671) INTO CUSTOMERS values(17, ‘Alex’, ‘Whitman’,’A’, ‘216-596-6240’, ‘Maryland’,’Maryland’, ‘Maryland’, 45783) SELECT * FROM DUAL ; INSERT ALL INTO SALES values(1, 400000, ‘in stock’, 20, ’01-APR-98′, 12, 34) INTO SALES values(2, 200000, ‘sold’, 30, ’13-Mar-2020′, 32, 64) INTO SALES values(3, 500000, ‘available’, 40, ’01-APR-98′, 42, 84) INTO SALES values(5, 600000, ‘sold’, 0, ’01-APR-98′, 52, 74) INTO SALES values(13, 450000, ‘in stock’, 0, ’01-APR-98′, 1, 4) INTO SALES values(41, 200000, ‘sold’, 40, ’01-APR-98′, 82, 4) INTO SALES values(91, 500000, ‘sold’, 78, ’01-APR-98′, 73, 94) INTO SALES values(51, 20000, ‘in stock’, 20, ’01-APR-98′, 92, 84) INTO SALES values(14, 200000, ‘sold’, 20, ’01-APR-98′, 124, 534) INTO SALES values(16, 200000, ‘sold’, 20, ’01-APR-98′, 125, 734) INTO SALES values(19, 200000, ‘available’, 20, ’01-APR-98′, 212, 234) INTO SALES values(198, 700000, ‘sold’, 0, ’01-APR-98′, 912, 934) INTO SALES values(12, 200000, ‘sold’, 60, ’01-APR-98′, 152, 834) SELECT * FROM DUAL; INSERT ALL INTO VEHICLES values(1, ‘Toyota’, ‘SUV’, ‘20000’, ‘Japan’, ‘SUV’) INTO VEHICLES values(2, ‘Ford’, ‘SUV’, ‘40000’, ‘USA’, ‘SUV’) INTO VEHICLES values(3, ‘Toyota’, ‘SUV’, ‘90000’, ‘Japan’, ‘SUV’) INTO VEHICLES values(4, ‘Toyota’, ‘SUV’, ‘70000’, ‘Japan’, ‘SUV’) INTO VEHICLES values(5, ‘Toyota’, ‘SUV’, ‘30000’, ‘Japan’, ‘SUV’) INTO VEHICLES values(6, ‘Toyota’, ‘SUV’, ‘40000’, ‘Japan’, ‘SUV’) INTO VEHICLES values(7, ‘Toyota’, ‘SUV’, ‘20000’, ‘Japan’, ‘SUV’) INTO VEHICLES values(8, ‘Toyota’, ‘SUV’, ‘20000’, ‘Japan’, ‘SUV’) INTO VEHICLES values(9, ‘Toyota’, ‘SUV’, ‘20000’, ‘Japan’, ‘SUV’) INTO VEHICLES values(10, ‘Toyota’, ‘SUV’, ‘520000’, ‘Japan’, ‘SUV’) INTO VEHICLES values(11, ‘Toyota’, ‘SUV’, ‘40000’, ‘Japan’, ‘SUV’) SELECT * FROM DUAL; select * from sales; select * from customers; select * from vehicles;

Order your essay today and save 10% with the discount code ESSAYHELP