-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad30001
commit afc608e
Showing
13 changed files
with
104,647 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.class | ||
*gz |
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
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); | ||
}); | ||
}); | ||
} | ||
|
Oops, something went wrong.