This file contains 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
1A | |
2A | |
3A | |
4B | |
5B | |
6C | |
7B | |
8A | |
9B |
This file contains 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
import java.util.Arrays; | |
class Movies { | |
public static void main(String[] args) { | |
String[] titles = { "Indiana Jones et le Royaume du Crâne de Cristal ", "Indiana Jones et la Dernière Croisade", | |
"Indiana Jones et le Temple maudit" }; | |
String[] actors = { "Harrison Ford, Cate Blanchett, Karen Allen", | |
"Harrison Ford, Sean Connery, Denholm Elliott", "Harrison Ford, Kate Capshaw, Jonathan Ke Quan" }; | |
String[][] indy; |
This file contains 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 dump 10.13 Distrib 5.7.24, for Linux (x86_64) | |
-- | |
-- Host: localhost Database: franck_m_wcs_lyon | |
-- ------------------------------------------------------ | |
-- Server version 5.7.24-0ubuntu0.18.04.1 | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!40101 SET NAMES utf8 */; |
This file contains 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
Une requête supprime le film ayant l'ID 5: | |
DELETE FROM movie WHERE id='5'; | |
Une requête supprime tous les films ayant un ID supérieur à 10: | |
DELETE FROM movie WHERE id>'10'; |
This file contains 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
Modifier le nom du film ayant l'ID 5, en le remplaçant par "Men in Black": | |
UPDATE movie SET name='Men in Black' WHERE id='5'; | |
Modifier le nom et le poster du film ayant l'ID 8, en remplaçant le nom par "Deadpool" et le poster: | |
UPDATE movie SET name='Deadpool', poster='https://upload.wikimedia.org/wikipedia/en/thumb/2/23/Deadpool_%282016_poster%29.png/220px-Deadpool_%282016_poster%29.png' WHERE id='8'; | |
Modifier le commentaire du film ayant l'ID 10, tu vas simplement "supprimer" le commentaire: | |
UPDATE movie SET comment='' WHERE id='10'; |
This file contains 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
Ajouter un film sans spécifier les noms des colonnes dans la requête: | |
INSERT INTO movie VALUES (null, 'MATRIX', 'http://fr.web.img6.acsta.net/medias/04/34/49/043449_af.jpg', 'parfait'); | |
Ajouter un film en spécifiant toutes les colonnes sauf l'ID: | |
INSERT INTO movie (name, poster, comment) VALUES ('MATRIX', 'http://fr.web.img6.acsta.net/medias/04/34/49/043449_af.jpg', 'parfait'); | |
Ajouter 3 films dans une même requête en spécifiant toutes les colonnes sauf l'ID: |
This file contains 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
localhost/sqlquests/movie/ http://localhost/phpmyadmin/tbl_sql.php?db=sqlquests&table=movie&token=6888a083bba144ef90c68aa96a64fede | |
Affichage des lignes 0 - 24 (total de 25, Traitement en 0.0004 secondes.) | |
SELECT id, poster from movie | |
id poster | |
1 https://www.gravatar.com/avatar/e30e7f1494074ce297... | |
2 https://www.gravatar.com/avatar/21c6f46e31077be677... | |
3 https://www.gravatar.com/avatar/0c2af66db6aadcbebc... |
This file contains 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 SecretSentence { | |
public static String writeSecretSentence(String param1, String param2) { | |
return param1 + " s'incline face à " + param2; | |
} | |
public static void main(String[] args) { | |
String param1 = "Le cochon"; | |
String param2 = "la mer"; |
This file contains 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 Variables { | |
public static void main(String[] args) { | |
String titre = "Indiana Jones et la dernière croisade"; | |
Boolean vue = true; | |
int sortie = 1989; | |
float note = 8; | |
System.out.println(titre); | |
System.out.println(vue); |
This file contains 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
#!/bin/bash | |
# Name asking script | |
echo Bonjour, quel est votre nom ? | |
read -p 'votre nom : ' nom | |
if [ "x$nom" = "x" ]; then | |
nom=$USER | |
fi | |
echo "Bonjour $nom !" |
NewerOlder