Skip to content

Commit

Permalink
everything lc
Browse files Browse the repository at this point in the history
  • Loading branch information
jonroig committed Aug 18, 2024
1 parent 389f4fe commit 9f78180
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ getByName();
``` js
const getDetailed = async () => {
const usBabyNames = await import('../lib/usBabyNames.mjs');
const theDetails = await usBabyNames.getDetailed('jonathan', 'M');
const theDetails = await usBabyNames.getDetailed('jonathan', 'm');
console.log('theDetails', theDetails);
};

Expand All @@ -77,7 +77,7 @@ getDetailed();
name: string,
year: int,
yearRange: {start: int, end: int},
sex: string (M/F),
sex: string (m/f),
rank: int,
rankRange: {start: int, end: int},
births: int,
Expand All @@ -90,7 +90,7 @@ Output from all the functions above looks like this:
[
{ id: 784623,
name: 'jonathan',
sex: 'M',
sex: 'm',
births: 10919,
rank: 30,
year: 1975 }
Expand Down Expand Up @@ -128,7 +128,7 @@ Output for .getNameRankAndBirthsByYear("kanye") looks like:
{
id: 88737,
name: 'bertha',
sex: 'M',
sex: 'm',
nameData: {
"name": "Bertha",
"sex": "female",
Expand Down Expand Up @@ -161,7 +161,7 @@ const directDbAccess = async () => {
const usBabyNamesModule = await import('../lib/usBabyNames.mjs');
const nameDataDb = usBabyNamesModule.nameDataDb;
const nameDetailsDb = usBabyNamesModule.nameDetailsDb;
const nameDetailsSql = "SELECT * from usNameDetails where name = 'jonathan' and sex = 'M' ";
const nameDetailsSql = "SELECT * from usNameDetails where name = 'jonathan' and sex = 'm' ";
nameDetailsDb.all(nameDetailsSql, [], (err, rows) => {
if (err) {
console.log('err', err);
Expand All @@ -170,7 +170,7 @@ const directDbAccess = async () => {
console.log(rows);
});

const nameDataSql = "SELECT * from usNameData where name = 'jonathan' AND sex = 'M' ORDER BY year DESC limit 10";
const nameDataSql = "SELECT * from usNameData where name = 'jonathan' AND sex = 'm' ORDER BY year DESC limit 10";
nameDataDb.all(nameDataSql, [], (err, rows) => {
if (err) {
console.log('err', err);
Expand Down Expand Up @@ -202,9 +202,8 @@ You can access the baby name sqlite database directly from the command line like
``` sql
# sqlite3 sqlite/us-name-data.sqlite

select * from usNameData WHERE name = 'jonathan' AND year = 1975 AND sex = 'M';
select * from usNameData WHERE name = 'jonathan' AND year = 1975 AND sex = 'm';

select * from usNameData WHERE name = 'jonathan' AND sex = 'M' ORDER BY year DESC;
```

# Name Meanings / Pronunciation / Details database
Expand All @@ -215,7 +214,7 @@ Generated by Chat GPT-4o-mini over the course of a few days in early August 2024
``` sql
# sqlite3 sqlite/us-name-details.sqlite

select * from usNameDetails where name = 'bertha' AND sex = 'F';
select * from usNameDetails where name = 'bertha' AND sex = 'f';
```

# USA Historical Name Data Source: Government Fine Print
Expand Down

0 comments on commit 9f78180

Please sign in to comment.