This is an old revision of the document!
Database View Description of "view_users_subscribed_to"
Name
view_users_subscribed_to
Description
Tentative description: I'm not completely sure how this all goes. So here is an attempt to describe what the view is doing. I may be completely wrong as I'm not sure what the users and the client fields in the client table actually mean. Does the client.client field refer to the user of which that row is a client or does it mean that that user is the client of the client.users user?
This view lists the users that have clients.
There are three tables involved: client, users and client status. If we look at the WHERE clause of the SQL statement we see that only those rows from the table users and the table client are selected where client.users matches users.identifier. This is an inner join that basically filters out only those users that are included in the client table. The next where clause reduces the list to only those entries that have a valid status.
Now the question is if we will see users multiple times if they have multiple clients or not?
Purpose
Schema
create view view_users_subscribed_to as select client.identifier, client.users, client.client, users.last_name, users.first_name, date_of_creation, client_status.value, client.status from client, users, client_status where client.users = users.identifier and client.status = client_status.identifier order by users.last_name, users.first_name;
Related tables
History
Used first
Version 2.5
Used last
Still in use
Change history
= Version 2.5 =
create view view_users_subscribed_to as select client.identifier, client.users, client.client, users.last_name, users.first_name, date_of_creation, client_status.value, client.status from client, users, client_status where client.users = users.identifier and client.status = client_status.identifier order by users.last_name, users.first_name;