This is the start of my Mini Project for Northwind database

First I need to preload necessary pkgs to connect with MySQL WorkBench Server

# Set a CRAN mirror to avoid the error
options(repos = c(CRAN = "https://cran.fhcrc.org"))  #  URL of Vietnam CRAN mirror

Installing packages

install.packages("DBI")
install.packages("DiagrammeR")
install.packages("RSQLite")
library(DBI)
library(DiagrammeR)
library(RMySQL)
con <- dbConnect(
  RMySQL::MySQL(),
  dbname = "northwind",
  host = "127.0.0.1",      # or IP address if remote
  port = 3306,             # default MySQL port
  user = "root",
  password = "123"
)

Connecting to database

con <- dbConnect(
  RMySQL::MySQL(),
  dbname = "northwind",
  host = "127.0.0.1",      # or IP address if remote
  port = 3306,             # default MySQL port
  user = "root",
  password = "123"
)

Abstract

I. Introduction

a. Context

  • The northwind company is concerned about the customers and sales quality during the last period, which can be affected by the previous tornado occuring in the main regions the company covered.

  • You are asked to present a brief overview about how things are located in the database and try to confirm your theory by querying necessary outcomes.

b. Background

  • Provide background information, concepts relevant to the project.

  • Discuss previous work or existing systems related to the project.

c. System definition

  • The goal is to query and find relevant information relating to your findings

  • Further insights may come in handy

1. Analysis

a. User requirement by Use cases

  • I don’t know

b. Data Analysis

  • I don’t know

Try to create Schema

My schema
My schema

3. SQL Implementation

a. Database Creation


CREATE TABLE employ (
    Fname VARCHAR(50),
    Minit VARCHAR(50),
    Lname VARCHAR(50)
);

b. Data Insertion

INSERT INTO employ(Fname, Minit, Lname)
VALUES("idk", "nice", "ok"),
      ("haha", "ikr", "notok"),
      ("huhu", "hihi", "haha")

c. Querying and validating result

SELECT *
FROM employ;
3 records
Fname Minit Lname
idk nice ok
haha ikr notok
huhu hihi haha
SELECT * FROM orders
Displaying records 1 - 10
id employee_id customer_id order_date shipped_date shipper_id ship_name ship_address ship_city ship_state_province ship_zip_postal_code ship_country_region shipping_fee taxes payment_type paid_date notes tax_rate tax_status_id status_id
30 9 27 2006-01-15 00:00:00 2006-01-22 00:00:00 2 Karen Toh 789 27th Street Las Vegas NV 99999 USA 200 0 Check 2006-01-15 00:00:00 NA 0 NA 3
31 3 4 2006-01-20 00:00:00 2006-01-22 00:00:00 1 Christina Lee 123 4th Street New York NY 99999 USA 5 0 Credit Card 2006-01-20 00:00:00 NA 0 NA 3
32 4 12 2006-01-22 00:00:00 2006-01-22 00:00:00 2 John Edwards 123 12th Street Las Vegas NV 99999 USA 5 0 Credit Card 2006-01-22 00:00:00 NA 0 NA 3
33 6 8 2006-01-30 00:00:00 2006-01-31 00:00:00 3 Elizabeth Andersen 123 8th Street Portland OR 99999 USA 50 0 Credit Card 2006-01-30 00:00:00 NA 0 NA 3
34 9 4 2006-02-06 00:00:00 2006-02-07 00:00:00 3 Christina Lee 123 4th Street New York NY 99999 USA 4 0 Check 2006-02-06 00:00:00 NA 0 NA 3
35 3 29 2006-02-10 00:00:00 2006-02-12 00:00:00 2 Soo Jung Lee 789 29th Street Denver CO 99999 USA 7 0 Check 2006-02-10 00:00:00 NA 0 NA 3
36 4 3 2006-02-23 00:00:00 2006-02-25 00:00:00 2 Thomas Axen 123 3rd Street Los Angelas CA 99999 USA 7 0 Cash 2006-02-23 00:00:00 NA 0 NA 3
37 8 6 2006-03-06 00:00:00 2006-03-09 00:00:00 2 Francisco Pérez-Olaeta 123 6th Street Milwaukee WI 99999 USA 12 0 Credit Card 2006-03-06 00:00:00 NA 0 NA 3
38 9 28 2006-03-10 00:00:00 2006-03-11 00:00:00 3 Amritansh Raghav 789 28th Street Memphis TN 99999 USA 10 0 Check 2006-03-10 00:00:00 NA 0 NA 3
39 3 8 2006-03-22 00:00:00 2006-03-24 00:00:00 3 Elizabeth Andersen 123 8th Street Portland OR 99999 USA 5 0 Check 2006-03-22 00:00:00 NA 0 NA 3

4. Conclusion

5. References

6. Appendices