Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 68 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
SELECT contact_name, city, country
FROM customers
WHERE city = 'London'

```

Expand All @@ -48,6 +51,9 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
SELECT contact_name, city, country, postal_code
FROM customers
WHERE postal_code = '1010'

```

Expand All @@ -59,6 +65,9 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
SELECT contact_name, phone
FROM suppliers
WHERE supplier_id = '11'

```

Expand All @@ -70,6 +79,10 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
SELECT order_date
FROM orders
ORDER BY order_date DESC


```

Expand All @@ -82,6 +95,9 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
SELECT contact_name
FROM suppliers
WHERE length(company_name) > 20

```

Expand All @@ -95,6 +111,9 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
SELECT contact_title
FROM customers
WHERE UPPER(contact_title) LIKE ('%MARKET%')

```

Expand All @@ -112,6 +131,8 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
INSERT INTO customers(customer_id, company_name, contact_name, address, city, postal_code, country)
VALUES('SHIRE', 'THE SHIRE', 'Bilbo Baggins', '1 Hobbit-Hole', 'Bag End', '111', 'Middle Earth')

```

Expand All @@ -123,6 +144,9 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
UPDATE customers
SET postal_code = '11122'
WHERE contact_name = 'SHIRE'

```

Expand All @@ -135,6 +159,11 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
SELECT c.company_name, COUNT(o.order_id)
FROM orders o JOIN customers c
ON o.customer_id = c.customer_id
GROUP BY c.company_name
ORDER BY COUNT(o.order_id) DESC

```

Expand All @@ -146,6 +175,11 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
SELECT c.contact_name, COUNT(o.order_id)
FROM orders o JOIN customers c
ON o.customer_id = c.customer_id
GROUP BY c.contact_name
ORDER BY COUNT(o.order_id) DESC

```

Expand All @@ -157,6 +191,11 @@ Reimport the Northwind database into PostgreSQL using pgAdmin. This is the same
</details>

```SQL
SELECT c.city, COUNT(o.order_id)
FROM orders o JOIN customers c
ON o.customer_id = c.customer_id
GROUP BY c.city
ORDER BY COUNT(o.order_id) DESC

```

Expand All @@ -177,53 +216,34 @@ Below are some empty tables to be used to normalize the database
* Not all of the cells will contain data in the final solution
* Feel free to edit these tables as necessary

Table Name:

| | | | | | | | | |
|------------|------------|------------|------------|------------|------------|------------|------------|------------|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |

Table Name:

| | | | | | | | | |
|------------|------------|------------|------------|------------|------------|------------|------------|------------|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |

Table Name:

| | | | | | | | | |
|------------|------------|------------|------------|------------|------------|------------|------------|------------|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |

Table Name:

| | | | | | | | | |
|------------|------------|------------|------------|------------|------------|------------|------------|------------|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
Table Name: Person Pet quantity table

| Person ID |Person Name | Pets |
|------------|------------|------------|
|1 |Jane | 3 | has 3 pets
|2 |Bob | 1 | has 1 pet
|3 |Sam | 3 | has 3 pets

Table Name: Pet Name + Pet Type Table

| Pet Name | Pet Type | Person ID |
|------------|------------|------------|
|Ellie |Dog | 1 | ___ is a ___ that belongs to person ___
|Joe |Horse | 2 |
|Ginger |Dog | 3 |
|Tiger |Cat | 1 |
|MissKitty |Cat | 3 |
|Toby |Turtle | 1 |
|Bubble |Fish | 3 |

Table Name: Fenced + City Dweller table

| Person ID |Fenced Yard |City Dweller|
|------------|------------|------------|
| 1 | false | true |
| 2 | false | false | person ID who has fenced yard or dweller
| 3 | true | false |


---

Expand All @@ -232,6 +252,7 @@ Table Name:
* [ ] ***delete all customers that have no orders. Should delete 2 (or 3 if you haven't deleted the record added) records***

```SQL


```

Expand Down