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 mysql = require('mysql'); | |
const connection = mysql.createConnection({ | |
host: 'localhost', | |
user: 'root', | |
password: process.env['SQLPASSWORD'], | |
database: 'my_db', | |
}) | |
module.exports = connection; |
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 mysql = require('mysql'); | |
const connection = mysql.createConnection({ | |
host: 'localhost', | |
user: 'root', | |
password: process.env['SQLPASSWORD'], | |
database: 'my_db', | |
}) | |
module.exports = connection; |
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 mysql = require('mysql'); | |
const connection = mysql.createConnection({ | |
host: 'localhost', | |
user: 'root', | |
password: process.env['SQLPASSWORD'], | |
database: 'my_db', | |
}) | |
module.exports = connection; |
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 mysql = require('mysql'); | |
const connection = mysql.createConnection({ | |
host: 'localhost', | |
user: 'root', | |
password: process.env['SQLPASSWORD'], | |
database: 'my_db', | |
}) | |
module.exports = connection; |
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
/*Statement : | |
•Insert the following data into the school table(...e.g.) | |
•“Durmstrang Institute” is actually in Sweden (Sweden), so modify its country. | |
•“Mahoutokoro School of Magic” should have its pupil capacity reduced to 700. | |
•Delete all the schools containing the word “Magic” (there are 3) in their titles in a single request. The LIKE keyword may be of help to you. | |
•Then, using a SELECT query, display all of the data in the school table and paste the result in the gist along with the other results.*/ | |
INSERT INTO school(name, country, capacity) VALUES ('Castelobruzo','Brazil',380), | |
('Ilvermorny School of Witchcraft and Wizardry','USA',300), |
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
/* Statement : | |
•Import the SQL file described in this quest's Content tab. | |
•Retrieve all of the fields containing wizards born between 1975 and 1985 | |
•Retrieve the wizards’ names whose first names start with the letter “H” | |
•Retrieve the first names and last names of the whole “Potter” family, ordered by first name | |
•Retrieve the oldest wizard’s first name, last name and birth date (this must work regardless of the table content) */ | |
mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975.01.01' AND '1985.01.01'; | |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+ |
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; | |
app.get('/api/movies', (request, response) => { | |
response.send('All films'); | |
}); | |
app.get('/api/movies/:id', (request, response) => { |
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
process.stdin.resume() | |
process.stdin.setEncoding('utf8') | |
// console.log('What\'s your name ? ') | |
// process.stdin.on('data', (text) => { | |
// console.log('Hello ' + text) | |
// process.exit() | |
// }) | |
console.log('What\'s your age ? ') |