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

PragmaticBookshelf
Go is a modern programming language that combines the reliability of compiled languages with the ease of use and flexibility of dynamic t...
New
PragmaticBookshelf
The next step in the evolution of user interfaces is here. Chatbots let your users interact with your service in their own natural langua...
New
PragmaticBookshelf
Classroom-tested by tens of thousands of students, this new edition of the bestselling intro to programming book is for anyone who wants ...
New
AstonJ
Currently a hot topic in the BEAM world, let’s start a thread for it (as suggested by @crowdhailer here) :smiley: What are your current...
New
New
New
andrea
Can Phoenix LiveView be used in multi-page applications, unlike React/Vue/Blazor which seems to be targeted for SPA?
New
kelvinst
I have being some Elixir open-source contributions and side projects. Oh, and I’m doing them on livestreams on my twitch channel, follow ...
New
PragmaticBookshelf
Learn Functional Programming by building a complete web application that uses Kotlin, TDD with end-to-end tests, and CQRS and Event Sourc...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New

Other popular topics Top

PragmaticStudio
Let’s get real. As in really knowing—clearly and practically—what’s up with Phoenix LiveView. What is it? How does it work? What can I ...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
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
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New