diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9daa824 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +node_modules diff --git a/README0.md b/README0.md new file mode 100644 index 0000000..e082964 --- /dev/null +++ b/README0.md @@ -0,0 +1 @@ +# poll-db-1 \ No newline at end of file diff --git a/module.js b/module.js new file mode 100644 index 0000000..bf741f0 --- /dev/null +++ b/module.js @@ -0,0 +1,44 @@ +const sqlite3 = require('sqlite3').verbose(); +const fs = require('fs'); + +// const db = new sqlite3.Database('./poll.db'); + +// let politicians = fs.readFileSync('./politicians.csv', 'utf8').trim().split('\n'); +// let voters = fs.readFileSync('./voters.csv', 'utf8').trim().split('\n'); +// let votes = fs.readFileSync('./votes.csv', 'utf8').trim().split('\n'); + +function newData(namaTable, name, party, location, grade_current) { + const db = new sqlite3.Database('./poll.db'); + let temp = fs.readFileSync(`./${namaTable}.csv`, 'utf8').trim().split('\n'); + + var stmt = db.prepare(`INSERT INTO ${namaTable}(name, party, location, grade_current) VALUES (?, ?, ?, ?)`); + stmt.run([name, party, location, grade_current]); + stmt.finalize(); + console.log(`Berhasil menambah data ${namaTable}`); +} + +// newData('politicians','wika', 'w', 'ny', 11.2231231) + +function deleteData(namaTable, id) { + const db = new sqlite3.Database('./poll.db'); + let temp = fs.readFileSync(`./${namaTable}.csv`, 'utf8').trim().split('\n'); + + var stmt = db.prepare(`DELETE FROM ${namaTable} WHERE id = ?`); + stmt.run([id]); + stmt.finalize(); + console.log(`Berhasil menghapus data ${id} pada table ${namaTable}`); +} + +// deleteData('politicians',22); + +function updateData(namaTable, colomnName, colomnValue, id) { + const db = new sqlite3.Database('./poll.db'); + let temp = fs.readFileSync(`./${namaTable}.csv`, 'utf8').trim().split('\n'); + + var stmt = db.prepare(`UPDATE ${namaTable} SET ${colomnName} = ? WHERE id = ?`); + stmt.run([colomnValue, id]); + stmt.finalize(); + console.log(`Berhasil mengupdate data ${id} pada table ${namaTable}`); +} + +updateData('politicians','party','R',1); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..8336101 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,725 @@ +{ + "name": "poll-db-1", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "nan": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", + "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=" + }, + "sqlite3": { + "version": "3.1.13", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-3.1.13.tgz", + "integrity": "sha512-JxXKPJnkZ6NuHRojq+g2WXWBt3M1G9sjZaYiHEWSTGijDM3cwju/0T2XbWqMXFmPqDgw+iB7zKQvnns4bvzXlw==", + "requires": { + "nan": "2.7.0", + "node-pre-gyp": "0.6.38" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.3" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.8", + "bundled": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "caseless": { + "version": "0.12.0", + "bundled": true + }, + "co": { + "version": "4.6.0", + "bundled": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true + } + } + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true + }, + "extsprintf": { + "version": "1.3.0", + "bundled": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.4", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true + }, + "jsprim": { + "version": "1.4.1", + "bundled": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true + } + } + }, + "mime-db": { + "version": "1.30.0", + "bundled": true + }, + "mime-types": { + "version": "2.1.17", + "bundled": true, + "requires": { + "mime-db": "1.30.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + }, + "node-pre-gyp": { + "version": "0.6.38", + "bundled": true, + "requires": { + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.2", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.2", + "semver": "5.4.1", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "requires": { + "abbrev": "1.1.1", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true + }, + "qs": { + "version": "6.4.0", + "bundled": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true + } + } + }, + "readable-stream": { + "version": "2.3.3", + "bundled": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.6.0", + "uuid": "3.1.0" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true + }, + "semver": { + "version": "5.4.1", + "bundled": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.1", + "bundled": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.3", + "bundled": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "requires": { + "debug": "2.6.9", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.3.3", + "rimraf": "2.6.2", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.3", + "bundled": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "uuid": { + "version": "3.1.0", + "bundled": true + }, + "verror": { + "version": "1.10.0", + "bundled": true, + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true + } + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + } + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..aef319d --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "poll-db-1", + "version": "1.0.0", + "description": "", + "main": "seed-data.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/platinum-fox-2017/poll-db-1.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/platinum-fox-2017/poll-db-1/issues" + }, + "homepage": "https://github.com/platinum-fox-2017/poll-db-1#readme", + "dependencies": { + "sqlite3": "^3.1.13" + } +} diff --git a/politicians.csv b/politicians.csv new file mode 100644 index 0000000..9cd6217 --- /dev/null +++ b/politicians.csv @@ -0,0 +1,21 @@ +name,party,location,grade_current +Aaron Schock,R,IL,11.5362423 +Adam Kinzinger,R,IL,8.995621754 +Adam Schiff,D,LA,13.0347375 +Adam Smith,D,WA,10.23695519 +Anna Eshoo,D,WA,10.65351543 +Bill Cassidy,R,LA,9.285165569 +Candice Miller,R,WA,11.70865922 +Carolyn Maloney,D,NY,13.03522892 +Dana Rohrabacher,R,NY,10.64634133 +Duncan Hunter,R,IL,13.66509733 +Erik Paulsen,R,LA,11.69134788 +Frank Guinta,R,HI,10.94131093 +Frank LoBiondo,R,HI,13.08452404 +John Kerry,D,LA,11.01029616 +Joseph Lieberman,I,NY,7.95536381 +Michael Bennet,D,IL,7.98091322 +Olympia Snowe,R,WA,13.80125838 +Richard Shelby,R,HI,11.31326157 +Yvette Clarke,D,NY,12.45211362 +Zoe Lofgren,D,HI,12.76643582 diff --git a/poll.db b/poll.db new file mode 100644 index 0000000..e919fca Binary files /dev/null and b/poll.db differ diff --git a/poll.md b/poll.md new file mode 100644 index 0000000..9dd4532 --- /dev/null +++ b/poll.md @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/release0.js b/release0.js new file mode 100644 index 0000000..3fbd869 --- /dev/null +++ b/release0.js @@ -0,0 +1,52 @@ +var sqlite3 = require('sqlite3').verbose(); +var db = new sqlite3.Database('./poll.db'); + +db.serialize(function() { + db.all(`SELECT name, location, grade_current, (SELECT COUNT(*) FROM Votes WHERE politicianId = Politicians.id) AS totalVote + FROM Politicians + WHERE grade_current <= 9 ORDER BY grade_current ASC`, function(err, rows) { + if(err) { + console.log(err) + } else { + console.log('=====SOAL 1====='); + console.log(rows); + } + }); + + db.all(`SELECT totalVote, politicianName, first_name||' '||last_name AS voterName, gender + FROM (SELECT id, (SELECT COUNT(*) FROM Votes WHERE politicianId = Politicians.id) AS totalVote, Politicians.name AS politicianName + FROM Politicians ORDER BY totalVote DESC LIMIT 3) AS table4 + LEFT JOIN Votes ON table4.id = Votes.politicianId + LEFT JOIN Voters ON Votes.voterId = Voters.id + ORDER BY totalVote DESC`, function(err, rows) { + if(err) { + console.log(err) + } else { + console.log('=====SOAL 2====='); + console.log(rows); + } + }); + + let query = `SELECT (SELECT COUNT(*) + FROM Votes + WHERE Votes.voterId = voters.id) AS totalVote, + (Voters.first_name||' '||Voters.last_name) AS name, + gender, + age + FROM Voters + WHERE totalVote > 1 + ORDER BY totalVote DESC`; + + db.all(query, function(err, rows) { + console.log(query); + if(err) { + console.log(err) + } else { + console.log('=====SOAL 3====='); + console.log(rows); + } + }); + +}); + +db.close(); diff --git a/seed-data.js b/seed-data.js new file mode 100644 index 0000000..b1fd7a2 --- /dev/null +++ b/seed-data.js @@ -0,0 +1,36 @@ +const sqlite3 = require('sqlite3').verbose(); +const fs = require('fs'); + +const db = new sqlite3.Database('./poll.db'); + +let politicians = fs.readFileSync('./politicians.csv', 'utf8').trim().split('\n'); +let voters = fs.readFileSync('./voters.csv', 'utf8').trim().split('\n'); +let votes = fs.readFileSync('./votes.csv', 'utf8').trim().split('\n'); + +db.serialize(function() { + var stmt = db.prepare("INSERT INTO Voters(first_name, last_name, gender, age) VALUES (?, ?, ?, ?)"); + for (let i = 1; i < voters.length; i++) { + let voter = voters[i].split(',') + stmt.run([voter[0], voter[1], voter[2], voter[3]]); + } + stmt.finalize(); + console.log('Berhasil memasukan data Voters'); + + var stmt = db.prepare("INSERT INTO Politicians(name, party, location, grade_current) VALUES (?, ?, ?, ?)"); + for (let i = 1; i < politicians.length; i++) { + let politician = politicians[i].split(',') + stmt.run([politician[0], politician[1], politician[2], politician[3]]); + } + stmt.finalize(); + console.log('Berhasil memasukan data Politicians'); + + var stmt = db.prepare("INSERT INTO Votes(voterId, politicianId) VALUES (?,?)"); + for(let i = 1; i < votes.length; i++) { + let vote = votes[i].split(',') + stmt.run([vote[0],vote[1]]) + } + stmt.finalize(); + console.log('Berhasil memasukan data Votes'); +}); + +db.close(); diff --git a/setup.js b/setup.js new file mode 100644 index 0000000..48b39a8 --- /dev/null +++ b/setup.js @@ -0,0 +1,17 @@ +var sqlite3 = require('sqlite3').verbose(); +var db = new sqlite3.Database('./poll.db'); + +db.serialize(function() { + db.run("DROP TABLE IF EXISTS Voters") + db.run("CREATE TABLE Voters (id INTEGER PRIMARY KEY AUTOINCREMENT, first_name VARCHAR(20), last_name VARCHAR(20), gender VARCHAR(10), age INTEGER)"); + + db.run("DROP TABLE IF EXISTS Politicians") + db.run("CREATE TABLE Politicians (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(20), party VARCHAR(2), location VARCHAR(5), grade_current REAL)") + + db.run("DROP TABLE IF EXISTS Votes") + db.run("CREATE TABLE Votes (id INTEGER PRIMARY KEY AUTOINCREMENT, voterId INTEGER, politicianId INTEGER, FOREIGN KEY (voterId) REFERENCES Voters(id), FOREIGN KEY (politicianId) REFERENCES Politicians(id))") + + console.log("berhasil membuat table Voters, Politicians dan Votes"); +}); + +db.close(); diff --git a/voters.csv b/voters.csv new file mode 100644 index 0000000..54956f0 --- /dev/null +++ b/voters.csv @@ -0,0 +1,151 @@ +first_name,last_name,gender,age +Aaliyah,Langworth,male,61 +Aaliyah,VonRueden,male,73 +Aaliyah,Konopelski,female,39 +Abdullah,Block,male,66 +Amaya,Satterfield,male,23 +Barbara,Ortiz,female,76 +Barney,Lubowitz,female,76 +Berniece,Sanford,female,23 +Betsy,Blick,male,23 +Buster,Hodkiewicz,male,56 +Cade,Batz,female,61 +Cameron,Walsh,female,30 +Cameron,Dickinson,female,36 +Camilla,Feil,male,23 +Candice,Torp,female,23 +Courtney,Spinka,female,42 +Devon,Kutch,female,26 +Devon,Mayer,female,71 +Devon,Waters,female,70 +Devonte,Erdman,female,27 +Devonte,Pfeffer,male,29 +Dora,Schinner,male,78 +Dora,Cole,female,18 +Duncan,Dach,male,70 +Duncan,O'Reilly,male,75 +Durward,Stroman,male,37 +Elias,Watsica,female,50 +Eliezer,Predovic,female,30 +Elinore,Collier,female,75 +Emmett,Corkery,female,88 +Emmie,Swaniawski,female,76 +Fabian,Murphy,female,85 +Fabian,Keeling,male,76 +Fabian,Nolan,male,70 +Fabiola,Klocko,female,45 +Furman,Crist,male,23 +Furman,Waelchi,female,26 +Gabriel,Ledner,male,62 +Gabriel,Dicki,female,87 +Gerald,Bernier,male,23 +Graciela,Berge,female,21 +Grady,Grady,female,34 +Graham,Hoppe,female,19 +Graham,Padberg,male,58 +Harley,Murphy,male,72 +Harley,Runolfsdottir,female,37 +Hudson,Streich,male,25 +Hudson,Donnelly,male,20 +Hugh,Feil,male,33 +Hunter,Erdman,male,68 +Hyman,Grant,male,74 +Ian,Dibbert,male,40 +Isaac,Ratke,male,81 +Isabell,Price,male,73 +Iva,Roob,female,44 +Ivah,Raynor,male,71 +Ivory,Gorczany,female,61 +Ivory,Wolf,female,38 +Ivy,Stehr,female,89 +Janice,Zboncak,male,48 +Janice,Erdman,male,57 +Jason,Erdman,male,37 +Jason,Lang,female,56 +Jenifer,Lind,male,47 +Jennie,Mante,female,21 +Margarett,Wilkinson,male,73 +Margarett,Schultz,female,36 +Margaretta,Koepp,male,72 +Neoma,Gottlieb,male,38 +Nona,Murazik,female,88 +Norbert,Kozey,male,41 +Ottilie,Lakin,female,88 +Prudence,Bergstrom,female,33 +Prudence,Brakus,female,67 +Prudence,Goldner,male,37 +Prudence,Kilback,female,88 +Queen,White,female,64 +Ricardo,Koss,female,65 +Richie,Eichmann,male,85 +Richie,Sanford,female,70 +Santino,Labadie,male,18 +Santino,Nienow,female,62 +Santos,Hintz,female,20 +Santos,Jaskolski,female,79 +Sarah,Feeney,female,64 +Sarah,Hyatt,female,26 +Theodore,Ferry,female,89 +Theodore,Stamm,male,56 +Theresa,Price,female,83 +Theresia,Fay,male,64 +Theresia,Rohan,female,20 +Tobin,Streich,male,77 +Toby,Terry,female,19 +Toby,Wehner,male,18 +Tom,Huel,female,45 +Ursula,Bednar,male,65 +Ursula,Mayer,male,63 +Ursula,Hahn,female,87 +Vanessa,O'Hara,male,28 +Vanessa,Rodriguez,female,40 +Walker,Sauer,male,19 +Walker,Reichert,male,21 +Walker,Stoltenberg,female,59 +Walker,Stiedemann,female,32 +Wallace,Klein,female,41 +Walter,Franecki,female,68 +Walter,Kuvalis,male,22 +Walton,Jerde,female,73 +Xavier,Harber,female,38 +Xavier,Braun,female,41 +Xavier,Streich,female,28 +Yadira,Krajcik,female,81 +Yasmeen,Lubowitz,male,41 +Yasmeen,Thompson,female,80 +Yasmine,Keeling,male,61 +Yasmine,Rippin,female,77 +Yesenia,Schaden,female,55 +Yesenia,Watsica,female,26 +Yessenia,Hudson,female,42 +Yolanda,Jones,male,24 +Yolanda,Reynolds,female,26 +Yolanda,Abernathy,male,90 +Yoshiko,Zulauf,male,42 +Yoshiko,Klein,male,37 +Yvette,Schuster,male,76 +Yvette,Russel,male,88 +Yvonne,Wolff,male,31 +Zachariah,Dach,male,18 +Zachary,Hackett,female,45 +Zachary,Durgan,male,69 +Zachery,Metz,female,52 +Zachery,Lehner,female,25 +Zackary,Funk,female,77 +Zackery,Schuster,female,53 +Zakary,Schiller,male,78 +Zakary,Lehner,female,19 +Zakary,Hodkiewicz,female,62 +Zakary,Padberg,male,30 +Zander,Runte,male,50 +Zane,Little,female,59 +Zaria,Reichert,male,55 +Zaria,Towne,male,85 +Zechariah,Wolff,female,60 +Zechariah,Johnson,female,61 +Zelma,Langworth,male,87 +Zoe,Bernier,female,55 +Zoe,Crona,male,32 +Zoie,Waters,female,21 +Zoila,Leffler,male,72 +Zoila,Cummings,male,52 diff --git a/votes.csv b/votes.csv new file mode 100644 index 0000000..0a09425 --- /dev/null +++ b/votes.csv @@ -0,0 +1,164 @@ +voterId,politicianId, +1,17 +2,3 +3,7 +4,20 +5,11 +6,12 +7,13 +8,7 +9,1 +10,2 +11,3 +12,4 +13,5 +14,6 +15,7 +16,8 +17,9 +18,10 +19,11 +20,12 +21,7 +22,13 +23,19 +24,18 +25,16 +26,16 +27,7 +28,10 +29,9 +30,1 +31,2 +32,3 +33,7 +34,5 +35,10 +36,7 +37,7 +38,7 +39,2 +40,4 +41,20 +42,7 +43,7 +44,7 +45,4 +46,2 +47,11 +48,13 +49,6 +50,5 +51,15 +52,19 +53,20 +54,4 +55,7 +56,4 +57,6 +58,7 +59,8 +60,12 +61,7 +62,11 +63,7 +64,5 +65,11 +66,13 +67,14 +68,7 +69,7 +70,2 +71,7 +72,9 +73,7 +74,5 +75,7 +76,17 +77,18 +78,17 +79,7 +80,5 +81,4 +82,7 +83,3 +84,4 +85,6 +86,14 +87,12 +88,12 +89,12 +90,7 +91,1 +92,1 +93,4 +94,2 +95,6 +96,7 +97,9 +98,10 +99,10 +100,10 +101,12 +102,7 +103,4 +104,6 +105,7 +106,7 +107,8 +108,8 +109,7 +110,6 +111,5 +112,7 +113,7 +114,7 +115,7 +116,7 +117,7 +118,7 +119,7 +120,7 +121,4 +122,6 +123,7 +124,7 +125,7 +126,7 +127,7 +128,3 +129,19 +130,12 +131,12 +132,5 +133,9 +134,10 +135,10 +136,14 +137,13 +138,13 +139,11 +140,6 +141,5 +142,7 +143,5 +144,7 +145,6 +146,7 +147,7 +148,7 +149,7 +150,7 +1,4 +18,3 +20,9 +44,10 +44,8 +56,11 +56,5 +56,3 +101,7 +101,14 +143,17 +35,13 +28,12