Database Development

How to prevent seek pagination from doing sequential scan over entire table

I have 3 tables and a materialized view resource_categories contains all category names and metadata create table if not exists resource_categories ( category_id INT, title VARCHAR(255), content TEXT, icon VARCHAR(50) ); resources contains all resources under each category create table if not exists resources ( resource_id INT, title VARCHAR(255), content TEXT, link VARCHAR(1000), category_id INT […]

Mastering Development

SQL Least Earning Location Count

I am using an online editor to solve query have the following SQL Table create table CITIES(id int, name String); create table USERS(id int, city_id String, name String, email); create table RIDES(id int, user_id int, distance int, fare int); INSERT INTO CITIES (id, name) VALUES (1,”Cooktown”), (2,”South Suzanne”); INSERT INTO USERS (id, city_id, name, […]


Fetch data from last week, even if no entry is present on few day

I want to fetch data from two tables post, post_like I want the data such that if row entry is not present in post_like table null/0 as result to be shown currently row data is omitted if the data is not present for a particular day. I have prepared sample data CREATE TABLE post(post_id INT, […]