Skip to content
Browse files

fixed database syntax. TODO: works but without constraints

  • Loading branch information...
1 parent 34a8285 commit dd9051572dd9d16b86aee2478a4a8bb902e4216a @jvermeir committed Apr 4, 2012
Showing with 55 additions and 47 deletions.
  1. +8 −0 src/main/resources/db/oracle/initDB.txt
  2. +47 −47 src/main/resources/db/oracle/populateDB.txt
View
8 src/main/resources/db/oracle/initDB.txt
@@ -1,3 +1,11 @@
+drop table vets;
+drop table specialties;
+drop table vet_specialties;
+drop table types;
+drop table owners;
+drop table pets;
+drop table visits;
+
CREATE TABLE vets (
id number(4) NOT NULL ,
first_name VARCHAR(30),
View
94 src/main/resources/db/oracle/populateDB.txt
@@ -1,53 +1,53 @@
-INSERT IGNORE INTO vets VALUES (1, 'James', 'Carter');
-INSERT IGNORE INTO vets VALUES (2, 'Helen', 'Leary');
-INSERT IGNORE INTO vets VALUES (3, 'Linda', 'Douglas');
-INSERT IGNORE INTO vets VALUES (4, 'Rafael', 'Ortega');
-INSERT IGNORE INTO vets VALUES (5, 'Henry', 'Stevens');
-INSERT IGNORE INTO vets VALUES (6, 'Sharon', 'Jenkins');
+INSERT INTO vets VALUES (1, 'James', 'Carter');
+INSERT INTO vets VALUES (2, 'Helen', 'Leary');
+INSERT INTO vets VALUES (3, 'Linda', 'Douglas');
+INSERT INTO vets VALUES (4, 'Rafael', 'Ortega');
+INSERT INTO vets VALUES (5, 'Henry', 'Stevens');
+INSERT INTO vets VALUES (6, 'Sharon', 'Jenkins');
-INSERT IGNORE INTO specialties VALUES (1, 'radiology');
-INSERT IGNORE INTO specialties VALUES (2, 'surgery');
-INSERT IGNORE INTO specialties VALUES (3, 'dentistry');
+INSERT INTO specialties VALUES (1, 'radiology');
+INSERT INTO specialties VALUES (2, 'surgery');
+INSERT INTO specialties VALUES (3, 'dentistry');
-INSERT IGNORE INTO vet_specialties VALUES (2, 1);
-INSERT IGNORE INTO vet_specialties VALUES (3, 2);
-INSERT IGNORE INTO vet_specialties VALUES (3, 3);
-INSERT IGNORE INTO vet_specialties VALUES (4, 2);
-INSERT IGNORE INTO vet_specialties VALUES (5, 1);
+INSERT INTO vet_specialties VALUES (2, 1);
+INSERT INTO vet_specialties VALUES (3, 2);
+INSERT INTO vet_specialties VALUES (3, 3);
+INSERT INTO vet_specialties VALUES (4, 2);
+INSERT INTO vet_specialties VALUES (5, 1);
-INSERT IGNORE INTO types VALUES (1, 'cat');
-INSERT IGNORE INTO types VALUES (2, 'dog');
-INSERT IGNORE INTO types VALUES (3, 'lizard');
-INSERT IGNORE INTO types VALUES (4, 'snake');
-INSERT IGNORE INTO types VALUES (5, 'bird');
-INSERT IGNORE INTO types VALUES (6, 'hamster');
+INSERT INTO types VALUES (1, 'cat');
+INSERT INTO types VALUES (2, 'dog');
+INSERT INTO types VALUES (3, 'lizard');
+INSERT INTO types VALUES (4, 'snake');
+INSERT INTO types VALUES (5, 'bird');
+INSERT INTO types VALUES (6, 'hamster');
-INSERT IGNORE INTO owners VALUES (1, 'George', 'Franklin', '110 W. Liberty St.', 'Madison', '6085551023');
-INSERT IGNORE INTO owners VALUES (2, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749');
-INSERT IGNORE INTO owners VALUES (3, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763');
-INSERT IGNORE INTO owners VALUES (4, 'Harold', 'Davis', '563 Friendly St.', 'Windsor', '6085553198');
-INSERT IGNORE INTO owners VALUES (5, 'Peter', 'McTavish', '2387 S. Fair Way', 'Madison', '6085552765');
-INSERT IGNORE INTO owners VALUES (6, 'Jean', 'Coleman', '105 N. Lake St.', 'Monona', '6085552654');
-INSERT IGNORE INTO owners VALUES (7, 'Jeff', 'Black', '1450 Oak Blvd.', 'Monona', '6085555387');
-INSERT IGNORE INTO owners VALUES (8, 'Maria', 'Escobito', '345 Maple St.', 'Madison', '6085557683');
-INSERT IGNORE INTO owners VALUES (9, 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', '6085559435');
-INSERT IGNORE INTO owners VALUES (10, 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', '6085555487');
+INSERT INTO owners VALUES (1, 'George', 'Franklin', '110 W. Liberty St.', 'Madison', '6085551023');
+INSERT INTO owners VALUES (2, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749');
+INSERT INTO owners VALUES (3, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763');
+INSERT INTO owners VALUES (4, 'Harold', 'Davis', '563 Friendly St.', 'Windsor', '6085553198');
+INSERT INTO owners VALUES (5, 'Peter', 'McTavish', '2387 S. Fair Way', 'Madison', '6085552765');
+INSERT INTO owners VALUES (6, 'Jean', 'Coleman', '105 N. Lake St.', 'Monona', '6085552654');
+INSERT INTO owners VALUES (7, 'Jeff', 'Black', '1450 Oak Blvd.', 'Monona', '6085555387');
+INSERT INTO owners VALUES (8, 'Maria', 'Escobito', '345 Maple St.', 'Madison', '6085557683');
+INSERT INTO owners VALUES (9, 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', '6085559435');
+INSERT INTO owners VALUES (10, 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', '6085555487');
-INSERT IGNORE INTO pets VALUES (1, 'Leo', '2000-09-07', 1, 1);
-INSERT IGNORE INTO pets VALUES (2, 'Basil', '2002-08-06', 6, 2);
-INSERT IGNORE INTO pets VALUES (3, 'Rosy', '2001-04-17', 2, 3);
-INSERT IGNORE INTO pets VALUES (4, 'Jewel', '2000-03-07', 2, 3);
-INSERT IGNORE INTO pets VALUES (5, 'Iggy', '2000-11-30', 3, 4);
-INSERT IGNORE INTO pets VALUES (6, 'George', '2000-01-20', 4, 5);
-INSERT IGNORE INTO pets VALUES (7, 'Samantha', '1995-09-04', 1, 6);
-INSERT IGNORE INTO pets VALUES (8, 'Max', '1995-09-04', 1, 6);
-INSERT IGNORE INTO pets VALUES (9, 'Lucky', '1999-08-06', 5, 7);
-INSERT IGNORE INTO pets VALUES (10, 'Mulligan', '1997-02-24', 2, 8);
-INSERT IGNORE INTO pets VALUES (11, 'Freddy', '2000-03-09', 5, 9);
-INSERT IGNORE INTO pets VALUES (12, 'Lucky', '2000-06-24', 2, 10);
-INSERT IGNORE INTO pets VALUES (13, 'Sly', '2002-06-08', 1, 10);
+INSERT INTO pets VALUES (1, 'Leo', to_date('2000-09-07','yyyy-mm-dd'), 1, 1);
+INSERT INTO pets VALUES (2, 'Basil', to_date('2002-08-06','yyyy-mm-dd'), 6, 2);
+INSERT INTO pets VALUES (3, 'Rosy', to_date('2001-04-17','yyyy-mm-dd'), 2, 3);
+INSERT INTO pets VALUES (4, 'Jewel', to_date('2000-03-07','yyyy-mm-dd'), 2, 3);
+INSERT INTO pets VALUES (5, 'Iggy', to_date('2000-11-30','yyyy-mm-dd'), 3, 4);
+INSERT INTO pets VALUES (6, 'George', to_date('2000-01-20','yyyy-mm-dd'), 4, 5);
+INSERT INTO pets VALUES (7, 'Samantha', to_date('1995-09-04','yyyy-mm-dd'), 1, 6);
+INSERT INTO pets VALUES (8, 'Max', to_date('1995-09-04','yyyy-mm-dd'), 1, 6);
+INSERT INTO pets VALUES (9, 'Lucky', to_date('1999-08-06','yyyy-mm-dd'), 5, 7);
+INSERT INTO pets VALUES (10, 'Mulligan', to_date('1997-02-24','yyyy-mm-dd'), 2, 8);
+INSERT INTO pets VALUES (11, 'Freddy', to_date('2000-03-09','yyyy-mm-dd'), 5, 9);
+INSERT INTO pets VALUES (12, 'Lucky', to_date('2000-06-24','yyyy-mm-dd'), 2, 10);
+INSERT INTO pets VALUES (13, 'Sly', to_date('2002-06-08','yyyy-mm-dd'), 1, 10);
-INSERT IGNORE INTO visits VALUES (1, 7, '1996-03-04', 'rabies shot');
-INSERT IGNORE INTO visits VALUES (2, 8, '1996-03-04', 'rabies shot');
-INSERT IGNORE INTO visits VALUES (3, 8, '1996-06-04', 'neutered');
-INSERT IGNORE INTO visits VALUES (4, 7, '1996-09-04', 'spayed');
+INSERT INTO visits VALUES (1, 7, to_date('1996-03-04','yyyy-mm-dd'), 'rabies shot');
+INSERT INTO visits VALUES (2, 8, to_date('1996-03-04','yyyy-mm-dd'), 'rabies shot');
+INSERT INTO visits VALUES (3, 8, to_date('1996-06-04','yyyy-mm-dd'), 'neutered');
+INSERT INTO visits VALUES (4, 7, to_date('1996-09-04','yyyy-mm-dd'), 'spayed');

0 comments on commit dd90515

Please sign in to comment.
Something went wrong with that request. Please try again.