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…

Where Next?

Popular Backend topics Top

DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
andrea
Can Phoenix LiveView be used in multi-page applications, unlike React/Vue/Blazor which seems to be targeted for SPA?
New
mrmurphy
I’ve run into a situation where I’ve got a list of posts inside of a container that uses phx-update=“prepend”, and the posts on the socke...
New
JimmyCarterSon
Hello, I am. very new to Elixir lang I have only been doing it for about 2 weeks. I recently started following this tutorial todo list, ...
New
Manish_bose
Can anyone help me how to convert a long data to wide data in SQL without using hard coding? Regards Manish
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
pillaiindu
Currently reading the book “Programming Phoenix LiveView”. At the end of the Chapter 1, I’m trying to solve the guess game. If the user ...
New
harwind
I have a large SQL database with millions of records, and I’ve identified duplicate entries. What’s the most efficient way to find and re...
New
Fl4m3Ph03n1x
Background I have an umbrella app where I use a dependecy called ETS. This dependency has a type called set_options that I use in some of...
New
Fl4m3Ph03n1x
Background As I often do, I read books to learn and improve myself. I also enjoy teaching and helping others when I can, so this is somet...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
New
AstonJ
Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New