Top "Relation" questions

A relation on sets S1, S2, ..., SN is any subset of S1 x S2 x ... x SN, where 'x' denotes the Cartesian product.

Laravel Eloquent Sum of relation's column

I've been working on a shoppingcart application and now I've come to the following issue.. There is a User, a …

php laravel eloquent relation
SQL ON DELETE CASCADE, Which Way Does the Deletion Occur?

If I have two relations in a database, like this: CREATE TABLE Courses ( CourseID int NOT NULL PRIMARY KEY, Course …

sql database database-design cascade relation
How to return an empty ActiveRecord relation?

If I have a scope with a lambda and it takes an argument, depending on the value of the argument, …

ruby-on-rails activerecord relation
How to find all the relations between all mysql tables?

How to find all the relations between all MySQL tables? If for example, I want to know the relation of …

mysql database relationship relation
utf8_bin vs. utf_unicode_ci

My table Website Website_Name//column name Google Facebook Twitter Orkut Frype Skype Yahoo Wikipedia I i use utf8_bin …

mysql database collation relation
Laravel Grouping by Eloquent Relationship

How can I group by relation? Example Sales::with('product_detail.product')->groupBy('product_name')->get() …

laravel relation
Insertion Anomaly

I am learning insertion anomaly from here. Following data is written in it, Insert Anomalies An Insert Anomaly occurs when …

sql database relation relational-algebra
Query records through its belongs_to relation in Rails

I have an Activities model, and they belong_to a Location How do i select all the activities whose location.…

ruby-on-rails ruby activerecord relation
How to use constant in the ON condition in Yii2 hasMany relation

I try to create a polymorphic association, what is common in Rails but unfortunately not in Yii2. As part of …

yii2 has-many polymorphic-associations relation
Implementing one-to-zero-or-one relation in SQL Server

I'm using Entity Framework 4.1 database first approach. I've used legacy database. In my edmx file which created entity classes based …

sql-server sql-server-2008 entity-framework-4.1 entity-relationship relation