1.Import the data from each file into tables. a.Use the import utility of your database program to load the data from each file into the table of the same name. You will perform this step three times, once for each table.
b.Provide the SQL commands you ran against MySQL to complete this successfully in your answer:
LOAD DATA INFILE ‘/home/codio/workspace/customers.csv
INTO TABLE Customers
FIELDS TERMINATED BY ‘,’
ENCLOSED BY “” LINES TERMINATED BY ‘\n’;
LOAD DATA INFILE ‘/home/codio/workspace/orders.csv
INTO TABLE Orders
FIELDS TERMINATED BY ‘,’
ENCLOSED BY ‘”’ LINES TERMINATED BY ‘\n’;
LOAD DATA INFILE ‘/home/codio/workspace/rma.csv
INTO TABLE RMA
FIELDS TERMINATED BY ‘,’
ENCLOSED BY ‘”’
LINES TERMINATED BY ‘\n’;
Before I begin, I load the local CSV files provided for the project with three separate LOAD statements. 2.Write basic queries against imported tables to organize and analyze targeted data. For each query, include a screenshot of the query and its output. You should also include a brief, 1-3 sentence description of the output.
a.Write an SQL query that returns the count of orders for customers located only in the city of Framingham, Massachusetts i.How many records were returned?
SELECT COUNT(*)
FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
WHERE Customers.city = 'Framingham' AND Customers.state = 'Massachusetts';
The total records presented of customer orders from Framingham, MA was 505.
While we could visibly display every customer from Massachusetts in this exercise, it would be incredibly inefficient. To complete this task, we utilize a SELECT COUNT()