HomeCredit Test
HomeCredit Test
Name:
Date:
Result:
A. SQL test
1. Data Structure
Table with credit’s data
select * from view_credit
ID – identification of credit
Date – date of credit issue,
Credit_amount – amount of loan,
Id_person – identification of person,
Payment_num – number of monthly installments,
Interest – year interest rate.
1. Which query returns detailed information about all credits and clients who got that
credits?
a) select * from view_credit c right join view_person p on c.id = p.id_person
b) select * from view_credit c join view_person p on p.id_person = c. id_person
c) select * from view_credit c left join view_person p on p.id_person = c. id_person
d) select * from view_credit c full outer join view_person p on p.id_person = c. id_person
2. Which query returns detailed information about all clients and credits they got (i.e. it show
all clients and credits data for those who have it)?
a) select * from view_person p join view_credit c on p.id_person =c.id_person
b) select * from view_credit c join view_person p on p.id_person =c.id_person
c) select * from view_credit c left join view_person p on p.id_person =c.id_person
d) select * from view_person p left join view_credit c on p.id_person =c.id_person
3. Which query returns information about all clients who don’t have any credit?
a) select c.* from view_person p left join view_credit c on p.id_person =c.id_person where c.
id_person is null
b) select p.* from view_person p left join view_credit c on p.id_person =c.id_person where c.id is
null
c) select p.* from view_person p where p.id_person not in (select p.id_person from view_credit)
d) select p.* from view_person p where p.id_person not in (select c.id_person from view_credit
c where p.id_person = c.id_person)
4. Which query returns information about all clients who have more than 1 credit?
a) select p.* from view_person p where (select count(c.id) from view_credit c
where c.id_person=p.id_person)>1
b) select p.* from view_person p where (select count(c.id) from view_credit c
where c.id_person=p.id_person)=2
c) select p.* from view_person p join (select count(*) k, c.id_person from view_credit c group by
c.id having count(*) > 1) g on p.id_person=g.id_person
d) select p.* from view_person p join (select count(*) k, c.id_person from view_credit c group
by c.id_person having count(*) > 1) g on p.id_person=g.id_person
5. What query returns this result:
INTEREST - all possible interest rates from data (listed lowest to highest)
CREDIT_AMOUNT_SUM - sum of amounts with this interest
CREDIT_AMOUNT_MAX - maximum amount with this interest
Accs - number of accounts with this interest
SELECT INTEREST,
SUM(CREDIT_AMOUNT) CREDIT_AMOUNT_SUM,
MAX(CREDIT_AMOUNTc_AMOUNT_MAX,
COUNT(*) Accs
FROM view_credit
GROUP BY INTEREST
ORDER BY INTEREST
1. There are 6 employees in company. Two of them have 11000 USD year salary. One of
them gets 8000 USD per year. Others get 14000 USD. What is the average monthly cost
for salary for one employee in this company? Why?
The average yearly cost for salary for one employee in this company is:
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
Conclusions:
Assume there are 2 groups of people, first containing 10 males, second containing 10 females.
Average age in group of males is 25 and average age in group of females is 20. There are twins
within groups - a male and a female. Which of following conclusions are generally valid?
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
C. Analyst test
1. Analytics 1
Given the table as below:
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
b. Why the volume of Motorbike in the September is normally higher than August
and October?
……………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
c. Why the trend of Cash volume in June and July go up while others go down?
……………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
2. Analytics 2
Below table is Cash Loan Target Achievement of Team Leaders during last 13 months:
a. From your1 point of view, who are the best and the worst Team Leader? Why?
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................
…………………………………………………………………………………........................................................