How to list all station between selected two stations based on next_station_id
For instance, if the user selects origin A station and destination to J than I want to list all stations in ORDER that ...
I am building out a shipping app and database. Each shipment has three parties to it, shipper, receiver, and notification party and they all have the same attributes. I want to keep the attributes in ...
I have created a select statement that show all the topics that are assigned to a book. Now I am trying to create a Select statement that shows all the topics that are not assigned to the book. Book ...
I have three tables:
locations (has zipcode, location name);
professionals (has name);
I want to select only those rows from locations table where professional_id is 4. What's ...
Assume that there are 4 tables, with association tables "between" each of them:
Machines may serve many products, and a product may "belong to" many machines. ...
I have a table for images.
I have tables for entities such as people, cars, houses, trains and dogs to which I need to assign images.
I need to assign images to entities. The obvious solution is to ...
Imagine a setup of three tables, User, Group, and UserGroup, where UserGroup consists of simple a foreign key to each of User and Group tables.
I'm trying to figure out if it is bad practice to have more than one path between tables that are related via many-to-many relationships.
I have 3 user-facing tables: Dupe, Cue, and Take. There is a ...
I have the following three tables:
create table users(id int primary key, name varchar);
create table groups(id int primary key, name varchar);
create table user_groups(uid int references users(id),...
I'm having a problem with deadlocks on a many-to-many insert and am pretty far out of my league at this point.
I have a tweet table that receives thousands of records per second. One of the columns ...
My question is mostly conceptual in nature. I have a database schema that involves a many-to-many relationship between a School table and Student table. This seems sensible to me, given that a school ...
I have the following case, which I can only describe as a chain of two many-to-many relationships:
There are three business entities (tables) and two junction tables:
SO told me to ask here, so this is just copy-pasted from over there
We're making a database of anime. Every anime can be listed as having been made by an arbitrary number of studios, and every studio ...
I'm having some trouble modeling the database for this particular scenario in Postgres:
We have a set of toys that contain several pieces. Each piece is associated with one or more materials. All of ...
I've never come up against a similar situation and so I'm looking to gather some tips on how to accomplish this. Here's the situation:
I'm creating an application to track and manage sheet music and ...