Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Maria F. Marinescu rriamarria

🎯
Focusing
View GitHub Profile
@rriamarria
rriamarria / conf.js
Created Dec 7, 2019
ODYSSEY_EXPRESS_PUT
View conf.js
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 Dec 7, 2019
ODYSSEY_EXPRESS_DELETE
View conf.js
const mysql = require('mysql');
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: process.env['SQLPASSWORD'],
database: 'my_db',
})
module.exports = connection;
View conf.js
const mysql = require('mysql');
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: process.env['SQLPASSWORD'],
database: 'my_db',
})
module.exports = connection;
View conf.js
const mysql = require('mysql');
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: process.env['SQLPASSWORD'],
database: 'my_db',
})
module.exports = connection;
View discover-express.js
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) => {
View mysql_03.sql
/*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),
View mysql_02.sql
/* 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';
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
View nodejs-odyssey-quest.js
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 ? ')
You can’t perform that action at this time.