gagan7995

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

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

AstonJ

Hey Gaganpreet, welcome :+1:

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 :smiley:

OvermindDL1

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 Top

chasekaylee
Hi there everyone! Recently, I have fallen in love with programming with Elixir and have been having so much fun with it. I have been do...
New
IhorYachmenov
Hello. I have an iOS app where needs a proxying website through private server(HTTP / HTTPS proxy), but its idea each time has some trou...
New
Kurisu
Hello and happy new year! I would like to buy a Ruby On Rails ebook for learning purpose. What would be the ROR equivalent of “Programm...
New
GermaVinsmoke
Reading Programming Elixir 1.6 book, I’ve completed part 1 of the book. Now I’m thinking of reading Elixir in Action. What do you all sug...
New
JimmyCarterSon
I am following this tutorial . I have followed carefully correcting errors as I go. The app allows you to create a blog post and add comm...
New
conradwt
Hi, I’m building an application that will have support for both the web and mobile. At this time, I’m using PhxGenAuth for authenticatio...
New
harwind
I received this error for a binary search programme in C, despite the fact that it requested for inputs and produced the right output. Th...
/c
New
harwind
I’m presently working on a backend development project to build a RESTful API using Python and Flask. The Scaler backend developer site h...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
apoorv-2204
Anyone know how to get in golang? I am from elixir background?.
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1020 17002 374
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
PragmaticBookshelf
Author Spotlight Erin Dees @undees Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
New