1DATABASE IMPLEMENTATION Create Tables: CREATE TABLE `customer` ( `customerID` int(11) NOT NULL, `lastName` varchar(200) NOT NULL, `firstName` varchar(200) NOT NULL, `streetAddress` varchar(200) NOT NULL, `city` varchar(200) NOT NULL, `state` varchar(20) NOT NULL, `zipCode` int(11) NOT NULL, `currentBalance` decimal(12,2) NOT NULL, `creditLimit` int(11) NOT NULL, `salesRepID` int(11) NOT NULL ); CREATE TABLE `orderlines` ( `orderID` int(11) NOT NULL, `partID` char(10) NOT NULL, `numberOrdered` int(11) NOT NULL, `quotedPrice` decimal(12,2) NOT NULL
2DATABASE IMPLEMENTATION ); CREATE TABLE `orders` ( `orderID` int(11) NOT NULL, `orderDate` date NOT NULL, `customerID` int(11) NOT NULL, `shippingDate` date DEFAULT NULL ); CREATE TABLE `parts` ( `partID` char(10) NOT NULL, `partDescription` varchar(200) NOT NULL, `unitsOnHand` int(11) NOT NULL, `class` char(5) NOT NULL, `warehouseNumber` int(11) NOT NULL, `unitPrice` decimal(12,2) NOT NULL ); CREATE TABLE `salesregion` ( `regionID` char(5) NOT NULL, `regionDescription` varchar(200) NOT NULL,
3DATABASE IMPLEMENTATION `salesRepID` int(11) NOT NULL ); CREATE TABLE `salesrepresentatives` ( `salesRepID` int(11) NOT NULL, `lastName` varchar(200) NOT NULL, `firstName` varchar(200) NOT NULL, `streetAddress` varchar(200) NOT NULL, `city` varchar(200) NOT NULL, `state` varchar(20) NOT NULL, `zipCode` int(11) NOT NULL, `totalCommission` decimal(12,2) NOT NULL, `commissionRate` decimal(12,2) NOT NULL ); ALTER TABLE `customer` ADD PRIMARY KEY (`customerID`), ADD KEY `salesRepID` (`salesRepID`); ALTER TABLE `orderlines` ADD PRIMARY KEY (`orderID`,`partID`),
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
8DATABASE IMPLEMENTATION select * from parts; Select customer ordered parts selectconcat(customer.lastName,'',customer.firstName)ASCustomer_Name, parts.partDescriptionfromcustomerINNERJOINordersoncustomer.customerID= orders.customerID INNER JOIN orderlines on orders.orderID = orderlines.orderID INNER JOIN parts on orderlines.partID = parts.partID;
9DATABASE IMPLEMENTATION Bibliography: Anderson, D., 2018. Modeling and Analysis of SQL Queries in PHP Systems. Challawala, S., Lakhatariya, J., Mehta, C. and Patel, K., 2017. MySQL 8 for Big Data: Effective Data Processing with MySQL 8, Hadoop, NoSQL APIs, and Other Big Data Tools. Packt Publishing Ltd.