Skip to content

Instantly share code, notes, and snippets.

View rriamarria's full-sized avatar
🎯
Focusing

Maria F. Marinescu rriamarria

🎯
Focusing
View GitHub Profile
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 ? ')
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) => {
/* 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';
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
/*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),
const mysql = require('mysql');
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: process.env['SQLPASSWORD'],
database: 'my_db',
})
module.exports = connection;
const mysql = require('mysql');
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: process.env['SQLPASSWORD'],
database: 'my_db',
})
module.exports = connection;
@rriamarria
rriamarria / conf.js
Last active December 7, 2019 12:00
ODYSSEY_EXPRESS_DELETE
const mysql = require('mysql');
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: process.env['SQLPASSWORD'],
database: 'my_db',
})
module.exports = connection;
@rriamarria
rriamarria / conf.js
Created December 7, 2019 12:25
ODYSSEY_EXPRESS_PUT
const mysql = require('mysql');
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: process.env['SQLPASSWORD'],
database: 'my_db',
})
module.exports = connection;