Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions 02_activities/assignments/DC_Cohort/Assignment1.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,10 @@ Consider, for example, concepts of fariness, inequality, social structures, marg

```
Your thoughts...

In many websites of South Korean companies and government institutions, the input fields for last names and first names often have character limits that reflect a cultural assumption that South Korea is a homogenous society. For example, most Korean last names consist of only one character in the Korean alphabet (Hangul). Among others, most commons are Kim, Lee, Park, and Jung. All of them are one character in Hangul. As a result, many websites are designed to limit the number of characters in the last name field to just one or maximum two. While this may seem like a minor technical detail, it carries significant social implications that are becoming increasingly problematic.
This design choice creates a logistical issue for a growing segment of population. South Korea has seen a steady rise in the number of immigrants, foreign nationals, and multicultural families over the past few decades. Individuals with names rooted in other languages and writing systems — such as those from Southeast Asia, Central Asia, or European countries — often find that their names simply do not fit within these narrow character limits. As a result, they often do not have any choice but shorten or misrepresent their legal names to complete an online registration process.
This issue reveals the Korean society's self-perception. The persistence of such design limitations suggests that many institutions continue to operate under the strong cultural ideology that Korea is a homogeneous country. However, this is no longer an accurate reflection of reality, as South Korea is becoming an increasingly diverse and multicultural society.


```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 58 additions & 38 deletions 02_activities/assignments/DC_Cohort/assignment1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,42 @@
/* 1. Write a query that returns everything in the customer table. */
--QUERY 1



SELECT* FROM customer;

--END QUERY


/* 2. Write a query that displays all of the columns and 10 rows from the customer table,
sorted by customer_last_name, then customer_first_ name. */
--QUERY 2



SELECT * FROM customer
ORDER BY customer_last_name, customer_first_name
LIMIT 10;

--END QUERY


--WHERE
/* 1. Write a query that returns all customer purchases of product IDs 4 and 9.
Limit to 25 rows of output. */
--QUERY 3
SELECT *
FROM customer_purchases
WHERE customer_id = 4 OR customer_id = 9
LIMIT 25;


--END QUERY

/*2. Write a query that returns all customer purchases and a new calculated column 'price' (quantity * cost_to_customer_per_qty),
filtered by customer IDs between 8 and 10 (inclusive) using either:
1. two conditions using AND
2. one condition using BETWEEN
Limit to 25 rows of output.
*/
--QUERY 3




--QUERY 4
SELECT *, quantity*cost_to_customer_per_qty AS price
FROM customer_purchases
WHERE customer_id BETWEEN 8 and 10
LIMIT 25;
--END QUERY


Expand All @@ -48,46 +51,55 @@ Limit to 25 rows of output.
Using the product table, write a query that outputs the product_id and product_name
columns and add a column called prod_qty_type_condensed that displays the word “unit”
if the product_qty_type is “unit,” and otherwise displays the word “bulk.” */
--QUERY 4


--QUERY 5

SELECT product_id, product_name
,CASE WHEN product_qty_type = 'unit' THEN 'unit'
ELSE 'bulk'
END as prod_qty_type_condensed
FROM product;

--END QUERY


/* 2. We want to flag all of the different types of pepper products that are sold at the market.
add a column to the previous query called pepper_flag that outputs a 1 if the product_name
contains the word “pepper” (regardless of capitalization), and otherwise outputs 0. */
--QUERY 5



--QUERY 6
SELECT product_id, product_name
,CASE WHEN product_qty_type = 'unit' THEN 'unit'
ELSE 'bulk'
END as prod_qty_type_condensed
,CASE WHEN product_name LIKE '%pepper%'
THEN 1
ELSE 0
END AS pepper_flag
FROM product;

--END QUERY


--JOIN
/* 1. Write a query that INNER JOINs the vendor table to the vendor_booth_assignments table on the
vendor_id field they both have in common, and sorts the result by market_date, then vendor_name.
Limit to 24 rows of output. */
--QUERY 6




--QUERY 7
SELECT market_date, vendor_name, vendor.vendor_id
FROM vendor
INNER JOIN vendor_booth_assignments
ON vendor_booth_assignments.vendor_id = vendor.vendor_id
ORDER BY market_date, vendor_name;
--END QUERY



/* SECTION 3 */

-- AGGREGATE
/* 1. Write a query that determines how many times each vendor has rented a booth
at the farmer’s market by counting the vendor booth assignments per vendor_id. */
--QUERY 7


--QUERY 8
SELECT vendor_id, count(vendor_id) as n_of_rents
FROM vendor_booth_assignments
GROUP BY vendor_id;


--END QUERY
Expand All @@ -98,10 +110,14 @@ sticker to everyone who has ever spent more than $2000 at the market. Write a qu
of customers for them to give stickers to, sorted by last name, then first name.

HINT: This query requires you to join two tables, use an aggregate function, and use the HAVING keyword. */
--QUERY 8



--QUERY 9
SELECT c.customer_last_name, c.customer_first_name, c.customer_id,
SUM(cp.quantity*cp.cost_to_customer_per_qty) as total_spend
FROM customer_purchases as cp
INNER JOIN customer as c
ON cp.customer_id = c.customer_id
GROUP BY c.customer_last_name, c.customer_first_name
HAVING total_spend > 2000;

--END QUERY

Expand All @@ -117,10 +133,14 @@ When inserting the new vendor, you need to appropriately align the columns to be
-> To insert the new row use VALUES, specifying the value you want for each column:
VALUES(col1,col2,col3,col4,col5)
*/
--QUERY 9


--QUERY 10
DROP TABLE IF EXISTS temp.new_vendor;
CREATE TABLE temp.new_vendor AS
SELECT *
FROM vendor;

INSERT INTO temp.new_vendor
VALUES ('10', 'Thomass Superfood Store', 'Fresh Focused', 'Thomas', 'Rosenthal')

--END QUERY

Expand All @@ -131,7 +151,7 @@ VALUES(col1,col2,col3,col4,col5)
HINT: you might need to search for strfrtime modifers sqlite on the web to know what the modifers for month
and year are!
Limit to 25 rows of output. */
--QUERY 10
--QUERY 11



Expand All @@ -145,7 +165,7 @@ Remember that money spent is quantity*cost_to_customer_per_qty.
HINTS: you will need to AGGREGATE, GROUP BY, and filter...
but remember, STRFTIME returns a STRING for your WHERE statement...
AND be sure you remove the LIMIT from the previous query before aggregating!! */
--QUERY 11
--QUERY 12



Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 26 additions & 6 deletions 04_this_cohort/custom_slides/markdown/slides_01.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ class: left, top, inverse
# About Us (Dmytro)

.pull-left[
Combines business acumen with technical expertise in software development, AI/ML, and system design
Holds a Masters degree in Business Administration; IT professional with experience in C#, Python, and modern AI tools, working on real-world and educational projects
Has experience in international technology companies such as HP, focusing on business development and client solutions
Experienced in project management (IPMA certified) and cross-functional collaboration
Hands-on builder with interests in robotics, electronics, and 3D modeling
Hobbies: DIY projects, robotics, hockey with kids
- Combines business acumen with technical expertise in software development, AI/ML, and system design
- Holds a Masters degree in Business Administration; IT professional with experience in C#, Python, and modern AI tools, working on real-world and educational projects
- Has experience in international technology companies such as HP, focusing on business development and client solutions
- Experienced in project management (IPMA certified) and cross-functional collaboration
- Hands-on builder with interests in robotics, electronics, and 3D modeling
- Hobbies: DIY projects, robotics, hockey with kids
]

.pull-right[
Expand Down Expand Up @@ -359,7 +359,9 @@ For live coding:
--

Check out our [post-installation videos](https://drive.proton.me/urls/SNKJ5KR6TM#A6l8phhXgTHd):
- Using the SQL Etherpad
- Changing you DB Browser for SQLite Preferences
- SQLite File Types
- How to Open a Database
- What is the Execute SQL Window
- How to use SQLite Projects
Expand Down Expand Up @@ -503,6 +505,8 @@ class: top, left, inverse

--

.pull-left.w68[

- We are using SQLite:
- Super easy to get setup
- Requires almost no overhead
Expand All @@ -514,6 +518,22 @@ class: top, left, inverse
- SQLite DBs are embedded in home automation devices, smart devices, etc
- Both Andriod and iOS apps use SQLite as the default database engine
- Completely encrypted when necessary supporting e2e messaging, like Signal/WhatsApp

]

.pull-right.w30[
.center[
<img src="imgs/01_sqlite_best.png"
height="300px";>
]
]

.center[
<sup><sup><sup><sup> Image: Unknown meme creator </sup></sup></sup></sup>
]




---

Expand Down
32 changes: 26 additions & 6 deletions 04_this_cohort/custom_slides/markdown/slides_01.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@
# About Us (Dmytro)

.pull-left[
Combines business acumen with technical expertise in software development, AI/ML, and system design
Holds a Masters degree in Business Administration; IT professional with experience in C#, Python, and modern AI tools, working on real-world and educational projects
Has experience in international technology companies such as HP, focusing on business development and client solutions
Experienced in project management (IPMA certified) and cross-functional collaboration
Hands-on builder with interests in robotics, electronics, and 3D modeling
Hobbies: DIY projects, robotics, hockey with kids
- Combines business acumen with technical expertise in software development, AI/ML, and system design
- Holds a Masters degree in Business Administration; IT professional with experience in C#, Python, and modern AI tools, working on real-world and educational projects
- Has experience in international technology companies such as HP, focusing on business development and client solutions
- Experienced in project management (IPMA certified) and cross-functional collaboration
- Hands-on builder with interests in robotics, electronics, and 3D modeling
- Hobbies: DIY projects, robotics, hockey with kids
]

.pull-right[
Expand Down Expand Up @@ -347,7 +347,9 @@
--

Check out our [post-installation videos](https://drive.proton.me/urls/SNKJ5KR6TM#A6l8phhXgTHd):
- Using the SQL Etherpad
- Changing you DB Browser for SQLite Preferences
- SQLite File Types
- How to Open a Database
- What is the Execute SQL Window
- How to use SQLite Projects
Expand Down Expand Up @@ -491,6 +493,8 @@

--

.pull-left.w68[

- We are using SQLite:
- Super easy to get setup
- Requires almost no overhead
Expand All @@ -502,6 +506,22 @@
- SQLite DBs are embedded in home automation devices, smart devices, etc
- Both Andriod and iOS apps use SQLite as the default database engine
- Completely encrypted when necessary supporting e2e messaging, like Signal/WhatsApp

]

.pull-right.w30[
.center[
&lt;img src="imgs/01_sqlite_best.png"
height="300px";&gt;
]
]

.center[
&lt;sup&gt;&lt;sup&gt;&lt;sup&gt;&lt;sup&gt; Image: Unknown meme creator &lt;/sup&gt;&lt;/sup&gt;&lt;/sup&gt;&lt;/sup&gt;
]




---

Expand Down
Binary file modified 04_this_cohort/custom_slides/pdf/slides_01.pdf
Binary file not shown.
36 changes: 36 additions & 0 deletions 04_this_cohort/live_code/module_2/CASE.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* MODULE 2 */
/* CASE */


SELECT *
/* 1. Add a CASE statement declaring which days vendors should come */
,CASE WHEN vendor_type = 'Fresh Focused' THEN 'Wednesday'
WHEN vendor_type = 'Eggs & Meats' THEN 'Thursday'
ELSE 'Saturday'
END as day_of_specialty


/* 2. Add another CASE statement for Pie Day */
,CASE WHEN vendor_name = "Annie's Pies" -- double quotes okay here
THEN 'Annie is the best'
END as pi_day


/* 3. Add another CASE statement with an ELSE clause to handle rows evaluating to False */
,CASE WHEN vendor_name LIKE '%pie%'
THEN 'Wendesday'
ELSE 'Friday'
END as another_pie_day

FROM vendor;

/* 4. Experiment with selecting a different column instead of just a string value */

SELECT *
,CASE WHEN cost_to_customer_per_qty < 1.00
THEN cost_to_customer_per_qty*5
ELSE cost_to_customer_per_qty
END AS inflation

FROM customer_purchases
--------------------------------------------------------------------------------------------------------------------------------------------
40 changes: 40 additions & 0 deletions 04_this_cohort/live_code/module_2/DISTINCT.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* MODULE 2 */
/* DISTINCT */


/* 1. Compare how many customer_ids are the customer_purchases table, one select with distinct, one without */

-- 4221 rows
SELECT customer_id FROM customer_purchases ;

SELECT DISTINCT customer_id FROM customer_purchases;



/* 2. Compare the difference between selecting market_day in market_date_info, with and without distinct:
what do these difference mean?*/
SELECT market_day
FROM market_date_info;

-- market is only open on 2 days, wed and sat
SELECT DISTINCT market_day
FROM market_date_info;


/* 3. Which vendor has sold products to a customer */
SELECT DISTINCT vendor_id
FROM customer_purchases;


/* 4. Which vendor has sold products to a customer ... and which product was it */
SELECT DISTINCT vendor_id, product_id
FROM customer_purchases;


/* 5. Which vendor has sold products to a customer
... and which product was it?
... AND to whom was it sold*/
SELECT DISTINCT vendor_id, product_id, customer_id
FROM customer_purchases

--------------------------------------------------------------------------------------------------------------------------------------------
Loading
Loading