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: felix_b_wcs_bruxelles | |
-- ------------------------------------------------------ | |
-- 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
const express = require('express'); | |
const app = express(); | |
const port = 3000; | |
const connection = require('./conf'); | |
const cors = require('cors') | |
app.use(cors()) | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies |
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
const express = require('express'); | |
const app = express(); | |
const port = 3000; | |
const connection = require('./conf'); | |
const cors = require('cors') | |
app.use(cors()) | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Counter Redux</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Redux CDN --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/4.0.1/redux.min.js"></script> |
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
const express = require('express'); | |
const app = express(); | |
const port = 3000; | |
const connection = require('./conf'); | |
const cors = require('cors') | |
app.use(cors()) | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); |
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 change le nom du film ayant l'ID 5) | |
UPDATE movie | |
SET name="Men in Black" | |
WHERE id='5'; | |
(Une requête change le nom et le poster du film ayant l'ID 8) | |
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'; |
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 contient uniquement les colonnes "name", "poster" et "comment") | |
INSERT INT0 movie (name, poster, comment) VALUES ('interstellar', 'interstellar.jpeg', 'that is a great movie for sure'); | |
(Une requête ne contient pas de noms de colonnes) | |
INSERT INTO movie VALUES (null, 'interstellar', 'interstellar.jpeg', 'that is a great movie for sure'); | |
(Une requête contient 3 valeurs à ajouter) | |
INSERT INTO movie (name, poster, comment) VALUES ('simpson', 'simpson.jpeg', 'that is not a great movie'), ('simpson', 'simpson.jpeg', 'that is not a great movie'), ('simpson', 'simpson.jpeg', 'that is not a great movie'); | |
(Une requête contient uniquement la colonne "name") |
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
const express = require('express'); | |
const app = express(); | |
const port = 3000; | |
const connection = require('./conf'); | |
const cors = require('cors') | |
app.use(cors()) | |
app.get('/api/movies', (req, res) => { | |
connection.query('SELECT * from employee', (err, results) => { |
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
(Recuperer tous les films): | |
SELECT * from `movie` | |
(Recuperer uniquement les noms des films): | |
SELECT 'name' from 'movie' | |
(Recuperer uniquement les noms des films et leur id): | |
SELECT 'name', 'id' from 'movie' | |
(Recuperer uniquement les posters et commentaires avce un alias sur commentaires): |