gagan7995
Please tell me how to write a query for this in nodejs
API 4
Path:
/user/following/
Method:
GET
Description:
Returns the list of all names of people whom the user follows
Response
[
{
“name”: “Narendra Modi”
},
…
]
Tables:
User Table
| Column | Type |
|---|---|
| user_id | INTEGER |
| name | TEXT |
| username | TEXT |
| password | TEXT |
| gender | TEXT |
Follower Table
| Column | Type |
|---|---|
| follower_id | INTEGER |
| follower_user_id | INTEGER |
| following_user_id | INTEGER |
Here, if user1 follows user2 then,
follower_user_id
is the user ID of user1 and
following_user_id
is the user ID of user2.
Most Liked
gagan7995
Sir I’m using Node js
Given an
app.js
file and a database file
twitterClone.db
consisting of five tables
user
,
follower
,
tweet
,
reply
, and
like
.
Write APIs to perform operations on the tables
user
,
follower
,
tweet
,
reply
, and
like
containing the following columns,
User Table
| Column | Type |
|---|---|
| user_id | INTEGER |
| name | TEXT |
| username | TEXT |
| password | TEXT |
| gender | TEXT |
Follower Table
| Column | Type |
|---|---|
| follower_id | INTEGER |
| follower_user_id | INTEGER |
| following_user_id | INTEGER |
Here, if user1 follows user2 then,
follower_user_id
is the user ID of user1 and
following_user_id
is the user ID of user2.
Tweet Table
| Column | Type |
|---|---|
| tweet_id | INTEGER |
| tweet | TEXT |
| user_id | INTEGER |
| date_time | DATETIME |
Reply Table
| Column | Type |
|---|---|
| reply_id | INTEGER |
| tweet_id | INTEGER |
| reply | TEXT |
| user_id | INTEGER |
| date_time | DATETIME |
Like Table
| Column | Type |
|---|---|
| like_id | INTEGER |
| tweet_id | INTEGER |
| user_id | INTEGER |
| date_time | DATETIME |
Sample Valid User Credentials
Sir I unable to perform the sql qurery for this can you help me
AstonJ
Hey Gaganpreet, welcome 
Your post was missing some context - what language/framework are you using etc? If you can add some more info that would help others get more of an idea of what you’re after 
OvermindDL1
You are still missing information, like what format the *.db file is, what connector library you are using to access it, etc… etc…
Popular Backend topics
Other popular topics
Latest in Node.js
Backend>Questions
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /python
- /rails
- /js
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /svelte
- /onivim
- /typescript
- /kotlin
- /c-plus-plus
- /crystal
- /tailwind
- /react
- /gleam
- /ocaml
- /elm
- /flutter
- /vscode
- /ash
- /opensuse
- /html
- /centos
- /php
- /deepseek
- /zig
- /scala
- /sublime-text
- /textmate
- /lisp
- /react-native
- /nixos
- /debian
- /agda
- /kubuntu
- /arch-linux
- /django
- /deno
- /revery
- /ubuntu
- /manjaro
- /spring
- /nodejs
- /diversity
- /lua
- /julia
- /slackware
- /c






