From fe7872256e3ae078bdbba730096801f77f635827 Mon Sep 17 00:00:00 2001 From: Ayesha R Date: Sun, 9 Nov 2025 21:26:51 -0500 Subject: [PATCH 1/3] finished assignment 1 --- .../DC_Cohort/DSI_SQL_LOGICAL DATA MODEL.pdf | Bin 0 -> 14356 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 02_activities/assignments/DC_Cohort/DSI_SQL_LOGICAL DATA MODEL.pdf diff --git a/02_activities/assignments/DC_Cohort/DSI_SQL_LOGICAL DATA MODEL.pdf b/02_activities/assignments/DC_Cohort/DSI_SQL_LOGICAL DATA MODEL.pdf new file mode 100644 index 0000000000000000000000000000000000000000..367cbffd4f8b2e8d095cad80d38f6fe6d3fbac58 GIT binary patch literal 14356 zcmbum2RvNe-ZqSg=)Kp`yD>)Zy(C2MErZeP7(IwyqxarL??jI-2%-}q2!ceAgou)N z$X#-u=l#z4&ik18&0c%$f7@&S*R|H#uEne&ugDGJ5yE8df6^b+AKV{;2?Fo}TrBJ{ z#l?X-KCV!p2E+#H4wQ58aE1dwzz23#?#5t*h?c3OBqr3^>PD3RZxvOjvklx9AS?*t z1uEJ(!l5vrq9X(jm4{loSV0jg?r<0s;)Lm)^T~8Pj;XET?ExpuJzaO;><)hOQ7rw^ z6Vg`67cpqHj>Ue34lhnGub8*w6DIa4*|Wh{EU0QDXJM^Psdh@Qm{<&(ELhz&Aew&d9Dc z_Qefz$LWeEbCCpzJCsg_uJP3Zh0v@ z;*n~;{z&g~ziNDZ?(;aM~ zW3yfeex6)-{LLn}^m?W?V5jM@0A5Y^C>qUc2$$M?l$YfaNzOS|Z_NzpGZ;@s<~d`N zh4h{d^SqZWv9mJA^yh^@IoOPooEI%6zh!bBMKk~8bF^ux?LE8xLKnj&oGh0XnJEW2 zn;K#H^aE0Le9`C2va~%hNa4=bk4WT=9#zgVo(LOfd7{0rOcGWi^Sv8m%_T6=sfs7P z9!5}5?t*HarJ`3}M&5-NG8S1;tXf%)U8rdso>B&Q#ccNgtt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!--|jq0sn{+ z5vP@vEUXKg79-&S%5?Y_(39kR)YMuxAafle;QSB zc85cpEusG}Mt{@2HTvs;{MPwyyY+3xA^J4}9e{tq1LEW_bU`d;B^bPJ;NyQRYXyH> zmi!4^fLlnrS=S==dHu1hRfE7BRGh6{5Hr-9BGd|iSjr-HZvp>=dcYr0tBU9AKy5o;C_oSl)HenJ_yK&Th{5Au_pkk$`x$6Kt^bB~?;P&wWsH7T?2+Tu1I~%kKw37Zb)H2Sk1pA;GIh_;S*@PIc6S4l9QT4cQ{}g zmkCF>bkKm{2tsdZa+8grNe1c-6m@7jX~V0+?$}4zKc`Ws2opkyOX%+yj>^ztYJ?J| z6r$)plcAxul_oNpMk5oQ4x{y+jzGrli@;EQ#oC`DY1I-0?n-6TYE|vb9>oL0sb&6W aJ|J=x2KPoh9!wBeM3^6wnOQ+y@&5p@Z{_p= literal 0 HcmV?d00001 From 1466f9bc04bd249a57a0b62899cb514bad8fc1b5 Mon Sep 17 00:00:00 2001 From: Ayesha R Date: Sun, 9 Nov 2025 21:37:28 -0500 Subject: [PATCH 2/3] assign1 sql file --- .../assignments/DC_Cohort/assignment1.sql | 48 +++++++++++++++++-- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/02_activities/assignments/DC_Cohort/assignment1.sql b/02_activities/assignments/DC_Cohort/assignment1.sql index c992e3205..e5d6baa8a 100644 --- a/02_activities/assignments/DC_Cohort/assignment1.sql +++ b/02_activities/assignments/DC_Cohort/assignment1.sql @@ -1,20 +1,29 @@ /* ASSIGNMENT 1 */ /* SECTION 2 */ +/* Ayesha Rashidi */ --SELECT /* 1. Write a query that returns everything in the customer table. */ - +SELECT * +FROM customer; /* 2. Write a query that displays all of the columns and 10 rows from the cus- tomer table, sorted by customer_last_name, then customer_first_ name. */ +SELECT * +FROM customer +ORDER BY customer_last_name, customer_first_name +LIMIT 10; --WHERE /* 1. Write a query that returns all customer purchases of product IDs 4 and 9. */ +SELECT * +FROM customer_purchases +WHERE product_id IN (4, 9); /*2. Write a query that returns all customer purchases and a new calculated column 'price' (quantity * cost_to_customer_per_qty), @@ -24,10 +33,17 @@ filtered by customer IDs between 8 and 10 (inclusive) using either: */ -- option 1 +SELECT *, + (quantity * cost_to_customer_per_qty) AS price +FROM customer_purchases +WHERE customer_id >= 8 AND customer_id <= 10; -- option 2 - +SELECT *, + (quantity * cost_to_customer_per_qty) AS price +FROM customer_purchases +WHERE customer_id BETWEEN 8 AND 10; --CASE /* 1. Products can be sold by the individual unit or by bulk measures like lbs. or oz. @@ -35,20 +51,42 @@ Using the product table, write a query that outputs the product_id and product_n 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.” */ +SELECT product_id, + product_name, + CASE + WHEN product_qty_type = 'unit' + THEN 'unit' + ELSE 'bulk' + END AS prod_qty_type_condensed +FROM product; /* 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. */ - +SELECT product_id, + product_name, + CASE + WHEN product_qty_type = 'unit' + THEN 'unit' + ELSE 'bulk' + END AS prod_qty_type_condensed, + CASE + WHEN LOWER(product_name) LIKE '%pepper%' THEN 1 + ELSE 0 + END AS pepper_flag +FROM product; --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 vendor_name, then market_date. */ - - +SELECT * +FROM vendor v +INNER JOIN vendor_booth_assignments vba + ON v.vendor_id = vba.vendor_id +ORDER BY v.vendor_name, vba.market_date; /* SECTION 3 */ From 0fbf82e5abe6e7ac4646dd1c03d1afc78bbaecc8 Mon Sep 17 00:00:00 2001 From: Ayesha R Date: Thu, 20 Nov 2025 21:18:29 -0500 Subject: [PATCH 3/3] Finalized Assign 1: Section 3 +4 --- 02_activities/assignments/DC_Cohort/.Rhistory | 0 .../assignments/DC_Cohort/Assignment1.md | 9 +++++- .../assignments/DC_Cohort/assignment1.sql | 31 ++++++++++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 02_activities/assignments/DC_Cohort/.Rhistory diff --git a/02_activities/assignments/DC_Cohort/.Rhistory b/02_activities/assignments/DC_Cohort/.Rhistory new file mode 100644 index 000000000..e69de29bb diff --git a/02_activities/assignments/DC_Cohort/Assignment1.md b/02_activities/assignments/DC_Cohort/Assignment1.md index f78778f5b..5db1ee553 100644 --- a/02_activities/assignments/DC_Cohort/Assignment1.md +++ b/02_activities/assignments/DC_Cohort/Assignment1.md @@ -205,5 +205,12 @@ Consider, for example, concepts of fariness, inequality, social structures, marg ``` -Your thoughts... + +In our daily lives we interact with databases and data systems that may seem neutral, but embed value systems shaped by the broader social structures in which they are created and deployed. When a system records only “standard” categories (e.g., male/female gender, certain ethnic groups, binary race options) or uses algorithms that assume typical behaviour as baseline, it privileges dominant populations and implicitly marginalizes those who don’t fit. Technology then becomes a mechanism through which existing social inequalities or power structures are reproduced. +The article reminded me that archival and data systems are not passive storehouses of information but they reflect decisions about what is collected, how it is structured, what is discarded or rendered invisible, and what relationships are acknowledged between data points. The act of creating and using a data system is a social act of selecting reality. Those selections echo values such as fairness (or its absence), equality (or neglect of difference), assumptions about normalcy, and the intersection of technology with society’s hierarchies and exclusions. +For instance, data systems may privilege quantifiable, easily measurable traits over more nuanced social realities (such as marginalization, intersectionality, lived experience). People who fall into multiple disadvantaged categories (race + gender + disability) may not be adequately represented if the system is designed only with “single-axis” categories. That omission encodes structural bias into the system. Further, when such systems are used in decision-making (for funding, for access, for monitoring), the embedded values have real impacts such as reinforcing marginalization, excluding certain groups from benefits, or misrepresenting experiences of inequality. +At the same time, technology and society co-construct one another. Data infrastructures aren’t merely technical A they carry the imprint of their designers’ assumptions, institutional logics, historical contexts. The design of a database including what fields are included, how privacy is handled, who has access, reflects social structures (who holds power, whose voices matter). And as society changes, these systems either adapt or become rigid. For example, if a system was built with a narrow conception of “user” based on a dominant group, it might fail to serve people from marginalized communities, thereby reproducing structural inequities in digital form. +In my own routines (as a student, teaching assistant, researcher) I interact with university information systems, learning-management platforms, research databases, etc. These environments embody value systems: ranking, assessing, benchmarking, tracking performance. They often focus on the measurable (grades, attendance, submission times) rather than the qualitative, relational, or structural factors that affect success (such as access, mentorship, socio-economic inequities, systemic bias). Therefore, they reflect wider societal structures of competition, credentialism, standardisation which may advantage those already positioned favourably and disadvantage those without resources or who don’t conform to the “norm”. +Recognising this helps me to reflect on how I might engage in data systems more critically. It invites awareness that technology isn’t neutral, but an active layer in the construction of social realities. Accordingly, when we design, use, or critique data systems, we must attend not only to technical correctness, but to the values embedded within. + ``` diff --git a/02_activities/assignments/DC_Cohort/assignment1.sql b/02_activities/assignments/DC_Cohort/assignment1.sql index e5d6baa8a..9db669cde 100644 --- a/02_activities/assignments/DC_Cohort/assignment1.sql +++ b/02_activities/assignments/DC_Cohort/assignment1.sql @@ -102,7 +102,16 @@ 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. */ - +SELECT c.customer_id, + c.customer_first_name, + c.customer_last_name, + SUM(cp.quantity*cp.cost_to_customer_per_qty) AS total_spent +FROM customer_purchases as cp +LEFT JOIN customer AS c -- In case there are customer IDs with no names in customer_purchases. +ON cp.customer_id = c.customer_id +GROUP BY cp.customer_id, c.customer_first_name, c.customer_last_name +HAVING total_spent > 2000 +ORDER BY c.customer_last_name,c.customer_first_name; --Temp Table /* 1. Insert the original vendor table into a temp.new_vendor and then add a 10th vendor: @@ -116,6 +125,26 @@ When inserting the new vendor, you need to appropriately align the columns to be VALUES(col1,col2,col3,col4,col5) */ +DROP TABLE IF EXISTS temp.new_vendor; -- If it previously existed, delete it. +CREATE TABLE temp.new_vendor AS +SELECT * +FROM vendor; +INSERT INTO temp.new_vendor ( + vendor_id, + vendor_name, + vendor_type, + vendor_owner_first_name, + vendor_owner_last_name +) +VALUES ( + 10, + 'Thomas Superfood Store', + 'Fresh Focused', + 'Thomas', + 'Rosenthal' +); +SELECT * +FROM temp.new_vendor; -- Date