18. People who call each other.
Those who make the calls have a contract with company “Telecom”
19. PEOPLE who CALL each other.
Those who make the calls have a CONTRACT with COMPANY “Telecom”
20. How does the average call duration among customers aged under 20 compare with
those aged over 40?
Since September 14th, which customers called the person X?
Who are the people who have received a call from a London customer aged over
50 who has previously called someone aged under 20?
Who are the common contacts of customers X and Y?
Who are the customers who 1) have all called each other and 2) have all called
person X at least once?
21. How does the average call duration among customers aged under 20 compare with
those aged over 40?
Since September 14th, which customers called the person X?
Who are the people who have received a call from a London customer aged over
50 who has previously called someone aged under 20?
Who are the common contacts of customers X and Y?
Who are the customers who 1) have all called each other and 2) have all called
person X at least once?
22. How does the average call duration among customers aged under 20 compare with
those aged over 40?
Since September 14th, which customers called the person X?
Who are the people who have received a call from a London customer aged over
50 who has previously called someone aged under 20?
Who are the common contacts of customers X and Y?
Who are the customers who 1) have all called each other and 2) have all called
person X at least once?
23. How does the average call duration among customers aged under 20 compare with
those aged over 40?
Since September 14th, which customers called the person X?
Who are the people who have received a call from a London customer aged over
50 who has previously called someone aged under 20?
Who are the common contacts of customers X and Y?
Who are the customers who 1) have all called each other and 2) have all called
person X at least once?
24. How does the average call duration among customers aged under 20 compare with
those aged over 40?
Since September 14th, which customers called the person X?
Who are the people who have received a call from a London customer aged over
50 who has previously called someone aged under 20?
Who are the common contacts of customers X and Y?
Who are the customers who 1) have all called each other and 2) have all called
person X at least once?
36. Company plays the role of a provider in a contract
call
caller
person
first-name
last-name
phone-number
city
age
callee
customer
companyprovider
name
contract
37. CALL has duration and started at
call
caller
person
first-name
last-name
phone-number
city
age
callee
customer
company
duration
started-at
provider
name
contract
39. define
contract sub relationship,
relates provider,
relates customer;
call sub relationship,
relates caller,
relates callee;
company sub entity,
plays provider;
person sub entity,
plays customer,
plays caller,
plays callee;
call
caller
person
callee
customer
company
provider
contract
40. define
contract sub relationship,
relates provider,
relates customer;
call sub relationship,
relates caller,
relates callee,
has duration,
has started-at;
company sub entity,
plays provider,
has name;
person sub entity,
plays customer,
plays caller,
plays callee,
has first-name,
has last-name,
has phone-number,
has city,
has age,
has is-customer;
person
first-name
last-name
phone-number
city
age
company
name
call
duration
started-at
41. relates caller,
relates callee,
has duration,
has started-at;
company sub entity,
plays provider,
has name;
person sub entity,
plays customer,
plays caller,
plays callee,
has first-name,
has last-name,
has phone-number,
has city,
has age,
has is-customer;
name sub attribute datatype string;
started-at sub attribute datatype date;
duration sub attribute datatype long;
first-name sub attribute datatype string;
last-name sub attribute datatype string;
phone-number sub attribute datatype string;
city sub attribute datatype string;
age sub attribute datatype long;
is-customer sub attribute datatype boolean;
first-name
last-name
phone-number
city
age
name
duration
started-at
42. define
contract sub relationship,
relates provider,
relates customer;
call sub relationship,
relates caller,
relates callee,
has started-at,
has duration;
company sub entity,
plays provider,
has name;
person sub entity,
plays customer,
plays caller,
plays callee,
has first-name,
has last-name,
has phone-number,
has city,
has age,
has is-customer;
name sub attribute datatype string;
started-at sub attribute datatype date;
duration sub attribute datatype long;
first-name sub attribute datatype string;
last-name sub attribute datatype string;
phone-number sub attribute datatype string;
city sub attribute datatype string;
age sub attribute datatype long;
is-customer sub attribute datatype boolean;
43.
44.
45.
46.
47. Since September 14th, which customers called the person X?
The person with phone number +86 921 547 9004 has been identified as a lead. We (company
"Telecom") would like to know which of our customers have been in contact with this person
since September 14th. This will help us in converting this lead into a customer.
match
$customer isa person has phone-number $phone-number;
$company isa company has name "Telecom";
(customer: $customer, provider: $company) isa contract;
$target isa person has phone-number "+86 921 547 9004";
(caller: $customer, callee: $target) isa call has started-at
$started-at;
$min-date == 2018-09-14T17:18:49; $started-at > $min-date;
get $phone-number;
48. Who are the people who have received a call from a London customer aged over 50 who
has previously called someone aged under 20?
We (company "Telecom") have received a number of harassment reports, which we suspect is caused by one individual. The only
thing we know about the harasser is that he/she is aged roughly over 50 and lives in London. The reports have been made by
young adults all aged under 20. We wonder if there is a pattern and so would like to speak to anyone who has received a call from
a suspect, since he/she potentially started harassing.
match
$suspect isa person has city "London", has age > 50;
$company isa company has name "Telecom";
(customer: $suspect, provider: $company) isa contract;
$pattern-callee isa person has age < 20;
(caller: $suspect, callee: $pattern-callee) isa call has started-at $pattern-call-date;
$target isa person has phone-number $phone-number, has is-customer false;
(caller: $suspect, callee: $target) isa call has started-at $target-call-date;
$target-call-date > $pattern-call-date;
get $phone-number;
49. Who are the common contacts of customers X and Y?
The customer with phone number +7 171 898 0853 and +370 351 224 5176 have been
identified as friends. We (company "Telecom") like to know who their common contacts are in
order to offer them a group promotion.
match
$common-contact isa person has phone-number $phone-number;
$customer-a isa person has phone-number "+7 171 898 0853";
$customer-b isa person has phone-number "+370 351 224 5176";
(caller: $customer-a, callee: $common-contact) isa call;
(caller: $customer-b, callee: $common-contact) isa call;
get $phone-number;
50. How does the average call duration among customers aged under 20
compare with those aged over 40?
In order to better understand our customers' behaviour, we (company "Telecom") like to know how the average
phone call duration among those aged under 20 compares to those aged over 40.
match
$customer isa telecom-customer has age < 20;
$company isa company has name "Telecom";
(customer: $customer, provider: $company) isa contract;
(caller: $customer, callee: $anyone) isa call has duration
$duration;
aggregate mean $duration;
51. Who are the customers who 1) have all called each other and
2) have all called person X at least once?
The person with phone number +48 894 777 5173 has been identified as a lead. We (company "Telecom")
would like to know who his circle of (customer) contacts are, so that we can encourage them in converting this
lead to a customer.
match
$target isa person has phone-number "+48 894 777 5173";
$company isa company has name "Telecom";
$customer-a isa person has phone-number $phone-number-a;
$customer-b isa person has phone-number $phone-number-b;
(customer: $customer-a, provider: $company) isa contract;
(customer: $customer-b, provider: $company) isa contract;
(caller: $customer-a, callee: $customer-b) isa call;
(caller: $customer-a, callee: $target) isa call;
(caller: $customer-b, callee: $target) isa call;
get $phone-number-a, $phone-number-b;
52. Intelligence begins from the database
To ask questions intuitively modelling the
database needs to feel intuitive