Cool Coding Blog

Community Article Published September 19, 2025

Look at my Demo

SQL

SELECT u.name, u.email, p.title
FROM users u
LEFT JOIN projects p ON u.id = p.user_id
WHERE u.active = true
    AND u.created_date >= '2024-01-01'
ORDER BY u.name ASC, p.created_date DESC;

Rust

use std::collections::HashMap;

#[derive(Debug)]
struct Person {
    name: String,
    age: u32,
}

impl Person {
    fn new(name: &str, age: u32) -> Self {
        Person {
            name: name.to_string(),
            age,
        }
    }
    
    fn greet(&self) -> String {
        format!("Hello, I'm {} and I'm {} years old", self.name, self.age)
    }
}

fn main() {
    let mut people = HashMap::new();
    
    let alice = Person::new("Alice", 30);
    let bob = Person::new("Bob", 25);
    
    people.insert("alice", alice);
    people.insert("bob", bob);
    
    for (key, person) in &people {
        println!("{}: {}", key, person.greet());
    }
}

Community

Sign up or log in to comment