Skip to content

Commit

Permalink
Adding some javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
devicemanager committed Sep 8, 2023
1 parent ad30001 commit afc608e
Show file tree
Hide file tree
Showing 13 changed files with 104,647 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.class
*gz
20 changes: 20 additions & 0 deletions Names.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const sql = require('sqlite3');
var db = new sql.Database('Names.db', sql.OPEN_READWRITE, (err) => {
if (err) {
console.log("Getting error " + err);
exit(1);
}
runQueries(db);
});


function runQueries(db) {
db.all(`
select female,surname from (select female from females order by random() limit 1) join (select surname from surnames order by random() limit 1);
`, (err, rows) => {
rows.forEach(row => {
console.log(row.female +', '+row.surname);
});
});
}

Loading

0 comments on commit afc608e

Please sign in to comment.