Une collection organisée de snippets de code pour accélérer votre développement. Parcourez, recherchez et copiez en un clic.
WITH clients_region AS (
SELECT * FROM clients WHERE region = 'Europe'
)
SELECT nom, email FROM clients_region WHERE pays = 'France';
SELECT pays, COUNT(*) AS nombre_clients
FROM clients
GROUP BY pays
HAVING COUNT(*) > 10;
SELECT nom, salaire, RANK() OVER (PARTITION BY departement ORDER BY salaire DESC) as rang
FROM employes;
SELECT u.nom_complet, c.id AS commande_id
FROM utilisateurs u
LEFT JOIN commandes c ON u.id = c.utilisateur_id;
SELECT u.nom_complet, c.montant
FROM utilisateurs u
INNER JOIN commandes c ON u.id = c.utilisateur_id;
SELECT * FROM tableA
JOIN tableB ON tableA.id = tableB.a_id AND tableA.type = tableB.type;
SELECT * FROM produits ORDER BY nom LIMIT 10 OFFSET 20;
SELECT pays, COUNT(*) AS nombre_clients
FROM clients
GROUP BY pays;
SELECT * FROM produits
WHERE categorie_id IN (SELECT id FROM categories WHERE nom_parent = 'Electronique');
SELECT * FROM utilisateurs ORDER BY nom_complet DESC;