Top "Relational-division" questions

Operation in relational algebra or in an RDBMS (mostly SQL) to partition relations.

Select group of rows that match all items in a list

Assume I have two tables: cars – list of cars carname | modelnumber | ... passedtest – contains every test that a car passed: id | …

sql sql-server tsql relational-division
MySQL select join where AND where

I have two tables in my database: Products id (int, primary key) name (varchar) ProductTags product_id (int) tag_id (…

mysql join where-in relational-division
SQL query through an intermediate table

Given the following tables: Recipes | id | name | 1 | 'chocolate cream pie' | 2 | 'banana cream pie' | 3 | 'chocolate banana surprise' Ingredients | id | name | 1 | 'banana' | 2 | …

sql join where relational-division
PostgreSQL where all in array

What is the easiest and fastest way to achieve a clause where all elements in an array must be matched …

sql ruby-on-rails postgresql activerecord relational-division
How to filter SQL results in a has-many-through relation

Assuming I have the tables student, club, and student_club: student { id name } club { id name } student_club { student_id …

mysql sql postgresql sql-match-all relational-division
check if a column contains ALL the values of another column - Mysql

Let's suppose I have a table T1 with people IDs and other stuff IDs, as the following Table: T1 personID | …

mysql sql relational-division
Select values that meet different conditions on different rows?

This is a very basic query I can't figure out.... Let's say I have a two column table like this: …

mysql sql relational-division sql-match-all
How to find all pizzerias that serve every pizza eaten by people over 30?

I'm following the Stanford Database course and there's a question where we have Find all pizzerias that serve every pizza …

relational-algebra relational-division
Find rows that have same value in one column and other values in another column?

I have a PostgreSQL database that stores users in a users table and conversations they take part in a conversation …

sql postgresql relational-division
SQL how to search a many to many relationship

I have a database with two main tables notes and labels. They have a many-to-many relationship (similar to how stackoverflow.…

sql search many-to-many relational-division