This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Event: | |
| * { | |
| * "token": "ey...", | |
| * "type": "request", | |
| * "source": "api", | |
| * "body": { | |
| * "client": "ABC Partners", | |
| * "uuid": "26acd459-e430-4ccc-a464-ca61b2a44c19", | |
| * "path": "/holding/123", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Assume transaction table has the following records: | |
| # - 80 with status = 'approved' | |
| # - 60 with amount > 1000 | |
| # - 30 with both status = 'approved' and amount > 1000 | |
| SELECT COUNT(*) | |
| FROM transactions | |
| WHERE status = 'approved' OR amount > 1000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| p.product_name, | |
| COUNT(o.order_id) as total_orders | |
| FROM products p | |
| JOIN orders o ON p.product_id = o.product_id | |
| GROUP BY p.product_name | |
| HAVING COUNT(o.order_id) >= 50 | |
| ORDER BY total_orders DESC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useEffect, useState } from 'react'; | |
| interface Event { | |
| id: number; | |
| name: string; | |
| date: string; | |
| } | |
| const EventTracker: React.FC = () => { | |
| const [events, setEvents] = useState<Event[]>([]); |