Logo Studenta

Capítulo 1 Manipulación de Datos con SQL

Esta es una vista previa del archivo. Inicie sesión para ver el archivo original

Capítulo 1 Manipulación de Datos con SQL.sql
{"version":"NotebookV1","origId":981926856608981,"name":"Capítulo 1 Manipulación de Datos con SQL","language":"sql","commands":[{"version":"CommandV1","origId":981926856608982,"guid":"03a07ca5-295e-418e-b259-d45eefaa5604","subtype":"command","commandType":"auto","position":1.25,"command":"%md\n\n# Curso EAA361: Análisis de Big Data\n\n## Módulo 1: Manipulación de datos con SQL (Apache Hive)\n\n### Ilustración con ejemplos de clases\n\nEn el presente notebook en SQL se encuentran todas las consultas utilizadas en la primera parte del capítulo del curso \"Manipulación de datos y sistemas de Big Data\". Aquí usted puede ejecutar sentencias y consulta sobre las tablas cargadas en el portal web del curso.\n\nApache Hive es un sistema de Big Data que trabaja de manera distribuída con HiveQL, por lo tanto los datos cargados y las consultas son ejecutadas sobre un cluster de compurtadores como tarea Spark.\n\n[https://hive.apache.org/](https://hive.apache.org/)\n\n***Cristian Vásquez***","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575917858,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"6c1ceff3-f321-46f9-a8cb-0db029128137"},{"version":"CommandV1","origId":981926856608983,"guid":"8a467c36-f84b-498c-a67c-e86f1f367304","subtype":"command","commandType":"auto","position":1.5,"command":"show tables;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1553005892710,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"a13ad3bf-ba9d-49d5-b883-2a6f00f78c38"},{"version":"CommandV1","origId":981926856608984,"guid":"d4f119f6-2844-4179-8638-11129151a744","subtype":"command","commandType":"auto","position":2.0,"command":"select EmpID, \n JobCode, \n Salary\nfrom payrollmaster\nlimit 5","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575918976,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"barChart","width":"465","height":"280","xColumns":["JobCode"],"yColumns":["Salary"],"pivotColumns":[],"pivotAggregation":"avg","useConsistentColors":false,"customPlotOptions":{"barChart":[{"key":"grouped","value":true},{"key":"stacked","value":false},{"key":"100_stacked","value":false}]},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":true,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"5378dda0-c1c1-4ce7-bcc3-3e02cda4836c"},{"version":"CommandV1","origId":981926856608985,"guid":"e9262cb3-6e34-4357-9ad6-0f78afff1584","subtype":"command","commandType":"auto","position":3.0,"command":"select EmpID, \n JobCode, \n Salary\nfrom payrollmaster\nwhere JobCode like '%NA%'\norder by Salary desc","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575919422,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"barChart","width":"579","height":"384","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"fc3c7769-bf7c-4f5b-9d5c-5c0a9f576760"},{"version":"CommandV1","origId":981926856608986,"guid":"71272e99-969a-4640-abdf-48a5a5e18af0","subtype":"command","commandType":"auto","position":4.0,"command":"select *\nfrom payrollmaster","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575919749,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"801","height":"380","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"9eacd3da-c1e1-4f96-ba58-e0897eb6057e"},{"version":"CommandV1","origId":981926856608987,"guid":"ac1d4a49-3d3a-410d-aa07-e86e737d3927","subtype":"command","commandType":"auto","position":5.0,"command":"select EmpID, \n JobCode,\n Salary,\n cast(REGEXP_REPLACE(substr(Salary,2) ,',','') as int)*0.10 as Bono\n from payrollmaster;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575920141,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"barChart","width":"673","height":"329","xColumns":["JobCode"],"yColumns":["Salary"],"pivotColumns":[],"pivotAggregation":"avg","useConsistentColors":false,"customPlotOptions":{"barChart":[{"key":"grouped","value":true},{"key":"stacked","value":false},{"key":"100_stacked","value":false}]},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"992de9ab-cff2-4b3c-adf3-bfd518c01305"},{"version":"CommandV1","origId":981926856608988,"guid":"ed714e1d-1f5c-4c95-bc55-5444dcb903f6","subtype":"command","commandType":"auto","position":6.0,"command":"select distinct gender, jobcode\nfrom payrollmaster","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575920515,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"705","height":"328","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"2a564619-f20e-4caf-b7fe-fd106dc3df95"},{"version":"CommandV1","origId":981926856608989,"guid":"1ca2e425-61e7-4981-8fd1-cab8b87f6944","subtype":"command","commandType":"auto","position":7.0,"command":"select
distinct FlightNumber,\n Destination\nfrom internationalflights;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575920732,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"534","height":"341","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"c185916f-fd68-449c-9af2-b78f9c3b3719"},{"version":"CommandV1","origId":981926856608990,"guid":"ec17c25e-916f-4067-aad4-61171cd79fa3","subtype":"command","commandType":"auto","position":8.0,"command":"create table new_payrollmaster as\nselect EmpID, \n JobCode,\n Salary,\n Gender,\n cast(REGEXP_REPLACE(substr(Salary,2) ,',','') as int) as New_Salary \nfrom payrollmaster;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1553611672206,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"4f0e5a8d-10f9-4dd8-a981-8e85025c3cf1"},{"version":"CommandV1","origId":981926856608991,"guid":"38391c6a-d513-489a-8c1b-f429cb4d4cfe","subtype":"command","commandType":"auto","position":9.0,"command":"select *\nfrom new_payrollmaster\nwhere New_Salary > 112000","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575921275,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"557","height":"534","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"88d6cd68-4c64-4568-a962-f064aeef48af"},{"version":"CommandV1","origId":981926856608992,"guid":"3c7e08cd-6474-41f0-ba8f-4fa06c7de107","subtype":"command","commandType":"auto","position":10.0,"command":"select *\nfrom new_payrollmaster\nwhere New_Salary > 112000","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575921447,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"d3c0e54a-cd10-4d3c-ab5d-881363560bf8"},{"version":"CommandV1","origId":981926856608993,"guid":"0995ec9c-333f-4717-9afd-5e92426214f8","subtype":"command","commandType":"auto","position":11.0,"command":"--select *\n--from internationalflights\n--where destination in ('FRA','YYZ')\n\nselect *\nfrom internationalflights\nwhere destination = 'FRA'\n or destination = 'YYZ' ","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575921833,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"464","height":"299","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"3a7ee137-6343-43a8-91cc-9d19c95f5324"},{"version":"CommandV1","origId":981926856608994,"guid":"47d3e857-595c-42ef-81ec-7c3ae06e9a3f","subtype":"command","commandType":"auto","position":12.0,"command":"select *\nfrom internationalflights\nwhere destination = 'YYZ' and Boarded > 115","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575922250,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"478","height":"324","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"427e5805-15a3-4264-bb29-52ebf36ac081"},{"version":"CommandV1","origId":981926856608995,"guid":"af8e866e-4c3a-42d6-a1e4-6b5084f63ed8","subtype":"command","commandType":"auto","position":12.5,"command":"select distinct FlightNumber,\n date\nfrom internationalflights\nwhere destination = 'YYZ' and Boarded > 115","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575922444,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"435866ac-27fd-40a7-9e46-c241f7e1bad6"},{"version":"CommandV1","origId":981926856608996,"guid":"2143aa02-bbd7-4a34-8485-b4eaf0fc021e","subtype":"command","commandType":"auto","position":13.0,"command":"select EmpID,\n JobCode,\n Salary\nfrom payrollmaster\nwhere jobcode like '%FA%';","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575922940,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"537","height":"320","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"0c674711-89d2-44ca-a1a1-a5c0e6b96f64"},{"version":"CommandV1","origId":981926856608997,"guid":"90fce4de-893b-49c9-bf3f-702be0b24af0","subtype":"command","commandType":"auto","position":14.0,"command":"select
*\nfrom internationalflights\nwhere date is null;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575923426,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"411","height":"394","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"c487c6af-6a08-480c-ad12-0a86a34a9f93"},{"version":"CommandV1","origId":981926856608998,"guid":"a6b17a40-918c-4825-90c1-e8437d9a278b","subtype":"command","commandType":"auto","position":15.0,"command":"select *\nfrom internationalflights\nwhere boarded between 150 and 180;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575923718,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"608","height":"296","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"fe423ea7-7a7d-4125-9f7c-0db03e8cecd5"},{"version":"CommandV1","origId":981926856608999,"guid":"7cf9506e-f4db-4d1d-96e6-104e0a1b2561","subtype":"command","commandType":"auto","position":16.0,"command":"select *\nfrom internationalflights\nwhere Boarded >= 150 and \n Boarded <= 180;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575924021,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"6bb91d33-0653-44b8-be6e-8a4f61f44880"},{"version":"CommandV1","origId":981926856609000,"guid":"fa7346cb-1d73-4ba0-93b7-8a4cac02e2ce","subtype":"command","commandType":"auto","position":17.0,"command":"select FlightNumber,\n Date,\n Destination,\n Boarded + Transferred + Nonrevenue as Total\nfrom marchflights\nwhere Total < 100;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575924365,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"a292cad5-a123-49d5-824b-fa005ec98e49"},{"version":"CommandV1","origId":981926856609001,"guid":"ec8918b2-797d-44d0-9dd3-b64f42cb3fa8","subtype":"command","commandType":"auto","position":18.0,"command":"select FlightNumber,\n Date,\n Destination,\n Boarded + Transferred + Nonrevenue as Total\nfrom marchflights\nwhere Boarded + Transferred + Nonrevenue < 100\norder by Total desc; ","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575981334,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"595","height":"427","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"e9e669b0-10ac-48eb-86f8-d307cf8a11fd"},{"version":"CommandV1","origId":981926856609002,"guid":"661ff226-91be-4982-8bb0-841c082c1701","subtype":"command","commandType":"auto","position":19.0,"command":"select EmpID,\n JobCode,\n Salary\nfrom \tnew_payrollmaster\nwhere JobCode like '%NA%'\norder by Salary desc, jobcode;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520877545447,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"608","height":"355","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"345b8a78-c467-4b33-bf9b-6fd100e13e8d"},{"version":"CommandV1","origId":981926856609003,"guid":"10dd4fce-44f7-466b-a4b3-e811ebfd0374","subtype":"command","commandType":"auto","position":19.25,"command":"select EmpID,\n JobCode,\n Salary\nfrom \tnew_payrollmaster\nwhere JobCode like '%PT%'\norder by Salary desc;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520877454405,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"8377f4c6-e165-4571-a871-91002bdbcc9c"},{"version":"CommandV1","origId":981926856609004,"guid":"f1783d6f-d9c6-443f-bfa3-4ac49c39b084","subtype":"command","commandType":"auto","position":19.5,"command":"select FlightNumber,\n Date,\n Origin,\n Destination,\n Boarded+Transferred+Nonrevenue as total\nfrom marchflights\nwhere Destination='LHR'\norder by 2, \n 5 desc;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552576122369,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"662","height":"346","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"0038a49f-d79a-40e8-8cbd-c92ce80553d1"},{"version":"CommandV1","origId":981926856609005,"guid":"1b2263cb-fdcb-4c4c-94fe-7c0c78697345","subtype":"command","commandType":"auto","position":20.5,"command":"select
\tFlightNumber,\n Date,\n Destination,\n Boarded +Transferred+Nonrevenue as Total\nfrom marchflights;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552576406002,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"81d4fde6-d17b-4a62-aa7c-5dee0500f62d"},{"version":"CommandV1","origId":981926856609006,"guid":"8c09be6a-4895-43a9-861f-873a7eb2a3ae","subtype":"command","commandType":"auto","position":21.5,"command":"select \tsum(Boarded) as Total_Boarded\nfrom marchflights;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552576391727,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"151","height":"193","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"ea04a705-43a3-4147-b443-386bf50350c6"},{"version":"CommandV1","origId":981926856609007,"guid":"991ec4a9-28e9-48a6-a954-3813f46147d2","subtype":"command","commandType":"auto","position":22.0,"command":"create table correlacion as \nselect corr(Boarded,Distance) as Corr\nfrom marchflights;\n\n\n","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1521047699161,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"a0f1212e-7bb6-48f0-a46e-f1cbd7c55c82"},{"version":"CommandV1","origId":981926856609008,"guid":"04609d3c-05a3-4db0-968f-9ee221b0100c","subtype":"command","commandType":"auto","position":22.5,"command":"select avg(New_Salary) as MeanSalary\nfrom new_payrollmaster;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552576675970,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"202","height":"99","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"725b4fa6-8686-4f5a-bae9-864d6e720f03"},{"version":"CommandV1","origId":981926856609009,"guid":"81c1b92b-8c99-4f27-93ba-20ea59ee20a5","subtype":"command","commandType":"auto","position":22.625,"command":"select \tsum(Boarded) as Total_Boarded,\n avg(Boarded) as Mean_Boarded\nfrom marchflights;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1521047247301,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"a57db3a0-4ed1-4c21-9978-e5fe5083d82a"},{"version":"CommandV1","origId":981926856609010,"guid":"584bf398-0912-45b3-9def-5f5c35ea1596","subtype":"command","commandType":"auto","position":22.75,"command":"select min(New_Salary) as MinSalary\nfrom new_payrollmaster;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520878322048,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"6201a015-6601-4eae-8877-7fe27d0cf420"},{"version":"CommandV1","origId":981926856609011,"guid":"7b412e66-acf1-4452-9175-e5888079ae64","subtype":"command","commandType":"auto","position":23.0,"command":"%md\n\n## Funciones Apache Hive\n\n#### Cálculo y transformación para las siguientes variables:\n\n* Variables STRING\n* Variables Numéricas\n* Variables FECHA","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":0,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"dbc599be-5af5-444a-bb6c-6a798577df10"},{"version":"CommandV1","origId":981926856609012,"guid":"0a3de73e-abee-4e96-a2ab-a82386233fc2","subtype":"command","commandType":"auto","position":23.5,"command":"select length('BIG DATA');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552577197104,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"1ef9c1e6-0803-4ba1-a388-5b1006615f17"},{"version":"CommandV1","origId":981926856609013,"guid":"885e8c48-f2bf-4428-ad92-9166e2193ff0","subtype":"command","commandType":"auto","position":24.5,"command":"select
concat('big','-','data');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552577207821,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"695265cc-1913-4314-83d2-76f778f3341a"},{"version":"CommandV1","origId":981926856609014,"guid":"34630f0b-0657-40a6-8abb-b74acc632824","subtype":"command","commandType":"auto","position":25.5,"command":"select lower('BIG DATA');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552577213695,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"1007307a-d6d9-45fd-861b-71644fcd3330"},{"version":"CommandV1","origId":981926856609015,"guid":"0b7a3bf2-64c8-499f-96e7-8ba917238adc","subtype":"command","commandType":"auto","position":26.5,"command":"--select substr('Manipulación de Datos',3);\n\nselect substr('ctvasque@uc.cl',1,locate('@','ctvasque@uc.cl')-1);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552577420213,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"d702a1bd-f0b4-4d74-a3c9-6c8b797d6dc5"},{"version":"CommandV1","origId":981926856609016,"guid":"7bdacc02-2783-45df-b149-7d23b7931426","subtype":"command","commandType":"auto","position":27.5,"command":"select regexp_replace('Manipulación de Datos','Datos','Registros');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1521048972998,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"7f55f204-f06b-4437-9dee-d4d4006abb4d"},{"version":"CommandV1","origId":981926856609017,"guid":"08ba4837-3cf4-4702-941e-d6a3dc5f2761","subtype":"command","commandType":"auto","position":28.5,"command":"select locate('Da','Manipulación de Datos');\n","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1521049051527,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"a33d4d9c-72c1-4048-825d-80444f21b6d3"},{"version":"CommandV1","origId":981926856609018,"guid":"264717a2-2af1-4f0b-84bc-558a6c928096","subtype":"command","commandType":"auto","position":29.5,"command":"select substr('Manipulación de Datos',locate('Da','Manipulación de Datos'));","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1521049133805,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"4a8b8757-0302-413b-a0a4-214bd594fdd2"},{"version":"CommandV1","origId":981926856609019,"guid":"3187e51b-ff16-4771-8d51-ffce6ac99c0b","subtype":"command","commandType":"auto","position":30.5,"command":"select EmpID, \n JobCode, \n Salary,\n regexp_replace(substr(Salary,2),',','') as MSalary\nfrom payrollmaster;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1553006267382,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"572","height":"372","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"041e23ae-0709-481e-83c7-61822dab9074"},{"version":"CommandV1","origId":981926856609020,"guid":"9895e9c5-c80e-42dc-baad-eb8145428412","subtype":"command","commandType":"auto","position":31.0,"command":"%md\n\n#### Funciones para variables numéricas","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":0,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"d754b8c6-4f2f-403d-9101-e2458a7e440c"},{"version":"CommandV1","origId":981926856609021,"guid":"1b350425-d6d7-4117-99b9-742fb9f438a1","subtype":"command","commandType":"auto","position":31.5,"command":"select
abs(-10);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520616920376,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"b0373e2b-b3d7-42be-8121-74c37abb9a42"},{"version":"CommandV1","origId":981926856609022,"guid":"4458bbce-0463-4a8f-936b-7acc4a498e67","subtype":"command","commandType":"auto","position":32.5,"command":"select ceil(5.4);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520616943257,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"4ad1b881-1513-4a38-8f8d-947b6c28894f"},{"version":"CommandV1","origId":981926856609023,"guid":"8bf64e24-bdd6-4f48-bf3d-8c65a2d19b54","subtype":"command","commandType":"auto","position":33.5,"command":"select floor(5.4);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520616957407,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"26987705-f942-41ae-b44c-d1afde9cd3aa"},{"version":"CommandV1","origId":981926856609024,"guid":"a16204f1-14a9-4303-8d01-6019c146a209","subtype":"command","commandType":"auto","position":34.5,"command":"select ln(1);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1521049626732,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"83c16512-21e2-435b-a6f4-be5d6bae171e"},{"version":"CommandV1","origId":981926856609025,"guid":"c73d4015-f7ba-4d96-b460-21577dcc9b1f","subtype":"command","commandType":"auto","position":35.5,"command":"select exp(1);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520617103596,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":true,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"33794dbf-cb53-4506-8b27-17a08d28c886"},{"version":"CommandV1","origId":981926856609026,"guid":"f98e8732-c424-4db8-9fb7-79c02398640f","subtype":"command","commandType":"auto","position":36.5,"command":"select round(2.7182,2);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520617367501,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":true,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"6b0c98c5-d8c9-4594-a001-f88256f0ae6a"},{"version":"CommandV1","origId":981926856609027,"guid":"1c42caa3-e9ca-42c2-bccd-b200a4523bcd","subtype":"command","commandType":"auto","position":37.5,"command":"select sqrt(1024);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520617497479,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":true,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"70fa0398-21c0-44b3-87ea-1d197921d3a4"},{"version":"CommandV1","origId":981926856609028,"guid":"3c9bfb6d-0862-4834-8049-bb487043577b","subtype":"command","commandType":"auto","position":38.5,"command":"select ceil(6*rand());","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1521049950013,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"f7610926-8b5b-45bc-bb14-1b5b3f7d45a3"},{"version":"CommandV1","origId":981926856609029,"guid":"b00ab7b2-cb3e-45f0-a939-a3b18754e03b","subtype":"command","commandType":"auto","position":39.5,"command":"select pow(10,3);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1521050151669,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"928fc12a-bee4-4bc0-a380-6c1d37f39aeb"},{"version":"CommandV1","origId":981926856609030,"guid":"9c346b97-a0cf-48d9-b768-21b832833a5c","subtype":"command","commandType":"auto","position":40.5,"command":"select
EmpID, \n JobCode, \n Salary,\n ln(regexp_replace(substr(Salary,2),',','')) as ln_MSalary,\n floor(ln(regexp_replace(substr(Salary,2),',',''))) as Fln_MSalary\nfrom payrollmaster;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1553006864979,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"483","height":"194","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"e6c2179e-751f-4b82-9b0e-4df88fd8a35d"},{"version":"CommandV1","origId":981926856609031,"guid":"c329da68-cfe1-44ea-a06f-00c51b9cb652","subtype":"command","commandType":"auto","position":41.0,"command":"%md\n\n#### Funciones para variables DATETIME","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":0,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"a254cd31-534d-43c9-a93b-5d65f088e7e1"},{"version":"CommandV1","origId":981926856609032,"guid":"c0c209f6-f9ff-4b21-ad7c-af857c52f495","subtype":"command","commandType":"auto","position":41.5,"command":"select to_date('2016-12-01 21:00:30');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1521480132195,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"b9e429a4-f4cb-446c-8fb4-c067f2b91fd9"},{"version":"CommandV1","origId":981926856609033,"guid":"b95fe8f7-61f5-4166-b7dd-1e39940dbe7b","subtype":"command","commandType":"auto","position":42.0,"command":"select day('2016-12-01 21:00:30');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520946759173,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"52b950a4-f30d-4630-86fe-613fa9b17875"},{"version":"CommandV1","origId":981926856609034,"guid":"a4b81866-1262-45d4-8a24-6aed2eb8fed6","subtype":"command","commandType":"auto","position":42.25,"command":"select month('2016-12-01 21:00:30');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520946773444,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"d4d7a0a6-ea99-4310-91d1-e58d3aad3062"},{"version":"CommandV1","origId":981926856609035,"guid":"41d58eed-403e-40c7-8768-5f08665078cd","subtype":"command","commandType":"auto","position":42.375,"command":"select year('2016-12-01 21:00:30');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520946806712,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"1b870dbf-922b-48d7-90de-7509ac1b5763"},{"version":"CommandV1","origId":981926856609036,"guid":"51446826-16f4-4dfe-94f0-193c8bb2420a","subtype":"command","commandType":"auto","position":42.4375,"command":"select date_format('2018-03-13','u');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520947600504,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"d58c169a-52e6-4550-982e-163575974374"},{"version":"CommandV1","origId":981926856609037,"guid":"89095165-b616-441c-b242-1a8c1019af37","subtype":"command","commandType":"auto","position":42.46875,"command":"select dayofyear('2018-02-20');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520947883126,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"0e21a103-7a95-4855-98b0-ad0da26d6e7d"},{"version":"CommandV1","origId":981926856609038,"guid":"8adf43fc-fc89-41a3-be8b-42094aa93e3d","subtype":"command","commandType":"auto","position":42.484375,"command":"select
weekofyear('2018-02-20');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520947983175,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"0f59e6cb-28b3-4857-b711-f9b57eefa612"},{"version":"CommandV1","origId":981926856609039,"guid":"aff7d4ca-d45e-4cea-84f6-480f19eff0ab","subtype":"command","commandType":"auto","position":42.4921875,"command":"select date_add('2017-12-31',5);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520948855768,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"e0a4eedb-2ab2-444d-b600-55cbddf59ca0"},{"version":"CommandV1","origId":981926856609040,"guid":"7acac73c-0055-40de-89f7-f397c0fbafb9","subtype":"command","commandType":"auto","position":42.49609375,"command":"select add_months('2017-12-01',12);","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520948956983,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"d5fabb28-9291-4436-87f6-341ed0199e7e"},{"version":"CommandV1","origId":981926856609041,"guid":"e4599157-84dc-466c-8a0e-d5606a2c067b","subtype":"command","commandType":"auto","position":42.498046875,"command":"select datediff('2017-12-01','2017-11-01');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520949038302,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"1ceb2c1f-db43-4bdc-9fa2-d3bd09312d62"},{"version":"CommandV1","origId":981926856609042,"guid":"954fd4bb-f61d-4140-8c36-bfefba424bd4","subtype":"command","commandType":"auto","position":42.5,"command":"select months_between('2018-01-01','2017-01-01');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520949090024,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"18e682ba-2eea-42ec-bd15-0534a12992d1"},{"version":"CommandV1","origId":981926856609043,"guid":"0ce7dbbd-24b0-42f6-8643-a3f6f7d5c491","subtype":"command","commandType":"auto","position":43.0,"command":"select *\nfrom payrollmaster_fecha","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1520953957273,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"mivicuna@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"e4e67728-03d0-49de-9024-737ea21d3ced"},{"version":"CommandV1","origId":981926856609044,"guid":"a89c4ee2-1ccb-4191-a640-ac3c362eb84c","subtype":"command","commandType":"auto","position":43.5,"command":"select EmpID,\n Gender,\n floor(months_between('2018-03-01',to_date(DateOfBirth))/12) as Edad,\n floor(months_between(to_date(DateOfHire),to_date(DateOfBirth))/12) as EdadContra,\n floor(months_between('2018-03-01',to_date(DateOfHire))/12) as Antiguedad\nfrom payrollmaster_fecha","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1553007835382,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"590","height":"425","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"0c8496c6-716b-47b5-8e8c-2ed4315d6b44"},{"version":"CommandV1","origId":981926856609045,"guid":"2c50bf1b-0e7e-4944-97b8-89abae95acbf","subtype":"command","commandType":"auto","position":44.5,"command":"%md\n\n#### Funciones condicionales para crear nuevos campos. Las más populares\n\n* IF\n* CASE WHEN\n","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":0,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"265b5bd7-f987-4925-b4b5-27b8c4f931b9"},{"version":"CommandV1","origId":981926856609046,"guid":"b9374a34-c07b-4803-bca7-e6961c7373a0","subtype":"command","commandType":"auto","position":45.5,"command":"select
if(year('2018-01-01') = 2018,'verdadero','falso');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1553008177144,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"84493e9c-77f7-451a-aba2-084ed76eabb0"},{"version":"CommandV1","origId":981926856609047,"guid":"3c46dcda-60c2-4371-a046-17b117d4c1ab","subtype":"command","commandType":"auto","position":46.5,"command":"select coalesce(null,null,'aquí',null,'falso');","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1553008191616,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"764756ee-c409-4054-ae2c-6adef21ac12f"},{"version":"CommandV1","origId":981926856609048,"guid":"820623e1-5b97-48b3-9a74-05cbe6ff9ebc","subtype":"command","commandType":"auto","position":47.5,"command":"select case\n when 'NARANJA' = 'MANZANA' then 'ES UNA MANZANA'\n when 'NARANJA' = 'NARANJA' then 'ES UNA NARANJA'\n else 'ES OTRA FRUTA'\nend","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1553008201134,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"7121a2ca-b6e5-47b6-b377-395d85940470"},{"version":"CommandV1","origId":981926856609049,"guid":"b6025c89-930e-4a78-8306-fcd78cbaa3e8","subtype":"command","commandType":"auto","position":48.5,"command":"select EmpID,\n Gender,\n JobCode,\n to_date(DateOfBirth) as Nacimiento,\n case when month(to_date(DateOfBirth)) = 3 then 'Cumpleaños en Marzo'\n else 'Cumpleaños otro mes' end as IndCumpl\nfrom payrollmaster_fecha;","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1553008405470,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"885","height":"447","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"ee3391f6-2d26-4454-99f1-662d06b4a391"},{"version":"CommandV1","origId":981926856609050,"guid":"1b7f89f9-0c8a-4e25-8c05-4b8df66e6b49","subtype":"command","commandType":"auto","position":49.5,"command":"%md\n\n#### La sentencia GROUP BY permite realizar agrupaciones por las categorías de uno o más campos. \n\n#### En esta sentencia se indican las variables de agrupación y siempre van acompañadas de funciones resumenes de información\n#### en la sentencia SELECT","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":0,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"73e6b903-caa3-4a97-83b5-b80a25cdd069"},{"version":"CommandV1","origId":981926856609051,"guid":"3c0a4b74-251b-4ddc-be40-01ad4e2225e4","subtype":"command","commandType":"auto","position":50.5,"command":"select JobCode,\n round(avg(New_Salary),2) as Mean_Salary,\n count(JobCode) as Num_Funcionarios\nfrom new_payrollmaster\ngroup by JobCode\norder by 2 desc; ","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1553009618617,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"mapPlot","width":"680","height":"411","xColumns":["JobCode"],"yColumns":["Mean_Salary"],"pivotColumns":[],"pivotAggregation":"avg","useConsistentColors":false,"customPlotOptions":{"barChart":[{"key":"grouped","value":true},{"key":"stacked","value":false},{"key":"100_stacked","value":false}]},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"90cf233c-3762-429b-9162-d2c9187dd40f"},{"version":"CommandV1","origId":981926856609059,"guid":"5b23275e-22c1-4684-a984-20bd5a387442","subtype":"command","commandType":"auto","position":1.375,"command":"%md \n#### La sentencia \"show tables\" muestra las tablas en la base de datos","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575918154,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"2062d328-4c9d-47ea-8024-c5dbd89e95d3"},{"version":"CommandV1","origId":981926856609060,"guid":"50110de7-05b9-42ed-b0fd-d01ebe357aa8","subtype":"command","commandType":"auto","position":1.75,"command":"%md\n\n#### Ilustración de una consulta SQL","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575918689,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"ac4df205-c7cc-4385-b733-509bca4f9ab4"},{"version":"CommandV1","origId":981926856609061,"guid":"c0d35071-86ad-4706-a12e-dcf1169a85f0","subtype":"command","commandType":"auto","position":2.5,"command":"%md\n\n####
Ilustración de una consulta SQL","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575919256,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"3810c464-c520-4c98-a7e8-a0fd3955e600"},{"version":"CommandV1","origId":981926856609062,"guid":"002cb0b1-37c8-4e6e-94f5-6ab6096b6045","subtype":"command","commandType":"auto","position":3.5,"command":"%md\n#### La primera sentencia uilizada en una consulta SQL es SELECT, ahí se deben indicar la colección de variables que se desean visualizar. Al utilizar el símbolo * en la consulta, automaticamente se llaman todos los campos de la tabla","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575919590,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"e51a9817-e05e-4bdf-b803-14d17de3c68e"},{"version":"CommandV1","origId":981926856609063,"guid":"5c52d0b9-7500-4091-a9e3-faa1bceee815","subtype":"command","commandType":"auto","position":4.5,"command":"%md\n\n#### Cálculo de un nueva variable en la sentencia SELECT","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575919946,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"793b010b-0ab2-4ebe-a47f-50bf1ed2702e"},{"version":"CommandV1","origId":981926856609064,"guid":"b234a106-fe2e-4626-b566-986d3219a186","subtype":"command","commandType":"auto","position":5.5,"command":"%md\n\n#### La opción DISTINCT permite seleccionar sólo los registros distintos de la tabla de entrada","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575920354,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"7edde634-fea7-4c93-a6af-41a65786973f"},{"version":"CommandV1","origId":981926856609065,"guid":"c79ed1e4-16e9-4809-a755-8a5dcf4dbb97","subtype":"command","commandType":"auto","position":7.5,"command":"%md \n\n#### La sentencia CREATE TABLE permite generar una nueva tabla a partir de la consulta realiza","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575920918,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"b9d9f9c6-df58-4135-9e7c-168ca9ec1e05"},{"version":"CommandV1","origId":981926856609067,"guid":"81a71acd-b3fa-4621-9fce-a17a0a6381ce","subtype":"command","commandType":"auto","position":10.5,"command":"%md\n\n#### La sentencia WHERE permite filtrar los registros de la tabla de entrada","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575921669,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"139ca39a-9664-4279-a881-6fdc156179e9"},{"version":"CommandV1","origId":981926856609068,"guid":"2797365f-b1db-4ee6-9ec2-10995d0ca8d7","subtype":"command","commandType":"auto","position":11.5,"command":"%md\n\n#### La sentencia WHERE puede mezclar operadores lógicos para filtrar información: and , or, not","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575922092,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"3d480d85-2c2a-4879-8162-13d0aeb91c8a"},{"version":"CommandV1","origId":981926856609069,"guid":"e5ca2b1e-a437-4af6-812e-9ce8ebbc916f","subtype":"command","commandType":"auto","position":12.75,"command":"%md\n\n#### La función LIKE permite seleccionar los registros que contienen una cadena de caracteres","commandVersion":0,"state":"error","results":null,"errorSummary":null,"error":null,"workflows":[],"startTime":0,"submitTime":1552575922695,"finishTime":0,"collapsed":false,"bindings":{},"inputWidgets":{},"displayType":"table","width":"auto","height":"auto","xColumns":null,"yColumns":null,"pivotColumns":null,"pivotAggregation":null,"useConsistentColors":false,"customPlotOptions":{},"commentThread":[],"commentsVisible":false,"parentHierarchy":[],"diffInserts":[],"diffDeletes":[],"globalVars":{},"latestUser":"ctvasque@uc.cl","latestUserId":null,"commandTitle":"","showCommandTitle":false,"hideCommandCode":false,"hideCommandResult":false,"isLockedInExamMode":false,"iPythonMetadata":null,"streamStates":{},"datasetPreviewNameToCmdIdMap":{},"nuid":"aab9c0d9-e617-4324-b332-d7e10b61ffd0"},{"version":"CommandV1","origId":981926856609070,"guid":"4064015b-862a-49a7-8932-3fff27cf2031","subtype":"command","commandType":"auto","position":13.5,"command":"%md\n\n####

Continuar navegando