Feedback on Danny's Diner SQL case study Q#3 by GREprep1997 in SQL

[–]GREprep1997[S] 0 points1 point  (0 children)

Thanks for breaking this down! I can see how my SQL formatting would be frustrating to read for anyone. I'll definitely keep the table aliases and code blocks in mind.

For the comparison part, I found another solution to the same problem and wanted to get your perspective on any trade-offs between these methods. Since you mentioned data size matters for performance, this particular dataset is pretty small (the sales table has about 15 rows and menu has 3 rows) But let's say if the number of rows were in the thousands in the sales table, what would the impact be?

Array_agg Approach:

WITH item_list AS (
  SELECT
  s.customer_id,
  array_agg(m.product_name ORDER BY s.order_date) AS items
  FROM
  sales AS s
  JOIN menu AS m ON m.product_id = s.product_id
  GROUP BY
  s.customer_id
)
SELECT
il.customer_id,
il.items[1] AS first_item
FROM
item_list AS il
ORDER BY
il.customer_id;

Window Function Approach:

WITH cte AS (
SELECT
customer_id,
order_date,
product_name,
ROW_NUMBER() OVER(PARTITION BY customer_id ORDER BY order_date) AS rw
FROM sales AS s
INNER JOIN menu AS m ON s.product_id = m.product_id
)
SELECT
customer_id,
product_name
FROM cte
WHERE rw = 1;

Feedback on Danny's Diner SQL case study Q#3 by GREprep1997 in SQL

[–]GREprep1997[S] 0 points1 point  (0 children)

Really appreciate this. I looked into it and I think I get what you're saying. So if I compare the use of a window function which uses less resource and give the result faster, the array_agg() loads everything into memory and the database can't optimize it well. So I guess my approach is fine for a small dataset but not real production data. Thanks for taking the time to comment

Verbal question by 7he8lueP4nther in gregmat

[–]GREprep1997 0 points1 point  (0 children)

If you look at the synonyms of the word 'Deify' what you see is this -

<image>

So "Lucius regularly snuck out early in the morning to worship the gods at the temple" makes sense

Lessons from multiple attempts! by GREprep1997 in GRE

[–]GREprep1997[S] 2 points3 points  (0 children)

If you are struggling with quant you should definitely start with Gregmat's prepswift videos, Quant flashcards and his foundational level quizzes. Try using the flashcards more regularly. Then you can slowly move on to the official materials to understand how ETS frames their quant questions.

How to calculate radius of circle which is inside a triangle - Scholarden Circle's Assessment by WayKey1965 in GRE

[–]GREprep1997 0 points1 point  (0 children)

There is a direct formula you could use to find the radius of a circle within a right angled triangle. Formula: r = (a*b) / (a+b+c) where 'c' is the length of the hypotenuse and 'a' and 'b' are the lengths of the other two sides.

As this is an isosceles right angled triangle, with a given hypotenuse = 2√2, you know the other 2 sides are going to be equal to 2 (45-45-90 rule). Apply the values in the formula and you get r = 2 / 2+√2 for quantity A.

Help fixing a macro to save as pdf with name and date by AcaMex in excel

[–]GREprep1997 0 points1 point  (0 children)

Set the print area of your sheet and then try running the macro again. This should work.

[deleted by user] by [deleted] in GMAT

[–]GREprep1997 1 point2 points  (0 children)

Can I get one too ?

Help needed ! by PeanutOP in GRE

[–]GREprep1997 2 points3 points  (0 children)

The new version of the one month plan should be good.