{"id":222,"date":"2025-08-07T21:07:43","date_gmt":"2025-08-07T21:07:43","guid":{"rendered":"https:\/\/ledatalab.fr\/?p=222"},"modified":"2025-08-11T20:18:09","modified_gmt":"2025-08-11T20:18:09","slug":"serie-sql-debutant-select-premiers-pas","status":"publish","type":"post","link":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/","title":{"rendered":"[S\u00e9rie SQL #1] Comprendre SQL &#8211; premiers pas avec SELECT"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"300\" src=\"https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration-300x300.png\" alt=\"\" class=\"wp-image-267\" srcset=\"https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration-300x300.png 300w, https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration-1024x1024.png 1024w, https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration-150x150.png 150w, https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration-768x768.png 768w, https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration-1536x1536.png 1536w, https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration.png 2048w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n<\/div>\n\n\n<h1 class=\"wp-block-heading\">[S\u00e9rie SQL #1] Comprendre SQL<br>Premiers pas avec SELECT<\/h1>\n\n\n\n<p>Apprenez \u00e0 interroger vos donn\u00e9es comme un pro, en partant de z\u00e9ro.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction courte : Pourquoi c\u2019est utile ?<\/h2>\n\n\n\n<p>Que vous manipuliez des fichiers Excel, construisiez des dashboards BI ou exploriez des bases clients, savoir interroger une base de donn\u00e9es avec <code><strong>SELECT<\/strong><\/code> est indispensable.<br>Voici le premier pas vers la ma\u00eetrise du langage SQL, un outil incontournable pour tout analyste, d\u00e9veloppeur ou curieux de donn\u00e9es.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Syntaxe g\u00e9n\u00e9rale de SELECT<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT colonne1, colonne2, ...\nFROM nom_table;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><span style=\"color: #E1E4E8\"> colonne1, colonne2, ...<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> nom_table;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<p>D\u00e9composition rapide :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>SELECT<\/strong> \u2192 Ce que vous voulez voir<\/li>\n\n\n\n<li><strong>FROM<\/strong> \u2192 O\u00f9 chercher (le nom de la table)<\/li>\n<\/ul>\n\n\n\n<p><strong>Important<\/strong> : les mots-cl\u00e9s SQL ne sont pas sensibles \u00e0 la casse, mais on les \u00e9crit souvent en majuscules par convention.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Exemples concrets \u00e0 partir d\u2019une table employees<\/h2>\n\n\n\n<p>Utilisation d\u2019une table fictive nomm\u00e9e <code><strong>employees<\/strong><\/code>, inspir\u00e9e du jeu de donn\u00e9es <a href=\"https:\/\/www.postgresql.org\/ftp\/projects\/pgFoundry\/dbsamples\/pagila\/pagila\/\">Pagila<\/a>\/<a href=\"https:\/\/dev.mysql.com\/doc\/sakila\/en\/\">Sakila <\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>employee_id<\/th><th>first_name<\/th><th>last_name<\/th><th>department<\/th><th>salary<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>Alice<\/td><td>Dubois<\/td><td>HR<\/td><td>3200<\/td><\/tr><tr><td>2<\/td><td>Karim<\/td><td>Nguyen<\/td><td>IT<\/td><td>4100<\/td><\/tr><tr><td>3<\/td><td>Fatou<\/td><td>Mendes<\/td><td>Sales<\/td><td>3900<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Exemple 1 : S\u00e9lectionner toutes les colonnes<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT * \nFROM employees;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #F97583\">*<\/span><span style=\"color: #E1E4E8\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u2049\ufe0f Le <strong>*<\/strong> signifie \u00ab tout s\u00e9lectionner \u00bb. C\u2019est pratique pour tester, mais \u00e0 \u00e9viter en production pour des raisons de lisibilit\u00e9 et de performance.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Exemple 2 : S\u00e9lectionner des colonnes sp\u00e9cifiques<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT \n  first_name\n  ,department\nFROM employees;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><span style=\"color: #E1E4E8\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  first_name<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  ,department<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Exemple 3 : Ajouter un alias<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT \n  first_name AS pr\u00e9nom\n  ,department AS service \nFROM employees;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><span style=\"color: #E1E4E8\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  first_name <\/span><span style=\"color: #F97583\">AS<\/span><span style=\"color: #E1E4E8\"> pr\u00e9nom<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  ,department <\/span><span style=\"color: #F97583\">AS<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #F97583\">service<\/span><span style=\"color: #E1E4E8\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u2049\ufe0f L\u2019alias (AS) permet de renommer une colonne pour l\u2019affichage &#8211; tr\u00e8s utile dans un rapport ou un dashboard.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Exemple 4 : Ajouter un commentaire<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\/*\n  Cr\u00e9er le 07\/06\/1992\n  Par Violleta T.\n*\/\n-- Cette requ\u00eate affiche tous les salari\u00e9s\nSELECT *\nFROM employees;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A737D\">\/*<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\">  Cr\u00e9er le 07\/06\/1992<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\">  Par Violleta T.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\">*\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\">-- Cette requ\u00eate affiche tous les salari\u00e9s<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #F97583\">*<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u2049\ufe0f Il existe 2 fa\u00e7ons d&rsquo;ajouter des commentaires SQL :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>double tiret <strong>&#8212;<\/strong> : permet de faire un commentaire jusqu\u2019\u00e0 la fin de la ligne.<\/li>\n\n\n\n<li>multi-ligne <strong>\/*<\/strong> et <strong>*\/<\/strong> : permet d&rsquo;indiquer o\u00f9 commence et o\u00f9 se termine le commentaire<\/li>\n<\/ul>\n\n\n\n<p>Utiles pour tester ou documenter votre code SQL !<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Astuces et pi\u00e8ges classiques<\/h2>\n\n\n\n<p>M\u00eame si SELECT semble simple au premier abord, plusieurs subtilit\u00e9s peuvent vite pi\u00e9ger un d\u00e9butant. <br>Voici les 5 pi\u00e8ges les plus courants, avec des explications et des solutions.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">1. Alias non pris en compte dans certaines clauses<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT\n  salary AS salaire \nFROM employees\nORDER BY salaire; -- erreur possible<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  salary <\/span><span style=\"color: #F97583\">AS<\/span><span style=\"color: #E1E4E8\"> salaire <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">ORDER BY<\/span><span style=\"color: #E1E4E8\"> salaire; <\/span><span style=\"color: #6A737D\">-- erreur possible<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Dans certains SGBD, les alias d\u00e9finis dans SELECT ne sont pas reconnus dans les clauses comme ORDER BY ou GROUP BY.<br>\ud83d\udca1Pr\u00e9f\u00e8re la colonne d\u2019origine ou sa position :<\/p>\n<\/blockquote>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>ORDER BY salary\n-- ou\nORDER BY 1<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">ORDER BY<\/span><span style=\"color: #E1E4E8\"> salary<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\">-- ou<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">ORDER BY<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">1<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2. Nom de colonne ambigu\u00eb dans les jointures<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT\n  id\nFROM employees, departments;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  id<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees, departments;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>SQL ne sait pas quelle colonne id afficher si elle existe dans plusieurs tables.<br>Ce probl\u00e8me est fr\u00e9quent dans les jointures, que nous verrons plus tard.<br>\ud83d\udca1En attendant, pr\u00e9cise toujours le nom de la table (ou un alias clair).<\/p>\n<\/blockquote>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT\n  employees.id\nFROM employees;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #79B8FF\">employees<\/span><span style=\"color: #E1E4E8\">.<\/span><span style=\"color: #79B8FF\">id<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3. Noms de colonnes r\u00e9serv\u00e9s ou \u00e0 espaces<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT\n  order \nFROM sales;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  order <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> sales;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Order est un mot r\u00e9serv\u00e9 (comme select, table, group, etc.).<br>Cela peut provoquer une erreur ou un comportement impr\u00e9visible.<br>\ud83d\udca1Utilise des guillemets ou crochets, ou renomme la colonne si possible :<\/p>\n<\/blockquote>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT\n  \"order\" \nFROM sales;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #9ECBFF\">&quot;order&quot;<\/span><span style=\"color: #E1E4E8\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> sales;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4. Les doublons inattendus<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT\n  department\nFROM employees;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  department<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Tu t\u2019attendais \u00e0 voir une liste unique des d\u00e9partements\u2026 mais tu as 200 lignes \u201cSales\u201d ?<br>C\u2019est normal : SELECT n\u2019\u00e9limine pas les doublons par d\u00e9faut.<br>\ud83d\udca1On verra la solution : DISTINCT, dans l\u2019article 3 pour g\u00e9rer \u00e7a efficacement.<\/p>\n<\/blockquote>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">5. Commentaires <code>--<\/code> qui cassent la requ\u00eate dans certains outils<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT\n  -- colonnes affich\u00e9es\n  first_name,\n  salary\nFROM employees;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #6A737D\">-- colonnes affich\u00e9es<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  first_name,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  salary<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Certains outils (ex. : notebooks, \u00e9diteurs no-code, scripts) lisent seulement la premi\u00e8re ligne d\u2019une requ\u00eate ou interpr\u00e8tent mal les &#8211;.<br>R\u00e9sultat : la requ\u00eate est tronqu\u00e9e ou retourne une erreur.<\/p>\n\n\n\n<p>\ud83d\udca1Pr\u00e9f\u00e8re les commentaires sur leur propre ligne, ou utilise des commentaires multi-lignes si support\u00e9s :<\/p>\n<\/blockquote>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\/* afficher le pr\u00e9nom et le salaire *\/\nSELECT\n  first_name,\n  salary\nFROM employees;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A737D\">\/* afficher le pr\u00e9nom et le salaire *\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  first_name,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  salary<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Mini-challenge interactif<\/h2>\n\n\n\n<p>Essayez cette requ\u00eate dans votre environnement :<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Afficher uniquement le pr\u00e9nom et le salaire de tous les employ\u00e9s du d\u00e9partement Sales, en renommant les colonnes.<\/p>\n<\/blockquote>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\ud83d\udca1Solution<\/summary>\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e1e4e8;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#e1e4e833\" stroke=\"#e1e4e84d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT\n  \"first_name\" AS pr\u00e9nom,\n  \"salary\" AS salaire\nFROM employees\nWHERE department = 'Sales';<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">SELECT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #9ECBFF\">&quot;first_name&quot;<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #F97583\">AS<\/span><span style=\"color: #E1E4E8\"> pr\u00e9nom,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #9ECBFF\">&quot;salary&quot;<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #F97583\">AS<\/span><span style=\"color: #E1E4E8\"> salaire<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">FROM<\/span><span style=\"color: #E1E4E8\"> employees<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">WHERE<\/span><span style=\"color: #E1E4E8\"> department <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&#39;Sales&#39;<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#24292e;color:#d3d7dd;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n<\/details>\n\n\n\n<p>Et vous, combien d\u2019employ\u00e9s avez-vous trouv\u00e9 ?<br>Partagez vos r\u00e9sultats ou vos questions en commentaire ! \ud83d\ude09<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">R\u00e9sum\u00e9 visuel final<\/h2>\n\n\n\n<p>En r\u00e9sum\u00e9 : voici les fondations d\u2019une requ\u00eate SQL bien construite.<br>Un petit pense-b\u00eate visuel pour ne plus se m\u00e9langer entre SELECT, alias, commentaires et autres subtilit\u00e9s du quotidien \ud83d\udc47<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">\u00c9l\u00e9ment<\/th><th>Utilit\u00e9<\/th><th>Exemple<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">SELECT *<\/td><td>Toutes les colonnes<\/td><td>SELECT *<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">FROM tab<\/td><td>Tables cibl\u00e9es<\/td><td>SELECT * FROM employees;<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">SELECT col<\/td><td>Colonnes cibl\u00e9es<\/td><td>SELECT first_name<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">AS<\/td><td>Alias pour lisibilit\u00e9<\/td><td>SELECT first_name AS pr\u00e9nom<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">&#8212;<\/td><td>Commentaire<\/td><td>&#8212; Ceci est un commentaire<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Maintenant que vous savez lire dans une table, il est temps de passer \u00e0 l&rsquo;\u00e9tape suivante :<br>filtrer les donn\u00e9es pour ne garder que celles qui comptent.<\/p>\n\n\n\n<p>\u00c0 lire ensuite \u2192 Article 2 : Filtrer avec WHERE &amp; op\u00e9rateurs logiques (Lien \u00e0 venir)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[S\u00e9rie SQL #1] Comprendre SQLPremiers pas avec SELECT Apprenez \u00e0 interroger vos donn\u00e9es comme un pro, en partant de z\u00e9ro. Introduction courte : Pourquoi c\u2019est utile ? Que vous manipuliez des fichiers Excel, construisiez des dashboards BI ou exploriez des bases clients, savoir interroger une base de donn\u00e9es avec SELECT est indispensable.Voici le premier pas &#8230; <a title=\"[S\u00e9rie SQL #1] Comprendre SQL &#8211; premiers pas avec SELECT\" class=\"read-more\" href=\"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/\" aria-label=\"En savoir plus sur [S\u00e9rie SQL #1] Comprendre SQL &#8211; premiers pas avec SELECT\">Lire la suite<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[13,17,14,15,16,11,12,10],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-bases-donnees-sql","tag-apprendre-sql","tag-challenge-sql","tag-debuter-en-sql","tag-exemples-sql","tag-pieges-sql","tag-select","tag-serie-pedagogique","tag-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[S\u00e9rie SQL #1] Comprendre SQL - premiers pas avec SELECT - Le Data Lab<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[S\u00e9rie SQL #1] Comprendre SQL - premiers pas avec SELECT - Le Data Lab\" \/>\n<meta property=\"og:description\" content=\"[S\u00e9rie SQL #1] Comprendre SQLPremiers pas avec SELECT Apprenez \u00e0 interroger vos donn\u00e9es comme un pro, en partant de z\u00e9ro. Introduction courte : Pourquoi c\u2019est utile ? Que vous manipuliez des fichiers Excel, construisiez des dashboards BI ou exploriez des bases clients, savoir interroger une base de donn\u00e9es avec SELECT est indispensable.Voici le premier pas ... Lire la suite\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/\" \/>\n<meta property=\"og:site_name\" content=\"Le Data Lab\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-07T21:07:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-11T20:18:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2048\" \/>\n\t<meta property=\"og:image:height\" content=\"2048\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"David Laumont\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ledatalab\" \/>\n<meta name=\"twitter:site\" content=\"@ledatalab\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Laumont\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/\"},\"author\":{\"name\":\"David Laumont\",\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/#\\\/schema\\\/person\\\/5b32bc34b960873d989e860dc2a770c2\"},\"headline\":\"[S\u00e9rie SQL #1] Comprendre SQL &#8211; premiers pas avec SELECT\",\"datePublished\":\"2025-08-07T21:07:43+00:00\",\"dateModified\":\"2025-08-11T20:18:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/\"},\"wordCount\":729,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ledatalab.fr\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/serie_sql_1_illustration-300x300.png\",\"keywords\":[\"Apprendre SQL\",\"Challenge SQL\",\"D\u00e9buter en SQL\",\"Exemples SQL\",\"Pi\u00e8ges SQL\",\"SELECT\",\"S\u00e9rie p\u00e9dagogique\",\"SQL\"],\"articleSection\":[\"Bases\u202fde\u202fdonn\u00e9es\u202f&amp;\u202fSQL\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/\",\"url\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/\",\"name\":\"[S\u00e9rie SQL #1] Comprendre SQL - premiers pas avec SELECT - Le Data Lab\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ledatalab.fr\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/serie_sql_1_illustration-300x300.png\",\"datePublished\":\"2025-08-07T21:07:43+00:00\",\"dateModified\":\"2025-08-11T20:18:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/#primaryimage\",\"url\":\"https:\\\/\\\/ledatalab.fr\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/serie_sql_1_illustration.png\",\"contentUrl\":\"https:\\\/\\\/ledatalab.fr\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/serie_sql_1_illustration.png\",\"width\":2048,\"height\":2048},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/2025\\\/08\\\/07\\\/serie-sql-debutant-select-premiers-pas\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/ledatalab.fr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[S\u00e9rie SQL #1] Comprendre SQL &#8211; premiers pas avec SELECT\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/#website\",\"url\":\"https:\\\/\\\/ledatalab.fr\\\/\",\"name\":\"Le Data Lab\",\"description\":\"Le blog pour comprendre, explorer et utiliser la Data.\",\"publisher\":{\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/#organization\"},\"alternateName\":\"ledatalab\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ledatalab.fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/#organization\",\"name\":\"Le Data Lab\",\"alternateName\":\"ledatalab\",\"url\":\"https:\\\/\\\/ledatalab.fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/ledatalab.fr\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/couleur-vertical-a-droite-superpose.png\",\"contentUrl\":\"https:\\\/\\\/ledatalab.fr\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/couleur-vertical-a-droite-superpose.png\",\"width\":1000,\"height\":1000,\"caption\":\"Le Data Lab\"},\"image\":{\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/ledatalab\",\"https:\\\/\\\/www.instagram.com\\\/ledatalab\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/ledatalab\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ledatalab.fr\\\/#\\\/schema\\\/person\\\/5b32bc34b960873d989e860dc2a770c2\",\"name\":\"David Laumont\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f41bc47d57445961a7cda575465b1faba2c35ffd0ac4aa81e7fc01aa87f68ccc?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f41bc47d57445961a7cda575465b1faba2c35ffd0ac4aa81e7fc01aa87f68ccc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f41bc47d57445961a7cda575465b1faba2c35ffd0ac4aa81e7fc01aa87f68ccc?s=96&d=mm&r=g\",\"caption\":\"David Laumont\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/david-laumont\\\/\"],\"url\":\"https:\\\/\\\/ledatalab.fr\\\/index.php\\\/author\\\/david-l\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[S\u00e9rie SQL #1] Comprendre SQL - premiers pas avec SELECT - Le Data Lab","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/","og_locale":"fr_FR","og_type":"article","og_title":"[S\u00e9rie SQL #1] Comprendre SQL - premiers pas avec SELECT - Le Data Lab","og_description":"[S\u00e9rie SQL #1] Comprendre SQLPremiers pas avec SELECT Apprenez \u00e0 interroger vos donn\u00e9es comme un pro, en partant de z\u00e9ro. Introduction courte : Pourquoi c\u2019est utile ? Que vous manipuliez des fichiers Excel, construisiez des dashboards BI ou exploriez des bases clients, savoir interroger une base de donn\u00e9es avec SELECT est indispensable.Voici le premier pas ... Lire la suite","og_url":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/","og_site_name":"Le Data Lab","article_published_time":"2025-08-07T21:07:43+00:00","article_modified_time":"2025-08-11T20:18:09+00:00","og_image":[{"width":2048,"height":2048,"url":"https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration.png","type":"image\/png"}],"author":"David Laumont","twitter_card":"summary_large_image","twitter_creator":"@ledatalab","twitter_site":"@ledatalab","twitter_misc":{"\u00c9crit par":"David Laumont","Dur\u00e9e de lecture estim\u00e9e":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/#article","isPartOf":{"@id":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/"},"author":{"name":"David Laumont","@id":"https:\/\/ledatalab.fr\/#\/schema\/person\/5b32bc34b960873d989e860dc2a770c2"},"headline":"[S\u00e9rie SQL #1] Comprendre SQL &#8211; premiers pas avec SELECT","datePublished":"2025-08-07T21:07:43+00:00","dateModified":"2025-08-11T20:18:09+00:00","mainEntityOfPage":{"@id":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/"},"wordCount":729,"commentCount":0,"publisher":{"@id":"https:\/\/ledatalab.fr\/#organization"},"image":{"@id":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/#primaryimage"},"thumbnailUrl":"https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration-300x300.png","keywords":["Apprendre SQL","Challenge SQL","D\u00e9buter en SQL","Exemples SQL","Pi\u00e8ges SQL","SELECT","S\u00e9rie p\u00e9dagogique","SQL"],"articleSection":["Bases\u202fde\u202fdonn\u00e9es\u202f&amp;\u202fSQL"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/","url":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/","name":"[S\u00e9rie SQL #1] Comprendre SQL - premiers pas avec SELECT - Le Data Lab","isPartOf":{"@id":"https:\/\/ledatalab.fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/#primaryimage"},"image":{"@id":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/#primaryimage"},"thumbnailUrl":"https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration-300x300.png","datePublished":"2025-08-07T21:07:43+00:00","dateModified":"2025-08-11T20:18:09+00:00","breadcrumb":{"@id":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/#primaryimage","url":"https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration.png","contentUrl":"https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/serie_sql_1_illustration.png","width":2048,"height":2048},{"@type":"BreadcrumbList","@id":"https:\/\/ledatalab.fr\/index.php\/2025\/08\/07\/serie-sql-debutant-select-premiers-pas\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/ledatalab.fr\/"},{"@type":"ListItem","position":2,"name":"[S\u00e9rie SQL #1] Comprendre SQL &#8211; premiers pas avec SELECT"}]},{"@type":"WebSite","@id":"https:\/\/ledatalab.fr\/#website","url":"https:\/\/ledatalab.fr\/","name":"Le Data Lab","description":"Le blog pour comprendre, explorer et utiliser la Data.","publisher":{"@id":"https:\/\/ledatalab.fr\/#organization"},"alternateName":"ledatalab","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ledatalab.fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/ledatalab.fr\/#organization","name":"Le Data Lab","alternateName":"ledatalab","url":"https:\/\/ledatalab.fr\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/ledatalab.fr\/#\/schema\/logo\/image\/","url":"https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/couleur-vertical-a-droite-superpose.png","contentUrl":"https:\/\/ledatalab.fr\/wp-content\/uploads\/2025\/08\/couleur-vertical-a-droite-superpose.png","width":1000,"height":1000,"caption":"Le Data Lab"},"image":{"@id":"https:\/\/ledatalab.fr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/ledatalab","https:\/\/www.instagram.com\/ledatalab\/","https:\/\/www.linkedin.com\/company\/ledatalab"]},{"@type":"Person","@id":"https:\/\/ledatalab.fr\/#\/schema\/person\/5b32bc34b960873d989e860dc2a770c2","name":"David Laumont","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/secure.gravatar.com\/avatar\/f41bc47d57445961a7cda575465b1faba2c35ffd0ac4aa81e7fc01aa87f68ccc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f41bc47d57445961a7cda575465b1faba2c35ffd0ac4aa81e7fc01aa87f68ccc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f41bc47d57445961a7cda575465b1faba2c35ffd0ac4aa81e7fc01aa87f68ccc?s=96&d=mm&r=g","caption":"David Laumont"},"sameAs":["https:\/\/www.linkedin.com\/in\/david-laumont\/"],"url":"https:\/\/ledatalab.fr\/index.php\/author\/david-l\/"}]}},"_links":{"self":[{"href":"https:\/\/ledatalab.fr\/index.php\/wp-json\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ledatalab.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ledatalab.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ledatalab.fr\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ledatalab.fr\/index.php\/wp-json\/wp\/v2\/comments?post=222"}],"version-history":[{"count":13,"href":"https:\/\/ledatalab.fr\/index.php\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"predecessor-version":[{"id":280,"href":"https:\/\/ledatalab.fr\/index.php\/wp-json\/wp\/v2\/posts\/222\/revisions\/280"}],"wp:attachment":[{"href":"https:\/\/ledatalab.fr\/index.php\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ledatalab.fr\/index.php\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ledatalab.fr\/index.php\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}