25-NSIJ1JA1-3

  1. SELECT "id-kimono"
    FROM location
    WHERE fin = '';
    

    Remarque

    Le sujet utilise un tiret - dans le nom des attributs à la place du traditionnel tiret bas _. Cela oblige à entourer le nom avec des guillemets doubles pour éviter que le tiret ne soit interprété comme une soustraction.

  2. SELECT COUNT(*)
    FROM kimono
    WHERE "taille-kimono" = 130;
    
  3. SELECT nom, prenom
    FROM adherent
    JOIN location ON location."numero-licence" = adherent."numero-licence"
    WHERE "id-kimono" = 42 AND fin = '';
    
  4. UPDATE adherent
    SET "taille-adherent" = "taille-adherent" + 10
    WHERE "taille-adherent" < 160;
    
  5. DELETE FROM location WHERE "id-kimono" = 25;
    DELETE FROM kimono   WHERE "id-kimono" = 25;
    
  6. Son numéro de licence serait possiblement M12102021NIRRE01.

  7. Cet adhérent est né le 23/09/1974 et a un nom commençant par MARTI, probablement MARTIN.

  8. L'expression tab_adherents[1]['prenom'] renvoie 'STEPHANIE'.

  9. La valeur 'F03071997DUPON01' est obtenue grâce à l'instruction tab_adherents[0]['numero-licence'].

  10. def nombre_adherents(table, annee):
        compteur = 0
        for adherent in table:
            if adherent['annee'] == annee:
                compteur += 1
        return compteur
    
  11. def adherent_plus_age(table):
        annee = '2024'
        for adherent in table:
            if adherent['annee'] < annee:
                annee = adherent['annee']
        return [a for a in table if a['annee'] == annee]