Drive IQ Technology Pty Limited & LoanOptions.ai
Description TASK 3 SQL
Given two tables ‘customer’ and ‘broker’. (Look for tables in the ./src/configs/query.sql
file)
Write an SQL query to generate a summary of how many customers are under a particular broker. The results should be sorted from high to low number of customers. If brokers have the same number of customers, then sort alphabetically. The result should list the broker name followed by the customer count. The column names are not tested, so use whatever is appropriate.
Description TASK 2 NODE.JS
Create a file which when executed from the command line, prints the values based on the arguments passed.
API Endpoint:
https://api.publicapis.org/entries
The response is a JSON object with two fields:
● count
● entries
Each record in ‘entries’ has following schema
● API
● Description
● Auth
● HTTPS
● Cors
● Link
● Category
Instructions:
● Write code inside the file which fetches data from the API and prints the values
of ‘API’ decreasing alphabetically
● The file accepts two arguments ‘category’ and ‘limit’
● Print the results matching the ‘category’ and ‘limit’ is the number of results to
print eg: php file.php Weather 5
● If no records matches the category, print ‘No results’
Possible values of ‘category’ passed as an argument ● Animals
● Anime
● Blockchain
● Books
● Business
● Calendar
● Weather
● Transportation
● Health
● Jobs
● Music
After you have cloned this repo, run npm install
after that npm run build
.
dist
folder will be created.
You have 2 options:
● run `node ./dist/index.js [category] [limit]`
data will be fetched depending on arguments passed
● run `npm start`
questions will be prompted to retrieve [category] and [limit]
data will be fetched
In the project directory, you can run:
Compile the Typescript code into Javascript into the dist
folder.
Runs the app in the production mode running node ./dist/index.js
.
Open http://localhost:5000 to view it in the browser.
Runs the app in the development mode using Typescript with the script nodemon ./src/index.ts
.
Open http://localhost:5000 to view it in the browser.