diff --git a/Week1/databases/connectDatabase.js b/Week1/databases/connectDatabase.js new file mode 100644 index 000000000..548df47de --- /dev/null +++ b/Week1/databases/connectDatabase.js @@ -0,0 +1,22 @@ +import pkg from 'pg'; +const { Client } = pkg; + +// Reusable function for connecting +export async function connectDB() { + const client = new Client({ + user: 'hyfuser', + host: 'localhost', + database: 'world', + password: 'hyfpassword', + port: 5432, + }); + + try { + await client.connect(); + console.log(`Connected to database: ${client.database}`); + return client; // return client so queries can be made outside + } catch (error) { + console.error('Connection error:', error); + throw error; + } +} \ No newline at end of file diff --git a/Week1/databases/setupMeetup.js b/Week1/databases/setupMeetup.js new file mode 100644 index 000000000..bb548e812 --- /dev/null +++ b/Week1/databases/setupMeetup.js @@ -0,0 +1,102 @@ +import pkg from 'pg'; +const { Client } = pkg; + +// Connect to default "postgres" database to create/drop meetup +const defaultClient = new Client({ + user: 'hyfuser', + host: 'localhost', + database: 'postgres', // connect to default DB first + password: 'hyfpassword', // update this + port: 5432, +}); + +async function setupDatabase() { + try { + await defaultClient.connect(); + + // Drop and create the meetup database + await defaultClient.query(`DROP DATABASE IF EXISTS meetup;`); + await defaultClient.query(`CREATE DATABASE meetup;`); + console.log('Database "meetup" created.'); + + await defaultClient.end(); + + // Connect to the newly created meetup database + const client = new Client({ + user: 'hyfuser', + host: 'localhost', + database: 'meetup', + password: 'hyfpassword', // update this + port: 5432, + }); + await client.connect(); + + // Create tables + await client.query(` + CREATE TABLE Invitee ( + invitee_no INT, + invitee_name VARCHAR(100), + invited_by VARCHAR(100) + ); + `); + + await client.query(` + CREATE TABLE Room ( + room_no INT, + room_name VARCHAR(64), + floor_number INT + ); + `); + + await client.query(` + CREATE TABLE Meeting ( + meeting_no INT, + meeting_title VARCHAR(64), + starting_time TIMESTAMP, + ending_time TIMESTAMP, + room_no INT + ); + `); + + console.log('Tables created.'); + + // Insert sample rows + await client.query(` + INSERT INTO Invitee (invitee_no, invitee_name, invited_by) VALUES + (1, 'Alice Johnson', 'Bob Smith'), + (2, 'Bob Smith', 'Carol White'), + (3, 'Carol White', 'David Lee'), + (4, 'David Lee', 'Alice Johnson'), + (5, 'Eve Brown', 'Bob Smith'); + `); + + await client.query(` + INSERT INTO Room (room_no, room_name, floor_number) VALUES + (101, 'Blue Room', 1), + (102, 'Green Room', 1), + (201, 'Yellow Room', 2), + (202, 'Red Room', 2), + (301, 'Conference Hall', 3); + `); + + await client.query(` + INSERT INTO Meeting (meeting_no, meeting_title, starting_time, ending_time, room_no) VALUES + (1, 'Project Kickoff', '2025-09-01 09:00:00', '2025-09-01 10:00:00', 101), + (2, 'Design Review', '2025-09-02 11:00:00', '2025-09-02 12:30:00', 102), + (3, 'Team Standup', '2025-09-03 09:30:00', '2025-09-03 10:00:00', 201), + (4, 'Client Presentation', '2025-09-04 14:00:00', '2025-09-04 15:30:00', 202), + (5, 'Retrospective', '2025-09-05 16:00:00', '2025-09-05 17:00:00', 301); + `); + + console.log('Data inserted.'); + + await client.end(); + console.log('Setup complete.'); + + } catch (err) { + console.error('Error:', err); + await defaultClient.end(); + } +} + +setupDatabase(); \ No newline at end of file diff --git a/Week1/databases/worldStats.js b/Week1/databases/worldStats.js new file mode 100644 index 000000000..99dc6a8e3 --- /dev/null +++ b/Week1/databases/worldStats.js @@ -0,0 +1,94 @@ +import { connectDB } from './connectDatabase.js'; + +async function DbQueries() { + const client = await connectDB(); + try { + // 1. What are the names of countries with population greater than 8 million? + const result1 = await client.query(` + SELECT name + FROM country + WHERE population > 8000000; + `); + console.log('Countries with population more than 8M:', result1.rows); + + // 2. What are the names of countries that have "land" in their names? + const result2 = await client.query(` + SELECT name + FROM country + WHERE name ILIKE '%land%'; + `); + console.log('Countries with "land" in their names:', result2.rows); + + // 3. What are the names of the cities with population in between 500,000 and 1 million? + const result3 = await client.query(` + SELECT name + FROM CITY + WHERE population BETWEEN 500000 AND 1000000; + `) + console.log('Cities with population between 500,000 and 1 million:', result3.rows); + + // 4. What's the name of all the countries on the continent 'Europe'? + const result4 = await client.query(` + SELECT name + FROM country + WHERE continent = 'Europe' + `) + console.log('Countries in Europe continent:', result4.rows) + + // 5. List all the countries in the descending order of their surface areas. + const result5 = await client.query(` + SELECT name + FROM country + ORDER BY surfacearea DESC + `) + console.log('countries in the descending order of their surface areas:', result5.rows) + + // 6. What are the names of all the cities in the Netherlands? + const result6 = await client.query(` + SELECT name + FROM city + WHERE countrycode = 'NLD' + `) + console.log('All cities in the Netherlands:', result6.rows) + + // 7. What is the population of Rotterdam? + const result7 = await client.query(` + SELECT population + FROM city + WHERE name = 'Rotterdam' + `) + console.log('Population of Rotterdam is:', result7.rows) + + // 8. What's the top 10 countries by Surface Area? + const result8 = await client.query(` + SELECT name + FROM country + ORDER BY surfacearea DESC + LIMIT 10 + `) + console.log('Top 10 countries by Surface Area:', result8.rows) + + // 9. What's the top 10 most populated cities? + const result9 = await client.query(` + SELECT name + FROM city + ORDER BY population DESC + LIMIT 10; + `) + console.log('Top 10 most populated cities:', result9.rows) + + // 10. What is the population number of the world? + const result10 = await client.query(` + SELECT SUM(population) + FROM country + `) + console.log('The population number of the world is:', result10.rows) + } catch (err) { + console.error('Error running queries:', err); + } finally { + await client.end(); + console.log('Connection closed.'); + } +} + +DbQueries(); \ No newline at end of file diff --git a/Week2/assignment/.gitignore b/Week2/assignment/.gitignore new file mode 100644 index 000000000..65a5c065d --- /dev/null +++ b/Week2/assignment/.gitignore @@ -0,0 +1,6 @@ +node_modules/ +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.DS_Store \ No newline at end of file diff --git a/Week2/assignment/README.md b/Week2/assignment/README.md new file mode 100644 index 000000000..7875aef35 --- /dev/null +++ b/Week2/assignment/README.md @@ -0,0 +1,11 @@ +# Week 2 Assignment + +## Quick Setup + +1. Install dependencies: + ```bash + npm install + +2. Run one command: + ```bash + node main.js \ No newline at end of file diff --git a/Week2/assignment/connectDatabase.js b/Week2/assignment/connectDatabase.js new file mode 100644 index 000000000..14dd6cdc4 --- /dev/null +++ b/Week2/assignment/connectDatabase.js @@ -0,0 +1,37 @@ +import pkg from 'pg'; +const { Client } = pkg; + +export async function setupDatabase(dropAndCreate = false) { + // Connect to default database + const defaultClient = new Client({ + user: 'hyfuser', + host: 'localhost', + database: 'postgres', + password: 'hyfpassword', + port: 5432, + }); + + await defaultClient.connect(); + console.log('Connected to default database.'); + + if (dropAndCreate) { + await defaultClient.query(`DROP DATABASE IF EXISTS research_db;`); + await defaultClient.query(`CREATE DATABASE research_db;`); + console.log('Database "research_db" created.'); + } + + await defaultClient.end(); + + // Connect to research_db + const client = new Client({ + user: 'hyfuser', + host: 'localhost', + database: 'research_db', + password: 'hyfpassword', + port: 5432, + }); + + await client.connect(); + console.log('Connected to "research_db".'); + return client; +} \ No newline at end of file diff --git a/Week2/assignment/exercise1_keys.js b/Week2/assignment/exercise1_keys.js new file mode 100644 index 000000000..541a42c18 --- /dev/null +++ b/Week2/assignment/exercise1_keys.js @@ -0,0 +1,58 @@ +import { setupDatabase } from './connectDatabase.js'; + +// Create authors table + async function createAuthorsTable() { + const client = await setupDatabase(); + try { + await client.query(` + CREATE TABLE IF NOT EXISTS authors ( + author_id SERIAL PRIMARY KEY, + author_name VARCHAR(100), + university VARCHAR(100), + date_of_birth DATE, + h_index INT, + gender VARCHAR(10) + ); + `); + console.log('Table "authors" created successfully!'); + } catch (error) { + console.error('Error creating table:', error); + } finally { + await client.end(); + } +} + +// Add mentor column +async function addMentorColumn() { + const client = await setupDatabase(); + try { + await client.query(` + DO $$ + BEGIN + IF NOT EXISTS ( + SELECT 1 + FROM information_schema.columns + WHERE table_name = 'authors' + AND column_name = 'mentor' + ) THEN + ALTER TABLE authors + ADD COLUMN mentor INT REFERENCES authors(author_id); + END IF; + END $$; + `); + console.log('Column "mentor" added successfully (or already exists).'); + } catch (error) { + console.error('Error adding mentor column:', error); + } finally { + await client.end(); + } +} + +export async function main1() { + // Drop & recreate database for a fresh start + const client1 = await setupDatabase(true); + await client1.end(); + await createAuthorsTable(); + await addMentorColumn(); + console.log('3.1. Exercise 1: Keys completed successfully!'); +} \ No newline at end of file diff --git a/Week2/assignment/exercise2_relationships.js b/Week2/assignment/exercise2_relationships.js new file mode 100644 index 000000000..a8bf2dbd7 --- /dev/null +++ b/Week2/assignment/exercise2_relationships.js @@ -0,0 +1,175 @@ +import { setupDatabase } from './connectDatabase.js'; + +// Create research_papers table +async function createResearchPapersTable() { + const client = await setupDatabase(); + try { + await client.query(` + CREATE TABLE IF NOT EXISTS research_papers ( + paper_id SERIAL PRIMARY KEY, + paper_title VARCHAR(200), + conference VARCHAR(100), + publish_date DATE + ); + `); + console.log('Table "research_papers" created successfully!'); + +// Create authors_papers table + await client.query(` + CREATE TABLE IF NOT EXISTS authors_papers ( + author_id INT REFERENCES authors(author_id), + paper_id INT REFERENCES research_papers(paper_id), + PRIMARY KEY (author_id, paper_id) + ); + `); + console.log('Table "authors_papers" created successfully!'); + } catch (error) { + console.error('Error creating tables:', error); + } finally { + await client.end(); + } +} + +// Insert authors data +async function insertAuthorsData() { + const client = await setupDatabase(); + try { + await client.query(` + INSERT INTO authors (author_name, university, date_of_birth, h_index, gender) VALUES + ('Alice Johnson', 'MIT', '1980-05-12', 45, 'F'), + ('Bob Smith', 'Stanford', '1975-09-23', 50, 'M'), + ('Clara Lee', 'Harvard', '1985-02-10', 38, 'F'), + ('David Brown', 'Oxford', '1970-07-15', 60, 'M'), + ('Eva Green', 'Cambridge', '1982-12-01', 42, 'F'), + ('Frank White', 'ETH Zurich', '1978-11-30', 47, 'M'), + ('Grace Kim', 'Seoul National', '1986-04-18', 33, 'F'), + ('Henry Zhao', 'Tsinghua', '1979-06-05', 52, 'M'), + ('Isabella Rossi', 'Polimi', '1983-08-20', 40, 'F'), + ('Jack Wilson', 'Toronto', '1976-10-28', 49, 'M'), + ('Karen Müller', 'TU Munich', '1981-03-12', 41, 'F'), + ('Liam O''Connor', 'Trinity Dublin', '1984-09-09', 39, 'M'), + ('Maria Lopez', 'UP Madrid', '1977-11-21', 46, 'F'), + ('Noah Andersson', 'KTH Sweden', '1980-01-25', 44, 'M'), + ('Olivia Dubois', 'Sorbonne', '1987-02-14', 32, 'F'); + `); + console.log('Inserted successfully into "authors"!'); + } catch (error) { + console.error('Error inserting authors:', error); + } finally { + await client.end(); + } +} + +// Assign mentors +async function assignMentorsData() { + const client = await setupDatabase(); + try { + await client.query(`UPDATE authors SET mentor = 15 WHERE author_id IN (1,2);`); + await client.query(`UPDATE authors SET mentor = 14 WHERE author_id IN (3,4);`); + await client.query(`UPDATE authors SET mentor = 13 WHERE author_id IN (5,6);`); + await client.query(`UPDATE authors SET mentor = 12 WHERE author_id IN (7,8);`); + await client.query(`UPDATE authors SET mentor = 11 WHERE author_id IN (9,10);`); + await client.query(`UPDATE authors SET mentor = 10 WHERE author_id IN (11,15);`); + await client.query(`UPDATE authors SET mentor = 9 WHERE author_id IN (13,14);`); + await client.query(`UPDATE authors SET mentor = NULL WHERE author_id IN (12);`); + + console.log('Mentors assigned to "authors" table successfully!'); + } catch (error) { + console.error('Error assigning mentors:', error); + } finally { + await client.end(); + } +} + +// Insert research_papers table data +async function insertResearchPapersData() { + const client = await setupDatabase(); + try { + await client.query(` + INSERT INTO research_papers (paper_title, conference, publish_date) VALUES + ('AI in Healthcare', 'NeurIPS', '2020-12-01'), + ('Quantum Computing Basics', 'QCS', '2019-06-15'), + ('Blockchain and Security', 'IEEE', '2021-03-20'), + ('Machine Learning Trends', 'ICML', '2022-07-10'), + ('Data Privacy', 'CCS', '2020-09-25'), + ('Robotics Advances', 'IROS', '2021-11-12'), + ('Natural Language Processing', 'ACL', '2022-05-18'), + ('Autonomous Vehicles', 'CVPR', '2019-08-08'), + ('Cloud Computing', 'ACM', '2020-02-14'), + ('Cybersecurity Challenges', 'Usenix', '2021-12-03'), + ('Deep Learning Applications', 'NeurIPS', '2022-01-20'), + ('IoT Innovations', 'IEEE', '2019-04-17'), + ('Augmented Reality', 'SIGGRAPH', '2021-07-09'), + ('Big Data Analytics', 'KDD', '2020-10-11'), + ('Software Engineering Trends', 'ICSE', '2022-03-05'), + ('Genomics and AI', 'Nature', '2021-05-25'), + ('Smart Cities', 'IEEE', '2020-11-30'), + ('Edge Computing', 'ACM', '2021-08-15'), + ('Human-Computer Interaction', 'CHI', '2019-09-20'), + ('Reinforcement Learning', 'ICML', '2022-06-14'), + ('Computer Vision', 'CVPR', '2021-02-28'), + ('Neural Networks Optimization', 'NeurIPS', '2020-03-12'), + ('Virtual Reality', 'SIGGRAPH', '2022-04-18'), + ('Database Systems', 'VLDB', '2019-12-01'), + ('Bioinformatics', 'ISMB', '2021-09-10'), + ('Graph Algorithms', 'STOC', '2020-07-07'), + ('Energy-efficient Computing', 'GreenCom', '2021-06-21'), + ('Deep Reinforcement Learning', 'ICLR', '2022-01-15'), + ('Social Network Analysis', 'WWW', '2020-05-30'), + ('AI Ethics', 'AAAI', '2021-10-12'); + `); + console.log('Inserted successfully into "research_papers" table!'); + +// Insert authors_papers links + await client.query(` + INSERT INTO authors_papers (author_id, paper_id) VALUES + (1, 1), (2, 1), + (3, 2), (4, 2), + (5, 3), + (6, 4), (7, 4), (8, 4), + (9, 5), (10, 5), + (11, 6), (12, 6), (13, 6), + (14, 7), + (1, 8), + (2, 9), (3, 9), + (4, 10), (5, 10), + (6, 11), (7, 11), + (8, 12), + (9, 13), (10, 13), + (11, 14), (12, 14), + (13, 15), + (14, 16), + (1, 17), + (2, 18), (3, 18), + (4, 19), + (5, 20), (6, 20), + (7, 21), + (8, 22), (9, 22), + (10, 23), + (11, 24), (12, 24), + (13, 25), + (14, 26), + (1, 27), + (2, 28), (3, 28), + (4, 29), + (5, 30); + `); + console.log('Inserted successfully into "authors_papers" table!'); + } catch (error) { + console.error('Error inserting research data:', error); + } finally { + await client.end(); + } +} + +export async function main2() { + const client1 = await setupDatabase(); + await client1.end(); + + await insertAuthorsData(); + await assignMentorsData(); + await createResearchPapersTable(); + await insertResearchPapersData(); + + console.log('Exercise 2: Relationships completed successfully!'); +} \ No newline at end of file diff --git a/Week2/assignment/exercise3_joins.js b/Week2/assignment/exercise3_joins.js new file mode 100644 index 000000000..cf2799ea2 --- /dev/null +++ b/Week2/assignment/exercise3_joins.js @@ -0,0 +1,49 @@ +import { setupDatabase } from './connectDatabase.js'; + +// Query authors and their mentors +export async function authorsAndMentors() { + const client = await setupDatabase(); + try { + const result1 = await client.query(` + SELECT a.author_name AS author, + m.author_name AS mentor + FROM authors AS a + INNER JOIN authors AS m + ON a.mentor = m.author_id; + `); + console.log('Successful query!', result1.rows); + } catch (error) { + console.error('Error querying tables:', error); + } finally { + await client.end(); + } +} + +// Query authors with publications +export async function authorsWithPublications() { + const client = await setupDatabase(); + try { + const result2 = await client.query(` + SELECT a.*, rp.paper_title + FROM authors AS a + LEFT JOIN authors_papers AS ap + ON a.author_id = ap.author_id + LEFT JOIN research_papers AS rp + ON ap.paper_id = rp.paper_id; + `); + console.log('Successful query!', result2.rows); + } catch (error) { + console.error('Error querying tables:', error); + } finally { + await client.end(); + } +} + +export async function main3() { + const client1 = await setupDatabase(); + await client1.end(); + + await authorsAndMentors(); + await authorsWithPublications(); + console.log('Exercise 3: Joins completed successfully!'); +} \ No newline at end of file diff --git a/Week2/assignment/exercise4_aggregates.js b/Week2/assignment/exercise4_aggregates.js new file mode 100644 index 000000000..61796936f --- /dev/null +++ b/Week2/assignment/exercise4_aggregates.js @@ -0,0 +1,70 @@ +import { setupDatabase } from './connectDatabase.js'; + +// query aggregates +async function queryAggregates() { + const client = await setupDatabase(); + try{ + const result1 = await client.query(` + -- 1. All research papers and the number of authors that wrote each paper + SELECT rp.paper_title, COUNT(ap.author_id) AS num_authors + FROM authors_papers ap + INNER JOIN research_papers rp + ON ap.paper_id = rp.paper_id + GROUP BY rp.paper_title + ORDER BY num_authors DESC; + `); + console.log('Successful query!', result1.rows); + + const result2 = await client.query(` + -- 2. Sum of the research papers published by all female authors + SELECT COUNT(ap.paper_id) AS total_papers_female + FROM authors a + INNER JOIN authors_papers ap + ON a.author_id = ap.author_id + WHERE a.gender = 'F'; + `); + console.log('Successful query!', result2.rows); + + const result3 = await client.query(` + -- 3. Average of the h-index of all authors per university + SELECT a.university, AVG(a.h_index) AS avg_h_index + FROM authors AS a + GROUP BY a.university + ORDER BY avg_h_index DESC; + `); + console.log('Successful query!', result3.rows); + + const result4 = await client.query(` + -- 4. Sum of the research papers of the authors per university + SELECT a.university, COUNT(ap.paper_id) AS total_papers + FROM authors AS a + INNER JOIN authors_papers AS ap + ON a.author_id = ap.author_id + GROUP BY a.university + ORDER BY total_papers DESC; + `); + console.log('Successful query!', result4.rows); + + const result5 = await client.query(` + -- 5. Minimum and maximum of the h-index of all authors per university + SELECT a.university, MIN(a.h_index) AS min_h_index, MAX(a.h_index) AS max_h_index + FROM authors AS a + GROUP BY a.university + ORDER BY a.university; + `); + console.log('Successful query!', result5.rows); + + } catch (error) { + console.error('Error querying tables:', error); + } finally { + await client.end(); + } +} + +export async function main4() { + const client1 = await setupDatabase(); + await client1.end(); + + await queryAggregates(); + console.log('3.4 Exercise 4: Aggregate Functions completed successfully!'); +} \ No newline at end of file diff --git a/Week2/assignment/main.js b/Week2/assignment/main.js new file mode 100644 index 000000000..f9f9c0f81 --- /dev/null +++ b/Week2/assignment/main.js @@ -0,0 +1,19 @@ +import { main1 } from './exercise1_keys.js'; +import { main2 } from './exercise2_relationships.js'; +import { main3 } from './exercise3_joins.js'; +import { main4 } from './exercise4_aggregates.js'; + +async function main() { + // 3.1. Exercise 1: Keys + await main1(); + // 3.2. Exercise 2: Relationships + await main2(); + // 3.3. Exercise 3: Joins + await main3(); + // 3.4. Exercise 4: Aggregate Functions + await main4(); + + console.log('All exercises completed successfully!'); +} + +main(); \ No newline at end of file diff --git a/Week2/assignment/package-lock.json b/Week2/assignment/package-lock.json new file mode 100644 index 000000000..0c7207618 --- /dev/null +++ b/Week2/assignment/package-lock.json @@ -0,0 +1,162 @@ +{ + "name": "assignment", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "assignment", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "pg": "^8.16.3" + } + }, + "node_modules/pg": { + "version": "8.16.3", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz", + "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", + "license": "MIT", + "dependencies": { + "pg-connection-string": "^2.9.1", + "pg-pool": "^3.10.1", + "pg-protocol": "^1.10.3", + "pg-types": "2.2.0", + "pgpass": "1.0.5" + }, + "engines": { + "node": ">= 16.0.0" + }, + "optionalDependencies": { + "pg-cloudflare": "^1.2.7" + }, + "peerDependencies": { + "pg-native": ">=3.0.1" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, + "node_modules/pg-cloudflare": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.2.7.tgz", + "integrity": "sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==", + "license": "MIT", + "optional": true + }, + "node_modules/pg-connection-string": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.9.1.tgz", + "integrity": "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==", + "license": "MIT" + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "license": "ISC", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-pool": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.10.1.tgz", + "integrity": "sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==", + "license": "MIT", + "peerDependencies": { + "pg": ">=8.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.10.3.tgz", + "integrity": "sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==", + "license": "MIT" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "license": "MIT", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "license": "MIT", + "dependencies": { + "split2": "^4.1.0" + } + }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "license": "MIT", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + } + } +} diff --git a/Week2/assignment/package.json b/Week2/assignment/package.json new file mode 100644 index 000000000..6aef09371 --- /dev/null +++ b/Week2/assignment/package.json @@ -0,0 +1,15 @@ +{ + "name": "assignment", + "version": "1.0.0", + "type": "module", + "main": "main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "pg": "^8.16.3" + } +}