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
    
  
  
    
  | Retourne le nom des équipes et le nombre de joueurs par équipe, | |
| le tout classé par nombre de joueurs par équipe, de la plus nombreuse à la moins nombreuse. | |
| mysql> SELECT team.name, count(*) as nbPlayer FROM player | |
| JOIN team | |
| ON team.id = player.team_id | |
| GROUP BY team.name | |
| ORDER BY count(*) DESC; | |
| +------------+----------+ | |
| | name | nbPlayer | | 
  
    
      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
    
  
  
    
  | mysql> SELECT wizard.firstname, wizard.lastname, player.role, team.name FROM player | |
| JOIN wizard ON wizard.id=player.wizard_id | |
| JOIN team ON team.id=player.team_id | |
| ORDER BY name ASC, role ASC, lastname ASC, firstname ASC; | |
| +-------------+-----------------+--------+------------+ | |
| | firstname | lastname | role | name | | |
| +-------------+-----------------+--------+------------+ | |
| | Sirius | Black | beater | Gryffindor | | |
| | Lavender | Brown | beater | Gryffindor | | |
| | Seamus | Finnigan | beater | Gryffindor | | 
  
    
      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
    
  
  
    
  | mysql> INSERT INTO school (name, country, capacity) VALUES ('Beauxbatons Academy of Magic', 'France', 550), ('Castelobruxo', 'Brazil', 380), ('Durmstrang Institute', 'Norway', 570), ('Hogwarts School of Witchcraft and Wizardry', 'United Kingdom', 450), ('Ilvermorny School of Witchcraft and Wizardry', 'USA', 300), ('Koldovstoretz', 'Russia', 125), ('Mahoutokoro School of Magic', 'Japan', 800), ('Uagadou School of Magic', 'Uganda', 350); | |
| Query OK, 8 rows affected (0,01 sec) | |
| Records: 8 Duplicates: 0 Warnings: 0 | |
| mysql> SELECT * FROM school; | |
| +----+----------------------------------------------+----------+----------------+ | |
| | id | name | capacity | country | | |
| +----+----------------------------------------------+----------+----------------+ | |
| | 1 | Beauxbatons Academy of Magic | 550 | France | | |
| | 2 | Castelobruxo | 380 | Brazil | | 
  
    
      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
    
  
  
    
  | // Récupère tous les champs pour les sorciers nés entre 1975 et 1985 | |
| mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-12-31'; | |
| +----+-----------+----------+------------+-------------+---------------------------------------+-----------+ | |
| | id | firstname | lastname | birthday | birth_place | biography | is_muggle | | |
| +----+-----------+----------+------------+-------------+---------------------------------------+-----------+ | |
| | 1 | harry | potter | 1980-07-31 | london | | 0 | | |
| | 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 | | |
| | 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 | | |
| | 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 | | 
  
    
      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
    
  
  
    
  | mysql> SHOW TABLES; | |
| +-------------------------+ | |
| | Tables_in_wild_db_quest | | |
| +-------------------------+ | |
| | school | | |
| | wizard | | |
| +-------------------------+ | |
| 2 rows in set (0,00 sec) | |
| mysql> DESCRIBE wizard; | 
  
    
      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
    
  
  
    
  | public class Decipherer { | |
| public static String transcription(String message){ | |
| int key = message.length()/2; | |
| String substring = message.substring (5, 5 + key); | |
| String replace = substring.replace ("@#?"," "); | |
| String reverseMessage = new StringBuilder(replace).reverse().toString(); | |
| return reverseMessage; | 
  
    
      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
    
  
  
    
  | public class Movies2 { | |
| public static void main(String[] args) { | |
| String [] movies = {"Indiana Jones and the Last Crusade", "Indiana Jones and the Temple of Doom", "Raiders of the Lost Ark"}; | |
| String [][] actorsMovies = | |
| {{"Sean Connery", "Denholm Elliott", "Harrison Ford" }, | |
| {"Harrison Ford", "Kate Capshaw", "Jonathan Ke Quan"}, | |
| {"Harrison Ford", "Karen Allen", "Paul Freeman"}}; | |
  
    
      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
    
  
  
    
  | public class Variable { | |
| public static void main(String[] args) { | |
| String movieName = "Indiana Jones and the Last Crusade"; | |
| boolean haveSeen = true; | |
| int releasedDate = 1989; | |
| float movieRate = 8.2f; | |
| System.out.println(movieRate); | 
  
    
      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
    
  
  
    
  | public class CandyCount { | |
| public static void main(String[] args) { | |
| double money = 12.4; | |
| double price = 1.2; | |
| int candies = 0; | |
| if (money > 0 && price > 0) { | |
| while ((money - price) >= 0) { | |
| candies = candies +1; | 
  
    
      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
    
  
  
    
  | class Senpai{ | |
| public static void main(String[] args){ | |
| System.out.println("Notice me Senpai"); | |
| } | |
| } | 
NewerOlder