Home > database >  Like interview question there is only one table, how to query
Like interview question there is only one table, how to query

Time:12-17

The CREATE TABLE game_dsl_playerlogout_fht0 (
Tdbank_imp_date STRING COMMENT 'time partition,
Worldid STRING COMMENT 'prefefined fields',
IP STRING COMMENT 'prefefined fields',
__tablename STRING COMMENT '__tablename,
Ulleventid STRING COMMENT 'ulleventid,
Iworldid BIGINT COMMENT 'iworldid,
Gamesvrid STRING COMMENT 'gamesvrid,
Dteventtime STRING COMMENT 'dteventtime,
Vgameappid STRING COMMENT 'vgameappid,
Platid BIGINT COMMENT 'platid,
Izoneareaid BIGINT COMMENT 'izoneareaid,
Vopenid STRING COMMENT 'users',
Onlinetime BIGINT COMMENT 'online time,
Ilevel BIGINT COMMENT 'level',
Playerfriendsnum BIGINT COMMENT 'friends'
)

Access database game_dsl_playerlogout_fht0 (log out) the form, and complete the following assignment:
1. Statistical active users how many (user field vopenid)
2. Statistics WeChat and hand Q users respectively how many (vgameappid as to distinguish the wx for WeChat users in the beginning, the 1104680867 for qq users, in addition to tourists, remember to guest)
3. Statistical user level distribution (iLevel field is level, show level detail)
4. User level interval distribution (a period of every 10 levels, such as 1-10 of 11-20 and so on)
5. The online time interval distribution (onlinetime unit for s, each for a period of more than 1 hour)
6. District, hierarchical distribution of interval Numbers of users (interval ditto, regional iZoneAreaId fields)

CodePudding user response:

No data, the main foreign key relationships and index

CodePudding user response:

Normally active users should be new, retained, minus the churn users, this use count query directly
  • Related