In: Computer Science
Create the actual database using SQL syntax. This is completed using a Database Application (i.e Microsoft Access, Oracle, or MySQL) as indicated by your professor. After creating the database – populate it with some data (could be made up). SQL syntax and the DB application will be discussed and taught in class. This is the final deliverable of the group project. Assignment is due by the due date as indicated by your professor. *Make sure to submit the completed database in the correct format (i.e Access file, Oracle, MySQL, etc.), don’t forget to include the SQL commands used to create the tables in the database
Note. Can please provide the Database Table
Database SQL syntax:
--------------------------------------------------------------------------------------------------------------------------
CREATE DATABASE `classicmodels` ;
USE `classicmodels`;
/*Table structure for table `customers` */
DROP TABLE IF EXISTS `customers`;
CREATE TABLE `customers` (
`customerNumber` int(11) NOT NULL,
`customerName` varchar(50) NOT NULL,
`contactLastName` varchar(50) NOT NULL,
`contactFirstName` varchar(50) NOT NULL,
`phone` varchar(50) NOT NULL,
`addressLine1` varchar(50) NOT NULL,
`addressLine2` varchar(50) DEFAULT NULL,
`city` varchar(50) NOT NULL,
`state` varchar(50) DEFAULT NULL,
`postalCode` varchar(15) DEFAULT NULL,
`country` varchar(50) NOT NULL,
`salesRepEmployeeNumber` int(11) DEFAULT NULL,
`creditLimit` decimal(10,2) DEFAULT NULL,
PRIMARY KEY (`customerNumber`),
KEY `salesRepEmployeeNumber` (`salesRepEmployeeNumber`),
CONSTRAINT `customers_ibfk_1` FOREIGN KEY
(`salesRepEmployeeNumber`) REFERENCES `employees`
(`employeeNumber`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `customers` */
insert into
`customers`(`customerNumber`,`customerName`,`contactLastName`,`contactFirstName`,`phone`,`addressLine1`,`addressLine2`,`city`,`state`,`postalCode`,`country`,`salesRepEmployeeNumber`,`creditLimit`)
values
(320,'Mini Creations Ltd.','Huang','Wing','5085559555','4575
Hillside Dr.',NULL,'New
Bedford','MA','50553','USA',1188,'94500.00'),
(321,'Corporate Gift Ideas Co.','Brown','Julie','6505551386','7734
Strong St.',NULL,'San
Francisco','CA','94217','USA',1165,'105000.00'),
(323,'Down Under Souveniers, Inc','Graham','Mike','+64 9 312
5555','162-164 Grafton Road','Level 2','Auckland ',NULL,NULL,'New
Zealand',1612,'88000.00'),
(324,'Stylish Desk Decors, Co.','Brown','Ann ','(171) 555-0297','35
King George',NULL,'London',NULL,'WX3
6FW','UK',1501,'77000.00'),
(328,'Tekni Collectables Inc.','Brown','William','2015559350','7476
Moss Rd.',NULL,'Newark','NJ','94019','USA',1323,'43000.00'),
(333,'Australian Gift Network,
Co','Calaghan','Ben','61-7-3844-6555','31 Duncan St. West
End',NULL,'South
Brisbane','Queensland','4101','Australia',1611,'51600.00'),
(334,'Suominen Souveniers','Suominen','Kalle','+358 9 8045
555','Software Engineering Center','SEC
Oy','Espoo',NULL,'FIN-02271','Finland',1501,'98800.00'),
(335,'Cramer Spezialitäten, Ltd','Cramer','Philip
','0555-09555','Maubelstr.
90',NULL,'Brandenburg',NULL,'14776','Germany',NULL,'0.00'),
(448,'Scandinavian Gift Ideas','Larsson','Martha','0695-34
6555','Åkergatan 24',NULL,'Bräcke',NULL,'S-844
67','Sweden',1504,'116400.00'),
(450,'The Sharp Gifts Warehouse','Frick','Sue','4085553659','3086
Ingle Ln.',NULL,'San
Jose','CA','94217','USA',1165,'77600.00'),
(452,'Mini Auto Werke','Mendel','Roland ','7675-3555','Kirchgasse
6',NULL,'Graz',NULL,'8010','Austria',1401,'45300.00'),
(455,'Super Scale Inc.','Murphy','Leslie','2035559545','567 North
Pendale Street',NULL,'New
Haven','CT','97823','USA',1286,'95400.00'),
(456,'Microscale Inc.','Choi','Yu','2125551957','5290 North Pendale
Street','Suite
200','NYC','NY','10022','USA',1286,'39800.00'),
(458,'Corrida Auto Replicas, Ltd','Sommer','Martín ','(91) 555 22
82','C/ Araquil,
67',NULL,'Madrid',NULL,'28023','Spain',1702,'104600.00'),
(459,'Warburg Exchange','Ottlieb','Sven ','0241-039123','Walserweg
21',NULL,'Aachen',NULL,'52066','Germany',NULL,'0.00'),
(462,'FunGiftIdeas.com','Benitez','Violeta','5085552555','1785
First Street',NULL,'New
Bedford','MA','50553','USA',1216,'85800.00'),
(465,'Anton Designs, Ltd.','Anton','Carmen','+34 913 728555','c/
Gobelas, 19-1 Urb. La
Florida',NULL,'Madrid',NULL,'28023','Spain',NULL,'0.00'),
(471,'Australian Collectables,
Ltd','Clenahan','Sean','61-9-3844-6555','7 Allen Street',NULL,'Glen
Waverly','Victoria','3150','Australia',1611,'60300.00'),
(496,'Kelly\'s Gift Shop','Snowden','Tony','+64 9
5555500','Arenales 1938 3\'A\'',NULL,'Auckland ',NULL,NULL,'New
Zealand',1612,'110000.00');
/*Table structure for table `employees` */
DROP TABLE IF EXISTS `employees`;
CREATE TABLE `employees` (
`employeeNumber` int(11) NOT NULL,
`lastName` varchar(50) NOT NULL,
`firstName` varchar(50) NOT NULL,
`extension` varchar(10) NOT NULL,
`email` varchar(100) NOT NULL,
`officeCode` varchar(10) NOT NULL,
`reportsTo` int(11) DEFAULT NULL,
`jobTitle` varchar(50) NOT NULL,
PRIMARY KEY (`employeeNumber`),
KEY `reportsTo` (`reportsTo`),
KEY `officeCode` (`officeCode`),
CONSTRAINT `employees_ibfk_1` FOREIGN KEY (`reportsTo`) REFERENCES
`employees` (`employeeNumber`),
CONSTRAINT `employees_ibfk_2` FOREIGN KEY (`officeCode`) REFERENCES
`offices` (`officeCode`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `employees` */
insert into
`employees`(`employeeNumber`,`lastName`,`firstName`,`extension`,`email`,`officeCode`,`reportsTo`,`jobTitle`)
values
(1002,'Murphy','Diane','x5800','[email protected]','1',NULL,'President'),
(1056,'Patterson','Mary','x4611','[email protected]','1',1002,'VP
Sales'),
(1076,'Firrelli','Jeff','x9273','[email protected]','1',1002,'VP
Marketing'),
(1188,'Firrelli','Julie','x2173','[email protected]','2',1143,'Sales
Rep'),
(1337,'Bondur','Loui','x6493','[email protected]','4',1102,'Sales
Rep'),
(1370,'Hernandez','Gerard','x2028','[email protected]','4',1102,'Sales
Rep'),
(1401,'Castillo','Pamela','x2759','[email protected]','4',1102,'Sales
Rep'),
(1501,'Bott','Larry','x2311','[email protected]','7',1102,'Sales
Rep'),
(1504,'Jones','Barry','x102','[email protected]','7',1102,'Sales
Rep'),
(1611,'Fixter','Andy','x101','[email protected]','6',1088,'Sales
Rep'),
(1612,'Marsh','Peter','x102','[email protected]','6',1088,'Sales
Rep'),
(1619,'King','Tom','x103','[email protected]','6',1088,'Sales
Rep'),
(1621,'Nishi','Mami','x101','[email protected]','5',1056,'Sales
Rep'),
(1625,'Kato','Yoshimi','x102','[email protected]','5',1621,'Sales
Rep'),
(1702,'Gerard','Martin','x2312','[email protected]','4',1102,'Sales
Rep');
/*Table structure for table `offices` */
DROP TABLE IF EXISTS `offices`;
CREATE TABLE `offices` (
`officeCode` varchar(10) NOT NULL,
`city` varchar(50) NOT NULL,
`phone` varchar(50) NOT NULL,
`addressLine1` varchar(50) NOT NULL,
`addressLine2` varchar(50) DEFAULT NULL,
`state` varchar(50) DEFAULT NULL,
`country` varchar(50) NOT NULL,
`postalCode` varchar(15) NOT NULL,
`territory` varchar(10) NOT NULL,
PRIMARY KEY (`officeCode`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `offices` */
insert into
`offices`(`officeCode`,`city`,`phone`,`addressLine1`,`addressLine2`,`state`,`country`,`postalCode`,`territory`)
values
('1','San Francisco','+1 650 219 4782','100 Market Street','Suite
300','CA','USA','94080','NA'),
('2','Boston','+1 215 837 0825','1550 Court Place','Suite
102','MA','USA','02107','NA'),
('3','NYC','+1 212 555 3000','523 East 53rd Street','apt.
5A','NY','USA','10022','NA'),
('4','Paris','+33 14 723 4404','43 Rue Jouffroy
D\'abbans',NULL,NULL,'France','75017','EMEA'),
('5','Tokyo','+81 33 224 5000','4-1
Kioicho',NULL,'Chiyoda-Ku','Japan','102-8578','Japan'),
('6','Sydney','+61 2 9264 2451','5-11 Wentworth Avenue','Floor
#2',NULL,'Australia','NSW 2010','APAC'),
('7','London','+44 20 7877 2041','25 Old Broad Street','Level
7',NULL,'UK','EC2N 1HN','EMEA');
/*Table structure for table `orderdetails` */
DROP TABLE IF EXISTS `orderdetails`;
CREATE TABLE `orderdetails` (
`orderNumber` int(11) NOT NULL,
`productCode` varchar(15) NOT NULL,
`quantityOrdered` int(11) NOT NULL,
`priceEach` decimal(10,2) NOT NULL,
`orderLineNumber` smallint(6) NOT NULL,
PRIMARY KEY (`orderNumber`,`productCode`),
KEY `productCode` (`productCode`),
CONSTRAINT `orderdetails_ibfk_1` FOREIGN KEY (`orderNumber`)
REFERENCES `orders` (`orderNumber`),
CONSTRAINT `orderdetails_ibfk_2` FOREIGN KEY (`productCode`)
REFERENCES `products` (`productCode`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `orderdetails` */
insert into
`orderdetails`(`orderNumber`,`productCode`,`quantityOrdered`,`priceEach`,`orderLineNumber`)
values
(10100,'S18_1749',30,'136.00',3),
(10197,'S700_3505',27,'100.17',10),
(10197,'S700_3962',35,'88.39',11),
(10197,'S72_1253',29,'39.73',1),
(10197,'S72_3212',42,'48.59',12),
(10198,'S18_1662',42,'149.81',4),
(10198,'S24_2841',48,'60.97',5),
(10198,'S24_3420',27,'61.81',6),
(10198,'S24_3949',43,'65.51',3),
(10198,'S700_2466',42,'94.73',1),
(10201,'S18_2625',30,'48.46',6),
(10201,'S24_1578',39,'93.54',3),
(10201,'S24_2000',25,'66.27',7),
(10202,'S18_3782',30,'55.33',3),
(10202,'S18_4721',43,'124.99',2),
(10202,'S24_2360',50,'56.10',6),
(10202,'S24_4620',50,'75.18',1),
(10425,'S24_2300',49,'127.79',9),
(10425,'S24_2840',31,'31.82',5),
(10425,'S32_1268',41,'83.79',11),
(10425,'S32_2509',11,'50.32',6),
(10425,'S50_1392',18,'94.92',2);
/*Table structure for table `orders` */
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
`orderNumber` int(11) NOT NULL,
`orderDate` date NOT NULL,
`requiredDate` date NOT NULL,
`shippedDate` date DEFAULT NULL,
`status` varchar(15) NOT NULL,
`comments` text,
`customerNumber` int(11) NOT NULL,
PRIMARY KEY (`orderNumber`),
KEY `customerNumber` (`customerNumber`),
CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`customerNumber`)
REFERENCES `customers` (`customerNumber`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `orders` */
insert into
`orders`(`orderNumber`,`orderDate`,`requiredDate`,`shippedDate`,`status`,`comments`,`customerNumber`)
values
(10100,'2003-01-06','2003-01-13','2003-01-10','Shipped',NULL,363),
(10101,'2003-01-09','2003-01-18','2003-01-11','Shipped','Check on
availability.',128),
(10102,'2003-01-10','2003-01-18','2003-01-14','Shipped',NULL,181),
(10103,'2003-01-29','2003-02-07','2003-02-02','Shipped',NULL,121),
(10104,'2003-01-31','2003-02-09','2003-02-01','Shipped',NULL,141),
(10105,'2003-02-11','2003-02-21','2003-02-12','Shipped',NULL,145),
(10106,'2003-02-17','2003-02-24','2003-02-21','Shipped',NULL,278),
(10107,'2003-02-24','2003-03-03','2003-02-26','Shipped','Difficult
to negotiate with customer. We need more marketing
materials',131),
(10108,'2003-03-03','2003-03-12','2003-03-08','Shipped',NULL,385),
(10422,'2005-05-30','2005-06-11',NULL,'In Process',NULL,157),
(10423,'2005-05-30','2005-06-05',NULL,'In Process',NULL,314),
(10424,'2005-05-31','2005-06-08',NULL,'In Process',NULL,141),
(10425,'2005-05-31','2005-06-07',NULL,'In Process',NULL,119);
/*Table structure for table `payments` */
DROP TABLE IF EXISTS `payments`;
CREATE TABLE `payments` (
`customerNumber` int(11) NOT NULL,
`checkNumber` varchar(50) NOT NULL,
`paymentDate` date NOT NULL,
`amount` decimal(10,2) NOT NULL,
PRIMARY KEY (`customerNumber`,`checkNumber`),
CONSTRAINT `payments_ibfk_1` FOREIGN KEY (`customerNumber`)
REFERENCES `customers` (`customerNumber`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `payments` */
insert into
`payments`(`customerNumber`,`checkNumber`,`paymentDate`,`amount`)
values
(103,'HQ336336','2004-10-19','6066.78'),
(103,'JM555205','2003-06-05','14571.44'),
(103,'OM314933','2004-12-18','1676.14'),
(112,'BO864823','2004-12-17','14191.12'),
(112,'HQ55022','2003-06-06','32641.98'),
(112,'ND748579','2004-08-20','33347.88'),
(114,'GG31455','2003-05-20','45864.03'),
(114,'MA765515','2004-12-15','82261.22'),
(114,'NP603840','2003-05-31','7565.08'),
(114,'NR27552','2004-03-10','44894.74'),
(119,'DB933704','2004-11-14','19501.82'),
(119,'LN373447','2004-08-08','47924.19'),
(119,'NG94694','2005-02-22','49523.67'),
(121,'DB889831','2003-02-16','50218.95'),
(121,'FD317790','2003-10-28','1491.38'),
(121,'KI831359','2004-11-04','17876.32'),
(415,'ER54537','2004-09-28','31310.09'),
(424,'KF480160','2004-12-07','25505.98'),
(424,'LM271923','2003-04-16','21665.98'),
(424,'OA595449','2003-10-31','22042.37'),
(447,'AO757239','2003-09-15','6631.36'),
(447,'ER615123','2003-06-25','17032.29'),
(496,'MN89921','2004-12-31','52166.00');
/*Table structure for table `productlines` */
DROP TABLE IF EXISTS `productlines`;
CREATE TABLE `productlines` (
`productLine` varchar(50) NOT NULL,
`textDescription` varchar(4000) DEFAULT NULL,
`htmlDescription` mediumtext,
`image` mediumblob,
PRIMARY KEY (`productLine`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `productlines` */
insert into
`productlines`(`productLine`,`textDescription`,`htmlDescription`,`image`)
values
('Classic Cars','Attention car enthusiasts: Make your wildest car
ownership dreams come true. Whether you are looking for classic
muscle cars, dream sports cars or movie-inspired miniatures, you
will find great choices in this category. These replicas feature
superb attention to detail and craftsmanship and offer features
such as working steering system, opening forward compartment,
opening rear trunk with removable spare wheel, 4-wheel independent
spring suspension, and so on. The models range in size from 1:10 to
1:24 scale and include numerous limited edition and several
out-of-production vehicles. All models include a certificate of
authenticity from their manufacturers and come fully assembled and
ready for display in the home or office.',NULL,NULL),
('Motorcycles','Our motorcycles are state of the art replicas of
classic as well as contemporary motorcycle legends such as Harley
Davidson, Ducati and Vespa. Models contain stunning details such as
official logos, rotating wheels, working kickstand, front
suspension, gear-shift lever, footbrake lever, and drive chain.
Materials used include diecast and plastic. The models range in
size from 1:10 to 1:50 scale and include numerous limited edition
and several out-of-production vehicles. All models come fully
assembled and ready for display in the home or office. Most include
a certificate of authenticity.',NULL,NULL),
('Planes','Unique, diecast airplane and helicopter replicas
suitable for collections, as well as home, office or classroom
decorations. Models contain stunning details such as official logos
and insignias, rotating jet engines and propellers, retractable
wheels, and so on. Most come fully assembled and with a certificate
of authenticity from their manufacturers.',NULL,NULL),
('Vintage Cars','Our Vintage Car models realistically portray
automobiles produced from the early 1900s through the 1940s.
Materials used include Bakelite, diecast, plastic and wood. Most of
the replicas are in the 1:18 and 1:24 scale sizes, which provide
the optimum in detail and accuracy. Prices range from $30.00 up to
$180.00 for some special limited edition replicas. All models
include a certificate of authenticity from their manufacturers and
come fully assembled and ready for display in the home or
office.',NULL,NULL);
/*Table structure for table `products` */
DROP TABLE IF EXISTS `products`;
CREATE TABLE `products` (
`productCode` varchar(15) NOT NULL,
`productName` varchar(70) NOT NULL,
`productLine` varchar(50) NOT NULL,
`productScale` varchar(10) NOT NULL,
`productVendor` varchar(50) NOT NULL,
`productDescription` text NOT NULL,
`quantityInStock` smallint(6) NOT NULL,
`buyPrice` decimal(10,2) NOT NULL,
`MSRP` decimal(10,2) NOT NULL,
PRIMARY KEY (`productCode`),
KEY `productLine` (`productLine`),
CONSTRAINT `products_ibfk_1` FOREIGN KEY (`productLine`) REFERENCES
`productlines` (`productLine`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `products` */
insert into
`products`(`productCode`,`productName`,`productLine`,`productScale`,`productVendor`,`productDescription`,`quantityInStock`,`buyPrice`,`MSRP`)
values
('S24_2011','18th century schooner','Ships','1:24','Carousel
DieCast Legends','All wood with canvas sails. Many extras including
rigging, long boats, pilot house, anchors, etc. Comes with 4 masts,
all square-rigged.',1898,'82.34','122.89'),
('S24_2022','1938 Cadillac V-16 Presidential Limousine','Vintage
Cars','1:24','Classic Metal Creations','This 1:24 scale precision
die cast replica of the 1938 Cadillac V-16 Presidential Limousine
has all the details of the original, from the flags on the front to
an opening back seat compartment complete with telephone and rifle.
Features factory baked-enamel black finish, hood goddess ornament,
working jump seats.',2847,'20.61','44.80'),
('S24_2300','1962 Volkswagen Microbus','Trucks and
Buses','1:24','Autoart Studio Design','This 1:18 scale die cast
replica of the 1962 Microbus is loaded with features: A working
steering system, opening front doors and tailgate, and famous
two-tone factory baked enamel finish, are all topped of by the
sliding, real fabric, sunroof.',2327,'61.34','127.79'),
('S24_2360','1982 Ducati 900 Monster','Motorcycles','1:24','Highway
66 Mini Classics','Features two-tone paint with chrome accents,
superior die-cast detail , rotating wheels , working kick
stand',6840,'47.10','69.26'),
('S24_2766','1949 Jaguar XK 120','Classic Cars','1:24','Classic
Metal Creations','Precision-engineered from original Jaguar
specification in perfect scale ratio. Features opening doors,
superb detail and craftsmanship, working steering system, opening
forward compartment, opening rear trunk with removable spare, 4
wheel independent spring suspension as well as factory baked enamel
finish.',2350,'47.25','90.87'),
('S24_2840','1958 Chevy Corvette Limited Edition','Classic
Cars','1:24','Carousel DieCast Legends','The operating parts of
this 1958 Chevy Corvette Limited Edition are particularly delicate
due to their precise scale and require special care and attention.
Features rotating wheels, working streering, opening doors and
trunk. Color dark green.',2542,'15.91','35.36'),
('S24_2841','1900s Vintage Bi-Plane','Planes','1:24','Autoart
Studio Design','Hand crafted diecast-like metal bi-plane is
re-created in about 1:24 scale of antique pioneer airplane. All
hand-assembled with many different parts. Hand-painted in classic
yellow and features correct markings of original
airplane.',5942,'34.25','68.51'),
('S700_3962','The Queen Mary','Ships','1:700','Welly Diecast
Productions','Exact replica. Wood and Metal. Many extras including
rigging, long boats, pilot house, anchors, etc. Comes with three
masts, all square-rigged.',5088,'53.63','99.31'),
('S700_4002','American Airlines: MD-11S','Planes','1:700','Second
Gear Diecast','Polished finish. Exact replia with official logos
and insignias and retractable wheels',8820,'36.27','74.03'),
('S72_1253','Boeing X-32A JSF','Planes','1:72','Motor City Art
Classics','10\" Wingspan with retractable landing gears.Comes with
pilot',4857,'32.77','49.66'),
('S72_3212','Pont Yacht','Ships','1:72','Unimax Art
Galleries','Measures 38 inches Long x 33 3/4 inches High. Includes
a stand.\r\nMany extras including rigging, long boats, pilot house,
anchors, etc. Comes with 2 masts, all
square-rigged',414,'33.30','54.60');
------------------------------------------------------------------------------------------------------------------------------------------
Database Table Diagram:
classicmodels