Hi,

I'm interested in using MariaDB for temporal data but I'm a bit uncertain on 
how to solve certain use cases. As an example let's say I define two temporal 
tables<https://mariadb.com/kb/en/temporal-data-tables> using application time 
periods<https://mariadb.com/kb/en/temporal-data-tables/#application-time-periods>
 where one table has a one to many relationship with the other. For example:

[cid:8f4d19a2-4743-4e32-9516-16a626f9169f]

What I'm looking for is a way to "select a teacher and count the number of 
associated classes for this teacher" at a moment in time. My questions are:

 1. How would I define/create the two tables using temporal tables?
 2. What would such a select statement look like?
 3. What indexes should be created in order to make the select statement 
efficient?

Note that it's very important that the query is expressed using application 
time and not system time.

BR,
/Johan

_______________________________________________
Mailing list: https://launchpad.net/~maria-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~maria-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to