Lots of Queries, Lots of Users, lots of Data -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ; -- Query displays service types by month -- Valid values are 1- 12 for month_key select month_key ,service_key,count(*) from telco_facts where month_key = 1 group by month_key,service_key ; -- A look at customers who have the following service -- call waiting , caller id, and voice mail by fiscal period -- i.e. Q1,Q2,Q3,Q4 for year= 1998 select service_key,fiscal_period,count(*) from telco_facts T,month M where T.month_key=M.month_key and service_key = 4 group by fiscal_period,service_key order by fiscal_period,service_key ; -- female Customers in Massachusetts that do not have -- caller id select distinct(C.customer_key), C.customer_first_name, C.customer_last_name, C.phone_number from residential_customer C,service,telco_facts where C.customer_key = telco_facts.customer_key and telco_facts.service_key = service.service_key and caller_id_flag = 'N' and state = 'MA' and customer_gender = 'F' ; -- Find prospects for voice mail based on the criteria -- that customers with call waiting and caller id are -- good prospects for call Waiting select state, count(*) from telco_facts T,service S, residential_customer C, month M where T.service_key = S.service_key and T.customer_key = C.customer_key and T.month_key = T.month_key and call_waiting_flag = 'Y' and caller_id_flag = 'Y' and voice_mail_flag = 'N' and state in ('NY','NJ','PA') and fiscal_period = 'Q1' group by state ; -- Find customers that had ISDN service in February 1998 select customer_last_name ,customer_first_name from residential_customer R ,telco_facts T,service S,month M where M.month_text = 'February ' and M.year = 1998 and S.isdn_flag = 'Y' and M.month_key = T.month_key and S.service_key = T.service_key and R.customer_key = T.customer_key ; -- Look at the local call minutes to see if they -- have increased after adding call waiting select fiscal_period,count(*),sum(local_call_minutes) from residential_customer R ,telco_facts T,status S,month M where S.call_waiting_status='Added' and state = 'OH' and M.month_key= T.month_key and S.status_key = T.service_key and R.customer_key = T.customer_key group by fiscal_period order by fiscal_period ; -- Look at the call usage for customers with call waiting -- "service type 2" compared with customers with both call -- waiting and Caller id for Q4 for customers in CA select fiscal_period,T.service_key,sum(local_call_minutes), sum(local_call_count),count(*) from telco_facts T,residential_customer C,service S,month M where T.customer_key = C.customer_key and T.service_key = S.service_key and T.month_key = M.month_key and fiscal_period = 'Q4' and T.service_key in (02,03) and state = 'CA' group by fiscal_period,T.service_key ;