Skip to content

Instantly share code, notes, and snippets.

@AlvisonHunterArnuero
Last active April 25, 2024 17:54
Show Gist options
  • Save AlvisonHunterArnuero/aa7d30b6530318238350cff0d41d2649 to your computer and use it in GitHub Desktop.
Save AlvisonHunterArnuero/aa7d30b6530318238350cff0d41d2649 to your computer and use it in GitHub Desktop.
SQL Query Strings for Test Integration
SELECT *,
(SELECT brand FROM order_items
JOIN products on order_items.product_uid = products.uid AND order_items.order_uid = orders.uid
ORDER BY order_items.quantity desc limit 1) AS popular_brand
FROM orders
SELECT * FROM orders
JOIN order_items ON orders.uid = order_items.order_uid
JOIN products on products.uid = order_items.product_uid
SELECT * FROM orders
JOIN order_items on orders.uid = order_items.order_uid
ORDER BY order_items.quantity DESC limit 20
SELECT * FROM products
WHERE uid = 'MKsGBdK5vp'
ORDER BY products.uid
SELECT * FROM products limit 15
SELECT * FROM order_items ORDER BY order_uid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment