ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 02 May 2017 My Price 9.00

SPOOL CreateDatabase2.log

Having Trouble Getting my SQL DB INSERT INTO  script to work. I have been at it adjusting and re-adjusting for 6 hours. EBERT.sql file is my database and loads fine. Populate.sql is all messed up. 

 

 

SPOOL CreateDatabase2.log;
DROP TABLE Directors_table ;
DROP TABLE Academy_awards ;
DROP TABLE Actors_table ;
DROP TABLE Distribution_details ;
DROP TABLE Movies_table ;
DROP TABLE Distributer_table ;
DROP TABLE Stars_table ;
DROP TABLE Customers_table ;
DROP TABLE Rentals_table ;
DROP TABLE Discount_table ;
DROP TABLE Genre_table ;
DROP TABLE Video_type ;
CREATE
CREATE
CREATE
CREATE
CREATE
CREATE
CREATE
CREATE
CREATE
CREATE SEQUENCE
SEQUENCE
SEQUENCE
SEQUENCE
SEQUENCE
SEQUENCE
SEQUENCE
SEQUENCE
SEQUENCE
SEQUENCE SEQ_director_id INCREMENT BY 1 START WITH 1
SEQ_award_id INCREMENT BY 1 START WITH 1
SEQ_movie_id INCREMENT BY 1 START WITH 1
SEQ_actor_id INCREMENT BY 1 START WITH 1
SEQ_distributer_id INCREMENT BY 1 START WITH 1
SEQ_rental_id INCREMENT BY 1 START WITH 1
SEQ_genre_id INCREMENT BY 1 START WITH 1
SEQ_type_id INCREMENT BY 1 START WITH 1
SEQ_discount_id INCREMENT BY 1 START WITH 1
SEQ_customer_id INCREMENT BY 1 START WITH 1 CREATE TABLE Directors_table (
director_id
name
birthdate NUMBER(5,0)
VARCHAR2(40)
DATE PRIMARY KEY,
NOT NULL,
NOT NULL ); CREATE TABLE Academy_awards (
award_id
movie_id
director_id
actor_id
award_year NUMBER(5,0)
INT
INT
INT
NUMBER(4,0) PRIMARY KEY,
NOT NULL,
NOT NULL,
NOT NULL,
NOT NULL ); CREATE TABLE Actors_table (
actor_id
name
birthdate NUMBER(5,0)
VARCHAR2(40)
DATE PRIMARY KEY,
NOT NULL,
NOT NULL); CREATE TABLE Distribution_details (
movie_id
INT
distributer_id
INT
quantity
NUMBER(4,0)
price
DECIMAL(5,2) ); PRIMARY KEY,
NOT NULL,
NOT NULL, CREATE TABLE Movies_table (
movie_id
director_id
discount_id PRIMARY KEY,
NOT NULL, NUMBER(5,0)
NUMBER(5,0)
NUMBER(5,0), genre_id
type_id
title
year
length
rating NUMBER(5,0)
NUMBER(5,0)
VARCHAR2(40)
NUMBER(4,0)
NUMBER(3,0),
NUMBER(1,0) ); NOT NULL,
NOT NULL,
NOT NULL,
NOT NULL, CREATE TABLE Distributer_table (
distributer_id
name
phone
address NUMBER(5,0)
VARCHAR2(40)
NUMBER(10,0)
VARCHAR2(255) ); CREATE TABLE Stars_table (
movie_id
actor_id
newattribute_1
newattribute_2 NUMBER(5,0)
NUMBER(5,0)
VARCHAR2(255),
VARCHAR2(255) ); PRIMARY KEY,
NOT NULL, CREATE TABLE Customers_table (
customer_id
name
phone
address NUMBER(5,0)
VARCHAR2(40)
NUMBER(10,0)
VARCHAR2(255) ); PRIMARY KEY,
NOT NULL,
NOT NULL, CREATE TABLE Rentals_table (
rental_id
movie_id
customer_id
date_rented
date_returned
late_fee
rewind_fee NUMBER(5,0)
NUMBER(5,0)
NUMBER(5,0)
DATE
DATE
DECIMAL(4,2),
DECIMAL(3,2) ); PRIMARY KEY,
NOT NULL,
NOT NULL,
NOT NULL,
NOT NULL, CREATE TABLE Discount_table (
discount_id
rate NUMBER(5,0)
DECIMAL(3,2) PRIMARY KEY,
NOT NULL ); CREATE TABLE Genre_table (
genre_id
genre_type NUMBER(5,0)
VARCHAR2(20) PRIMARY KEY,
NOT NULL ); CREATE TABLE Video_type (
type_id
type_dvd_vhs PRIMARY KEY,
NOT NULL,
NOT NULL, NUMBER(5,0)
VARCHAR2(3) PRIMARY KEY,
NOT NULL ); ALTER TABLE Academy_awards ADD FOREIGN KEY (movie_id) REFERENCES Movies_table
(movie_id) ;
ALTER TABLE Academy_awards ADD FOREIGN KEY (director_id) REFERENCES
Directors_table (director_id) ;
ALTER TABLE Academy_awards ADD FOREIGN KEY (actor_id) REFERENCES Actors_table
(actor_id) ;
ALTER TABLE Distribution_details ADD FOREIGN KEY (movie_id) REFERENCES
Movies_table (movie_id) ;
ALTER TABLE Distribution_details ADD FOREIGN KEY (distributer_id) REFERENCES
Distributer_table (distributer_id) ;
ALTER TABLE Movies_table ADD FOREIGN KEY (director_id) REFERENCES
Directors_table (director_id) ; ALTER TABLE Movies_table ADD FOREIGN KEY (discount_id) REFERENCES Discount_table
(discount_id) ;
ALTER TABLE Movies_table ADD FOREIGN KEY (genre_id) REFERENCES Genre_table
(genre_id) ;
ALTER TABLE Movies_table ADD FOREIGN KEY (type_id) REFERENCES Video_type
(type_id) ;
ALTER TABLE Stars_table ADD FOREIGN KEY (movie_id) REFERENCES Movies_table
(movie_id) ;
ALTER TABLE Stars_table ADD FOREIGN KEY (actor_id) REFERENCES Actors_table
(actor_id) ;
ALTER TABLE Rentals_table ADD FOREIGN KEY (movie_id) REFERENCES Movies_table
(movie_id) ;
ALTER TABLE Rentals_table ADD FOREIGN KEY (customer_id) REFERENCES
Customers_table (customer_id) ;
SPOOL OFF;

 

DELETE
DELETE
DELETE
DELETE
DELETE
DELETE
DELETE
DELETE
DELETE
DELETE
DELETE
DELETE FROM
FROM
FROM
FROM
FROM
FROM
FROM
FROM
FROM
FROM
FROM
FROM Directors_table;
Academy_awards;
Actors_table;
Distribution_details;
Movies_table;
Distributer_table;
Stars_table;
Customers_table;
Rentals_table;
Discount_table;
Genre_table;
Video_type; INSERT INTO Directors_table (director_id, name, birthdate) VALUES ( 1, Steven
Spielberg, 12-Apr-1956);
INSERT INTO Directors_table (director_id, name, birthdate) VALUES ( 2, Clint
Eastwood, 12-DEC-1941);
INSERT INTO Directors_table (director_id, name, birthdate) VALUES ( 3, Joel
Coen, 11–MAY-1962);
INSERT INTO Directors_table (director_id, name, birthdate) VALUES ( 4, Steven
Soderbergh, 12-JUN-1966);
INSERT INTO Directors_table (director_id, name, birthdate) VALUES ( 5, David
Fincher, 10-JAN-1976);
INSERT INTO Actors_table (actor_id, name, birthdate) VALUES ( 1, Tom Hanks, 09JUL-1956);
INSERT INTO Actors_table (actor_id, name, birthdate) VALUES ( 2, Hilary Swank,
30-JUL-1974);
INSERT INTO Actors_table (actor_id, name, birthdate) VALUES ( 3, Tommy Lee
Jones, 15-SEP-1946);
INSERT INTO Actors_table (actor_id, name, birthdate) VALUES ( 4, George Clooney,
06-MAY-1961);
INSERT INTO Actors_table (actor_id, name, birthdate) VALUES ( 5, Brad Pitt, 18DEC-196);
INSERT INTO Distributer_table (distributer_id, name, phone, address)
VALUES (1, Top Movies, 5302664841, 1211 S. Perry St Pittsburgh PA 16354);
INSERT INTO Distributer_table (distributer_id, name, phone, address)
VALUES (2, CA Distributers, 8145332626, 10 Blevin St Sacramento CA 96929);
INSERT INTO Distributer_table (distributer_id, name, phone, address)
VALUES (3, New Entertainment, 7138569998, 13 Airport Way Los Angles CA 90210);
INSERT INTO Distributer_table (distributer_id, name, phone, address)
VALUES (4, Entertainment Incorporated, 9132674488, 111 Main St St Louis MO
46164);
INSERT INTO Distributer_table (distributer_id, name, phone, address)
VALUES (5, Big Red Movies, 8137889984, 1015 Lightning St Tampa FL 33333);
INSERT INTO Customers_table (customer_id, name, phone, address)
VALUES (1, Bob Evans, 6714889009, 1 Chammoro Way Yigo GU 96929);
INSERT INTO Customers_table (customer_id, name, phone, address) VALUES (2, Sam Adams, 6716853792, 371 Chalan Pontan Yigo GU 96929);
INSERT INTO Customers_table (customer_id, name, phone, address)
VALUES (3, Tiffany Arnold, 6712324000, 54 Chalan Reale Yigo GU 96929);
INSERT INTO Customers_table (customer_id, name, phone, address)
VALUES (4, Grace Sosa, 6713704242, 27 Airport Rd Dededo GU 96929);
INSERT INTO Customers_table (customer_id, name, phone, address)
VALUES (5, David Perez, 6713704250, 12 Airport Rd Dededo GU 96929);
INSERT INTO Discount_table (discount_id, rate) VALUES (1, 5.00);
INSERT INTO Discount_table (discount_id, rate) VALUES (2, 6.50);
INSERT INTO Discount_table (discount_id, rate) VALUES (3, 4.99);
INSERT INTO Discount_table (discount_id, rate) VALUES (4, 4.00);
INSERT INTO Discount_table (discount_id, rate) VALUES (5, 3.00);
INSERT INTO Genre_table (genre_id, genre_type) VALUES (1, ‘Thriller’);
INSERT INTO Genre_table (genre_id, genre_type) VALUES (2, Drama);
INSERT INTO Genre_table (genre_id, genre_type) VALUES (3, Comedy);
INSERT INTO Genre_table (genre_id, genre_type) VALUES (4, Action);
INSERT INTO Genre_table (genre_id, genre_type) VALUES (5, Romantic);
INSERT INTO Video_type (type_id, type_dvd_vhs) VALUES (1, DVD);
INSERT INTO Video_type (type_id, type_dvd_vhs) VALUES (2, VHS);
INSERT INTO Movies_table (movie_id, director_id, discount_id, genre_id, type_id,
title, year, length, rating)
VALUES ( 1, 1, 1, 4, 2, Saving Private Ryan, 1998, 169, 9);
INSERT INTO Movies_table (movie_id, director_id, discount_id, genre_id, type_id,
title, year, length, rating)
VALUES ( 2, 2, 2, 2, 1, Million Dollar Baby, 2004, 132, 8);
INSERT INTO Movies_table (movie_id, director_id, discount_id, genre_id, type_id,
title, year, length, rating)
VALUES ( 3, 3, 3, 1, 2, No Country for Old Men, 2007, 122, 8);
INSERT INTO Movies_table (movie_id, director_id, discount_id, genre_id, type_id,
title, year, length, rating)
VALUES ( 4, 4, 4, 2, 1, Oceans Eleven, 2001, 116, 7);
INSERT INTO Movies_table (movie_id, director_id, discount_id, genre_id, type_id,
title, year, length, rating)
VALUES ( 5, 5, 5, 1, 1, Fight Club, 1999, 139, 8);
INSERT INTO Academy_awards (award_id, movie_id, director_id, actor_id,
award_year)
VALUES (1, 1, 1, 1, 1999);
INSERT INTO Academy_awards (award_id, movie_id, director_id, actor_id,
award_year)
VALUES (2, 2, 2, 2, 2005);
INSERT INTO Academy_awards (award_id, movie_id, director_id, actor_id, award_year)
VALUES (3, 3, 3, 3, 2008);
INSERT INTO Academy_awards (award_id, movie_id, director_id, actor_id,
award_year)
VALUES (4, 4, 4, 4, 2002);
INSERT INTO Academy_awards (award_id, movie_id, director_id, actor_id,
award_year)
VALUES (5, 5, 5, 5, 2002);
INSERT INTO Distribution_details (movie_id, distributer_id, quantity, price)
VALUES (1, 1, 5, 50.00);
INSERT INTO Distribution_details (movie_id, distributer_id, quantity, price)
VALUES (2, 2, 6, 66.00);
INSERT INTO Distribution_details (movie_id, distributer_id, quantity, price)
VALUES (3, 3, 2, 16.00);
INSERT INTO Distribution_details (movie_id, distributer_id, quantity, price)
VALUES (4, 4, 10, 90.00);
INSERT INTO Distribution_details (movie_id, distributer_id, quantity, price)
VALUES (5, 5, 4, 28.00);
INSERT INTO Stars_table (movie_id, actor_id) VALUES (1,1);
INSERT INTO Stars_table (movie_id, actor_id) VALUES (2,2);
INSERT INTO Stars_table (movie_id, actor_id) VALUES (3,3);
INSERT INTO Stars_table (movie_id, actor_id) VALUES (4,4);
INSERT INTO Stars_table (movie_id, actor_id) VALUES (5,5);
INSERT INTO Rentals_table (rental_id, movie_id, customer_id, date_rented,
date_returned, late_fee, rewind_fee)
VALUES (1, 1, 1, 07-JAN-2017, 13-JAN-2017, 10.00, 1.50);
INSERT INTO Rentals_table (rental_id, movie_id, customer_id, date_rented,
date_returned)
VALUES (2, 2, 2, 08-JAN-2017, 09-JAN-2017);
INSERT INTO Rentals_table (rental_id, movie_id, customer_id, date_rented,
date_returned, rewind_fee)
VALUES (3, 3, 3, 10-JAN-2017, 11-JAN-2017, 1.50);
INSERT INTO Rentals_table (rental_id, movie_id, customer_id, date_rented,
date_returned)
VALUES (4, 1, 4, 14-JAN-2017, 15-JAN-2017);
INSERT INTO Rentals_table (rental_id, movie_id, customer_id, date_rented,
date_returned, late_fee)
VALUES (5, 4, 5, 13-JAN-2017, 20-JAN-2017, 12.00);

Answers

(11)
Status NEW Posted 02 May 2017 09:05 AM My Price 9.00

-----------

Not Rated(0)