Bigquery tables, dataset:salesforce, table: crm\account, description: 'customer…
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
Bigquery tables,
dataset:salesforce, table: crm_account, description: 'customer infomration', columns: ['AccountID' (STRING, Description('customer ID')), 'AccountName' (STRING), 'Industry' (STRING), 'Region' (STRING), 'CreateTime' (DATETIME), 'UpdateTime' (DATETIME), 'Segmentation' (STRING, ENUM('SKA', 'KA', 'SMB'), Description('customer priority')]
dataset:salesforce, table: TiDB_cloud_tenant, description: 'TiDB Cloud tenent information', columns: [ 'TenantID' (STRING), 'AccountID' (STRING), 'CreatedTime' (DATETIME), 'Status' (STRING), 'OrderType' (STRING, ENUM('', 'Unknown', 'On Demand', 'Commitment Plan', 'Paid PoC'))]
dataset:salesforce, table: salesforce_oppo, description: 'Business opportunity data', columns: [ 'OppoID' (STRING), 'OpportunityName' (STRING), 'OpportunityScore' (STRING), 'ACVAmount' (FLOAT64), 'ExchangeRate' (FLOAT64), 'CloseDate' (DATE), 'ForecastCategory' (STRING, ENUM('Omitted', 'Pipeline', 'Best Case', 'Closed', 'Commit')), 'LighthouseLogo' (STRING), 'Probability' (FLOAT64), 'ProductFamily' (STRING, ENUM('TiDB Cloud', 'PingCAP Services', 'TiDB Enterprise Subscription', 'PingCAP Training & Exam Services', 'PingCAP Professional Services', 'PingCAP Consulting Services')),'Region' (STRING), 'Stage' (STRING, ENUM('Closed Lost', 'Prospecting', 'Evaluation', 'Qualification', 'Bidding / Negotiating', 'Closed Won', 'Contract Review')), 'TechnicalScenario' (STRING, ENUM('Real-time HTAP', 'Scaleable OLTP', 'TiKV')), 'AccountId' (STRING), 'OpportunityRecordType' (STRING, ENUM('New', 'New Subscription', 'Renewal', 'Expansion')), 'LossReason' (STRING), 'CreatedDate' (DATE)]
dataset:model_fp_and_a, table: salesforce_activated_order, description: 'order data', columns: [ 'OrderID' (STRING), 'AccountID' (STRING), 'ACVAmount' (FLOAT64), 'ExchangeRate' (STRING), 'OrderNumberC' (STRING), 'OrderOwner' (STRING),'OrderRecordType' (STRING, ENUM('New', 'New Subscription', 'Renewal', 'Expansion')), 'OrderStartDate' (DATE), 'OrderEndDate' (DATE), 'Tax' (FLOAT64), 'TCVAmount' (FLOAT64), 'Region' (STRING), 'AccountName' (STRING), 'TermMonths' (FLOAT64), 'ProductFamily' (STRING, ENUM('TiDB Cloud', 'PingCAP Services', 'TiDB Enterprise Subscription', 'PingCAP Training & Exam Services', 'PingCAP Professional Services', 'PingCAP Consulting Services')),'FiscalPeriod' (STRING), 'SigningDate' (DATE, 'order signing date')]
Foreign keys
foreign key
salesforce.TiDB\_cloud\_tenant(AccountID) referencessalesforce.crm\_account(AccountID)foreign key
salesforce.salesforce\_oppo(AccountID) referencessalesforce.crm\_account(AccountID)foreign key
model\_fp\_and\_a.dws\_salesforce\_activated\_order\_to\_usd\_detail(AccountID) referencessalesforce.crm\_account(AccountID) - Assistant
Answer 1:
- In the table 'TiDB_cloud_tenant', the description of 'Status' column is not clear.
- The description of the 'Segmentation' column in the 'crm_account' table is not clear.
- The column 'ExchangeRate' in the 'salesforce_oppo' and 'salesforce_activated_order' tables should have a similar data type, either FLOAT64 or STRING.
- The description of the 'OrderType' column in the 'TiDB_cloud_tenant' table is not clear.
Answer 2:
- Add clear descriptions for the columns 'Status' and 'OrderType' in the 'TiDB_cloud_tenant' table.
- Add a clear definition of the 'Segmentation' column in the 'crm_account' table.
- Standardize the data type of the 'ExchangeRate' column in both tables 'salesforce_oppo' and 'salesforce_activated_order'.
- Consider creating a new table to store all the common information about a customer (such as name, region, industry) to eliminate redundant data and improve data quality.
Answer 3:
- Consider creating a column to track the customer billing history to facilitate the analysis of customer spending patterns.
- User
Please give the corresponding bigquery sql for optimization
- Assistant
For optimization, some of the suggestions can be implemented using the following bigquery SQL commands:
- Rename columns to better represent their meaning:
sqlALTER TABLE salesforce.crm_account RENAME COLUMN AccountID TO CustomerID;- Add additional columns for better data analysis:
sqlALTER TABLE salesforce.crm_account ADD COLUMN TotalOrders INT64;- Drop redundant columns:
sqlALTER TABLE salesforce.salesforce_oppo DROP COLUMN LossReason;- Create views for easier data analysis:
vbnet