tp: format stdlib and test SQL to same standard

Change-Id: I26b73c714bbed5f769deb6913454eae06662fd10
diff --git a/src/trace_processor/stdlib/android/binder.sql b/src/trace_processor/stdlib/android/binder.sql
index 17cdc55..d324e6e 100644
--- a/src/trace_processor/stdlib/android/binder.sql
+++ b/src/trace_processor/stdlib/android/binder.sql
@@ -23,16 +23,16 @@
 --
 CREATE VIEW android_binder_metrics_by_process AS
 SELECT
-  process.name as process_name,
-  process.pid as pid,
-  slice.name as slice_name,
-  COUNT(*) as event_count
+  process.name AS process_name,
+  process.pid AS pid,
+  slice.name AS slice_name,
+  COUNT(*) AS event_count
 FROM slice
-  INNER JOIN thread_track ON slice.track_id=thread_track.id
-  INNER JOIN thread ON thread.utid=thread_track.utid
-  INNER JOIN process ON thread.upid=process.upid
+INNER JOIN thread_track ON slice.track_id = thread_track.id
+INNER JOIN thread ON thread.utid = thread_track.utid
+INNER JOIN process ON thread.upid = process.upid
 WHERE
-  slice.name glob 'binder*'
+  slice.name GLOB 'binder*'
 GROUP BY
   process_name,
   slice_name;
diff --git a/src/trace_processor/stdlib/experimental/android_broadcast.sql b/src/trace_processor/stdlib/experimental/android_broadcast.sql
index 22774d0..c3ce4bc 100644
--- a/src/trace_processor/stdlib/experimental/android_broadcast.sql
+++ b/src/trace_processor/stdlib/experimental/android_broadcast.sql
@@ -23,26 +23,26 @@
 --                       dispatched from.
 CREATE VIEW experimental_android_broadcasts_minsdk_u AS
 WITH
-  broadcast_queues AS (
-    SELECT process_track.id, process_track.name as queue_name
-    FROM process_track
-    JOIN process USING (upid)
-    WHERE
-      process_track.name GLOB 'BroadcastQueue.mRunning*' AND
-      process.name = 'system_server'
-  ),
-  broadcast_process_running AS (
-    SELECT ts, dur, str_split(slice.name, '/', 0) AS process_name, queue_name
-    FROM slice
-    JOIN broadcast_queues ON broadcast_queues.id = slice.track_id
-    WHERE slice.name GLOB '* running'
-  )
+broadcast_queues AS (
+  SELECT process_track.id, process_track.name AS queue_name
+  FROM process_track
+  JOIN process USING (upid)
+  WHERE
+    process_track.name GLOB 'BroadcastQueue.mRunning*'
+    AND process.name = 'system_server'
+),
+broadcast_process_running AS (
+  SELECT ts, dur, str_split(slice.name, '/', 0) AS process_name, queue_name
+  FROM slice
+  JOIN broadcast_queues ON broadcast_queues.id = slice.track_id
+  WHERE slice.name GLOB '* running'
+)
 SELECT str_split(slice.name, '/', 0) AS type, process_name, queue_name
 FROM broadcast_process_running
 JOIN broadcast_queues USING (queue_name)
 JOIN slice ON (
-  broadcast_process_running.ts < slice.ts AND
-  slice.ts < broadcast_process_running.ts + broadcast_process_running.dur AND
-  slice.track_id = broadcast_queues.id
-)
+  broadcast_process_running.ts < slice.ts
+  AND slice.ts < broadcast_process_running.ts + broadcast_process_running.dur
+  AND slice.track_id = broadcast_queues.id
+  )
 WHERE slice.name GLOB '* scheduled';
diff --git a/test/trace_processor/android/android_bugreport_dumpstate_test.sql b/test/trace_processor/android/android_bugreport_dumpstate_test.sql
index 00751a5..ae1a270 100644
--- a/test/trace_processor/android/android_bugreport_dumpstate_test.sql
+++ b/test/trace_processor/android/android_bugreport_dumpstate_test.sql
@@ -1,2 +1,2 @@
-select section, service, count(line) as linecount from android_dumpstate
-group by section, service;
\ No newline at end of file
+SELECT section, service, count(line) AS linecount FROM android_dumpstate
+GROUP BY section, service;
diff --git a/test/trace_processor/android/android_bugreport_dumpsys_test.sql b/test/trace_processor/android/android_bugreport_dumpsys_test.sql
index b9a94ef..01fd07e 100644
--- a/test/trace_processor/android/android_bugreport_dumpsys_test.sql
+++ b/test/trace_processor/android/android_bugreport_dumpsys_test.sql
@@ -1,2 +1,2 @@
-select section, service, line from android_dumpstate
-where service = 'color_display';
\ No newline at end of file
+SELECT section, service, line FROM android_dumpstate
+WHERE service = 'color_display';
diff --git a/test/trace_processor/android/android_bugreport_logs_test.sql b/test/trace_processor/android/android_bugreport_logs_test.sql
index 1c1ed18..9694b88 100644
--- a/test/trace_processor/android/android_bugreport_logs_test.sql
+++ b/test/trace_processor/android/android_bugreport_logs_test.sql
@@ -1,16 +1,14 @@
-with
-initial as
-  (select
-    (select count(*) from android_logs) as cnt,
-    ts, prio, tag, msg from android_logs
-    order by ts asc
-    limit 100
+WITH
+initial AS (SELECT
+    (SELECT count(*) FROM android_logs) AS cnt,
+    ts, prio, tag, msg FROM android_logs
+  ORDER BY ts ASC
+  LIMIT 100
 ),
-latest as
-  (select
-    (select count(*) from android_logs) as cnt,
-    ts, prio, tag, msg from android_logs
-    order by ts desc
-    limit 100
+latest AS (SELECT
+    (SELECT count(*) FROM android_logs) AS cnt,
+    ts, prio, tag, msg FROM android_logs
+  ORDER BY ts DESC
+  LIMIT 100
 )
-select * from initial union all select * from latest;
+SELECT * FROM initial UNION ALL SELECT * FROM latest;
diff --git a/test/trace_processor/android/android_system_property_counter_test.sql b/test/trace_processor/android/android_system_property_counter_test.sql
index 580e4a9..9638b73 100644
--- a/test/trace_processor/android/android_system_property_counter_test.sql
+++ b/test/trace_processor/android/android_system_property_counter_test.sql
@@ -1,3 +1,3 @@
-select t.id, t.type, t.name, c.id, c.ts, c.type, c.value
-from counter_track t join counter c on t.id = c.track_id
-where name = 'ScreenState';
+SELECT t.id, t.type, t.name, c.id, c.ts, c.type, c.value
+FROM counter_track t JOIN counter c ON t.id = c.track_id
+WHERE name = 'ScreenState';
diff --git a/test/trace_processor/android/android_system_property_slice_test.sql b/test/trace_processor/android/android_system_property_slice_test.sql
index 96e0fcf..6b6f926 100644
--- a/test/trace_processor/android/android_system_property_slice_test.sql
+++ b/test/trace_processor/android/android_system_property_slice_test.sql
@@ -1,3 +1,3 @@
-select t.id, t.type, t.name, s.id, s.ts, s.dur, s.type, s.name
-from track t join slice s on s.track_id = t.id
-where t.name = 'DeviceStateChanged';
+SELECT t.id, t.type, t.name, s.id, s.ts, s.dur, s.type, s.name
+FROM track t JOIN slice s ON s.track_id = t.id
+WHERE t.name = 'DeviceStateChanged';
diff --git a/test/trace_processor/android/game_intervention_list_test.sql b/test/trace_processor/android/game_intervention_list_test.sql
index 5ecef53..bb5036b 100644
--- a/test/trace_processor/android/game_intervention_list_test.sql
+++ b/test/trace_processor/android/game_intervention_list_test.sql
@@ -31,4 +31,4 @@
   battery_mode_use_angle,
   battery_mode_fps
 FROM android_game_intervention_list
-ORDER BY package_name
+ORDER BY package_name;
diff --git a/test/trace_processor/atrace/instant_async_test.sql b/test/trace_processor/atrace/instant_async_test.sql
index a02b2ba..e76830d 100644
--- a/test/trace_processor/atrace/instant_async_test.sql
+++ b/test/trace_processor/atrace/instant_async_test.sql
@@ -1,7 +1,7 @@
 SELECT
   process.name AS process_name,
-  process_track.name as track_name,
-  instant.name as instant_name,
+  process_track.name AS track_name,
+  instant.name AS instant_name,
   ts
 FROM slice instant
 JOIN process_track ON instant.track_id = process_track.id
diff --git a/test/trace_processor/atrace/instant_with_thread_test.sql b/test/trace_processor/atrace/instant_with_thread_test.sql
index 2e39608..eb485ff 100644
--- a/test/trace_processor/atrace/instant_with_thread_test.sql
+++ b/test/trace_processor/atrace/instant_with_thread_test.sql
@@ -1,4 +1,4 @@
-SELECT thread.name as thread_name, instant.name as track_name, instant.ts
+SELECT thread.name AS thread_name, instant.name AS track_name, instant.ts
 FROM slice instant
 JOIN thread_track ON instant.track_id = thread_track.id
 JOIN thread USING (utid)
diff --git a/test/trace_processor/atrace/sys_write_and_atrace_test.sql b/test/trace_processor/atrace/sys_write_and_atrace_test.sql
index 1cde5cc..baafd49 100644
--- a/test/trace_processor/atrace/sys_write_and_atrace_test.sql
+++ b/test/trace_processor/atrace/sys_write_and_atrace_test.sql
@@ -1,5 +1,5 @@
-select slice.ts, slice.dur, slice.name, slice.depth
-from slice
-join thread_track on (slice.track_id = thread_track.id)
-join thread using (utid)
-where tid = 42
+SELECT slice.ts, slice.dur, slice.name, slice.depth
+FROM slice
+JOIN thread_track ON (slice.track_id = thread_track.id)
+JOIN thread USING (utid)
+WHERE tid = 42;
diff --git a/test/trace_processor/chrome/chrome_custom_navigation_tasks_test.sql b/test/trace_processor/chrome/chrome_custom_navigation_tasks_test.sql
index 0ab463d..2816192 100644
--- a/test/trace_processor/chrome/chrome_custom_navigation_tasks_test.sql
+++ b/test/trace_processor/chrome/chrome_custom_navigation_tasks_test.sql
@@ -15,7 +15,7 @@
 
 SELECT RUN_METRIC('chrome/chrome_tasks.sql');
 
-SELECT full_name, task_type, count() as count
+SELECT full_name, task_type, count() AS count
 FROM chrome_tasks
 WHERE full_name GLOB 'FrameHost::BeginNavigation*'
   OR full_name GLOB 'FrameHost::DidCommitProvisionalLoad*'
diff --git a/test/trace_processor/chrome/chrome_dropped_frames_metric_test.sql b/test/trace_processor/chrome/chrome_dropped_frames_metric_test.sql
index 491df76..550a34f 100644
--- a/test/trace_processor/chrome/chrome_dropped_frames_metric_test.sql
+++ b/test/trace_processor/chrome/chrome_dropped_frames_metric_test.sql
@@ -15,4 +15,4 @@
 
 SELECT RUN_METRIC('experimental/chrome_dropped_frames.sql');
 
-SELECT * FROM dropped_frames_with_process_info;
\ No newline at end of file
+SELECT * FROM dropped_frames_with_process_info;
diff --git a/test/trace_processor/chrome/chrome_input_to_browser_intervals_test.sql b/test/trace_processor/chrome/chrome_input_to_browser_intervals_test.sql
index 0dfffaf..1dedd72 100644
--- a/test/trace_processor/chrome/chrome_input_to_browser_intervals_test.sql
+++ b/test/trace_processor/chrome/chrome_input_to_browser_intervals_test.sql
@@ -19,4 +19,4 @@
   *
 FROM chrome_input_to_browser_intervals
 WHERE window_start_ts >= 60934320005158
-  AND window_start_ts <= 60934338798158;
\ No newline at end of file
+  AND window_start_ts <= 60934338798158;
diff --git a/test/trace_processor/chrome/chrome_log_message_args_test.sql b/test/trace_processor/chrome/chrome_log_message_args_test.sql
index 9f83b5a..371b95d 100644
--- a/test/trace_processor/chrome/chrome_log_message_args_test.sql
+++ b/test/trace_processor/chrome/chrome_log_message_args_test.sql
@@ -14,9 +14,9 @@
 -- limitations under the License.
 
 SELECT
-    EXTRACT_ARG(s.arg_set_id, 'track_event.log_message') AS log_message,
-    EXTRACT_ARG(s.arg_set_id, 'track_event.log_message.function_name') AS function_name,
-    EXTRACT_ARG(s.arg_set_id, 'track_event.log_message.file_name') AS file_name,
-    EXTRACT_ARG(s.arg_set_id, 'track_event.log_message.line_number') AS line_number
+  EXTRACT_ARG(s.arg_set_id, 'track_event.log_message') AS log_message,
+  EXTRACT_ARG(s.arg_set_id, 'track_event.log_message.function_name') AS function_name,
+  EXTRACT_ARG(s.arg_set_id, 'track_event.log_message.file_name') AS file_name,
+  EXTRACT_ARG(s.arg_set_id, 'track_event.log_message.line_number') AS line_number
 FROM
-    slice s;
\ No newline at end of file
+  slice s;
diff --git a/test/trace_processor/chrome/chrome_log_message_test.sql b/test/trace_processor/chrome/chrome_log_message_test.sql
index b53959d..2a6eddf 100644
--- a/test/trace_processor/chrome/chrome_log_message_test.sql
+++ b/test/trace_processor/chrome/chrome_log_message_test.sql
@@ -13,4 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-SELECT utid, tag, msg FROM android_logs;
\ No newline at end of file
+SELECT utid, tag, msg FROM android_logs;
diff --git a/test/trace_processor/chrome/chrome_long_latency_metric_test.sql b/test/trace_processor/chrome/chrome_long_latency_metric_test.sql
index 80e6fb4..c267ea7 100644
--- a/test/trace_processor/chrome/chrome_long_latency_metric_test.sql
+++ b/test/trace_processor/chrome/chrome_long_latency_metric_test.sql
@@ -15,4 +15,4 @@
 
 SELECT RUN_METRIC('experimental/chrome_long_latency.sql');
 
-SELECT * FROM long_latency_with_process_info;
\ No newline at end of file
+SELECT * FROM long_latency_with_process_info;
diff --git a/test/trace_processor/chrome/chrome_missing_processes_args_test.sql b/test/trace_processor/chrome/chrome_missing_processes_args_test.sql
index b404cbd..1d92470 100644
--- a/test/trace_processor/chrome/chrome_missing_processes_args_test.sql
+++ b/test/trace_processor/chrome/chrome_missing_processes_args_test.sql
@@ -15,8 +15,8 @@
 
 SELECT arg_set_id, key, int_value
 FROM
-    slice
+  slice
 JOIN
-    args
-USING(arg_set_id)
-ORDER BY arg_set_id, key;
\ No newline at end of file
+  args
+  USING(arg_set_id)
+ORDER BY arg_set_id, key;
diff --git a/test/trace_processor/chrome/chrome_missing_processes_test.sql b/test/trace_processor/chrome/chrome_missing_processes_test.sql
index 30ef9e5..9a8c9a3 100644
--- a/test/trace_processor/chrome/chrome_missing_processes_test.sql
+++ b/test/trace_processor/chrome/chrome_missing_processes_test.sql
@@ -15,8 +15,8 @@
 
 SELECT upid, pid, reliable_from
 FROM
-    experimental_missing_chrome_processes
+  experimental_missing_chrome_processes
 JOIN
-    process
-USING(upid)
-ORDER BY upid;
\ No newline at end of file
+  process
+  USING(upid)
+ORDER BY upid;
diff --git a/test/trace_processor/chrome/chrome_processes_type_test.sql b/test/trace_processor/chrome/chrome_processes_type_test.sql
index b857d83..64e77d0 100644
--- a/test/trace_processor/chrome/chrome_processes_type_test.sql
+++ b/test/trace_processor/chrome/chrome_processes_type_test.sql
@@ -13,13 +13,13 @@
 -- limitations under the License.
 SELECT pid, name, string_value AS chrome_process_type
 FROM
-    process
+  process
 -- EXTRACT_ARG doesn't make sense here - it would get chrome.process_type
 -- (or NULL) for each process in the trace. But what we want is - a subset
 -- of process that have a "chrome.process_type" argument, whether it's NULL or
 -- not.
 JOIN
-    (SELECT * FROM args WHERE key = "chrome.process_type") chrome_process_args
-ON
+  (SELECT * FROM args WHERE key = "chrome.process_type") chrome_process_args
+  ON
     process.arg_set_id = chrome_process_args.arg_set_id
 ORDER BY pid;
diff --git a/test/trace_processor/chrome/chrome_reliable_range_test.sql b/test/trace_processor/chrome/chrome_reliable_range_test.sql
index 046f333..22e475c 100644
--- a/test/trace_processor/chrome/chrome_reliable_range_test.sql
+++ b/test/trace_processor/chrome/chrome_reliable_range_test.sql
@@ -12,4 +12,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 SELECT RUN_METRIC('chrome/chrome_reliable_range.sql');
-SELECT start, reason, debug_limiting_upid, debug_limiting_utid FROM chrome_reliable_range;
\ No newline at end of file
+SELECT start, reason, debug_limiting_upid, debug_limiting_utid FROM chrome_reliable_range;
diff --git a/test/trace_processor/chrome/chrome_scroll_inputs_per_frame_test.sql b/test/trace_processor/chrome/chrome_scroll_inputs_per_frame_test.sql
index 41b1db6..00be72f 100644
--- a/test/trace_processor/chrome/chrome_scroll_inputs_per_frame_test.sql
+++ b/test/trace_processor/chrome/chrome_scroll_inputs_per_frame_test.sql
@@ -14,7 +14,7 @@
 SELECT RUN_METRIC('chrome/chrome_scroll_inputs_per_frame.sql');
 
 SELECT
-count_for_frame,
-ts
+  count_for_frame,
+  ts
 FROM chrome_scroll_inputs_per_frame
-WHERE ts = 60934316798158;
\ No newline at end of file
+WHERE ts = 60934316798158;
diff --git a/test/trace_processor/chrome/chrome_scroll_jank_caused_by_scheduling_test.sql b/test/trace_processor/chrome/chrome_scroll_jank_caused_by_scheduling_test.sql
index e741c26..857077f 100644
--- a/test/trace_processor/chrome/chrome_scroll_jank_caused_by_scheduling_test.sql
+++ b/test/trace_processor/chrome/chrome_scroll_jank_caused_by_scheduling_test.sql
@@ -14,7 +14,7 @@
 -- limitations under the License.
 
 SELECT RUN_METRIC('chrome/chrome_scroll_jank_caused_by_scheduling.sql',
-'dur_causes_jank_ms',
+  'dur_causes_jank_ms',
 /* dur_causes_jank_ms = */ '5');
 
 SELECT
@@ -25,4 +25,4 @@
   window_start_ts,
   window_end_ts,
   scroll_type
-FROM chrome_scroll_jank_caused_by_scheduling;
\ No newline at end of file
+FROM chrome_scroll_jank_caused_by_scheduling;
diff --git a/test/trace_processor/chrome/chrome_stack_samples_for_task_test.sql b/test/trace_processor/chrome/chrome_stack_samples_for_task_test.sql
index e5067c8..7f06932 100644
--- a/test/trace_processor/chrome/chrome_stack_samples_for_task_test.sql
+++ b/test/trace_processor/chrome/chrome_stack_samples_for_task_test.sql
@@ -19,17 +19,17 @@
     'task_name', '"sendTouchEvent"');
 
 SELECT
-    sample.description,
-    sample.ts,
-    sample.depth
+  sample.description,
+  sample.ts,
+  sample.depth
 FROM chrome_stack_samples_for_task sample
 JOIN (
     SELECT
-        ts,
-        dur
+      ts,
+      dur
     FROM slice
     WHERE ts = 696373965001470
 ) test_slice
-    ON sample.ts >= test_slice.ts
-    AND sample.ts <= test_slice.ts + test_slice.dur
-ORDER BY sample.ts, sample.depth;
\ No newline at end of file
+ON sample.ts >= test_slice.ts
+  AND sample.ts <= test_slice.ts + test_slice.dur
+ORDER BY sample.ts, sample.depth;
diff --git a/test/trace_processor/chrome/chrome_tasks_delaying_input_processing_test.sql b/test/trace_processor/chrome/chrome_tasks_delaying_input_processing_test.sql
index 3935e88..4e32b07 100644
--- a/test/trace_processor/chrome/chrome_tasks_delaying_input_processing_test.sql
+++ b/test/trace_processor/chrome/chrome_tasks_delaying_input_processing_test.sql
@@ -14,11 +14,11 @@
 -- limitations under the License.
 
 SELECT RUN_METRIC('chrome/chrome_tasks_delaying_input_processing.sql',
-'duration_causing_jank_ms',
+  'duration_causing_jank_ms',
  /* duration_causing_jank_ms = */ '8');
 
 SELECT
   full_name,
   duration_ms,
   thread_dur_ms
-FROM chrome_tasks_delaying_input_processing;
\ No newline at end of file
+FROM chrome_tasks_delaying_input_processing;
diff --git a/test/trace_processor/chrome/chrome_tasks_test.sql b/test/trace_processor/chrome/chrome_tasks_test.sql
index bb56ee9..6e68a49 100644
--- a/test/trace_processor/chrome/chrome_tasks_test.sql
+++ b/test/trace_processor/chrome/chrome_tasks_test.sql
@@ -15,7 +15,7 @@
 
 SELECT RUN_METRIC('chrome/chrome_tasks.sql');
 
-SELECT full_name, task_type, count() as count
+SELECT full_name, task_type, count() AS count
 FROM chrome_tasks
 GROUP BY full_name, task_type
 ORDER BY count DESC
diff --git a/test/trace_processor/chrome/chrome_thread_slice_repeated_test.sql b/test/trace_processor/chrome/chrome_thread_slice_repeated_test.sql
index 0d4b22e..504051a 100644
--- a/test/trace_processor/chrome/chrome_thread_slice_repeated_test.sql
+++ b/test/trace_processor/chrome/chrome_thread_slice_repeated_test.sql
@@ -14,12 +14,11 @@
 -- limitations under the License.
 --
 
-SELECT RUN_METRIC('chrome/chrome_thread_slice.sql')
-   ;
+SELECT RUN_METRIC('chrome/chrome_thread_slice.sql');
 
 SELECT
   name,
   ts,
   dur,
   thread_dur
-FROM chrome_thread_slice
+FROM chrome_thread_slice;
diff --git a/test/trace_processor/chrome/chrome_thread_slice_test.sql b/test/trace_processor/chrome/chrome_thread_slice_test.sql
index cc4a8ec..0a4bb35 100644
--- a/test/trace_processor/chrome/chrome_thread_slice_test.sql
+++ b/test/trace_processor/chrome/chrome_thread_slice_test.sql
@@ -14,8 +14,7 @@
 -- limitations under the License.
 --
 
-SELECT RUN_METRIC('chrome/chrome_thread_slice.sql')
-   ;
+SELECT RUN_METRIC('chrome/chrome_thread_slice.sql');
 
 SELECT
   EXTRACT_ARG(arg_set_id, 'chrome_latency_info.trace_id') AS trace_id,
@@ -23,5 +22,5 @@
   thread_dur
 FROM chrome_thread_slice
 WHERE
-  name = 'LatencyInfo.Flow' AND
-  EXTRACT_ARG(arg_set_id, 'chrome_latency_info.trace_id') = 2734;
+  name = 'LatencyInfo.Flow'
+  AND EXTRACT_ARG(arg_set_id, 'chrome_latency_info.trace_id') = 2734;
diff --git a/test/trace_processor/chrome/event_latency_scroll_jank_test.sql b/test/trace_processor/chrome/event_latency_scroll_jank_test.sql
index e1d3203..6956194 100644
--- a/test/trace_processor/chrome/event_latency_scroll_jank_test.sql
+++ b/test/trace_processor/chrome/event_latency_scroll_jank_test.sql
@@ -16,19 +16,19 @@
 SELECT RUN_METRIC('chrome/event_latency_scroll_jank.sql');
 
 SELECT
-    jank,
-    next_jank,
-    prev_jank,
-    gesture_begin_ts,
-    gesture_end_ts,
-    ts,
-    dur,
-    dur_before_show_on_screen,
-    event_type,
-    next_ts,
-    next_dur,
-    prev_ts,
-    prev_dur
+  jank,
+  next_jank,
+  prev_jank,
+  gesture_begin_ts,
+  gesture_end_ts,
+  ts,
+  dur,
+  dur_before_show_on_screen,
+  event_type,
+  next_ts,
+  next_dur,
+  prev_ts,
+  prev_dur
 FROM scroll_event_latency_jank
 ORDER BY jank DESC
-LIMIT 10;
\ No newline at end of file
+LIMIT 10;
diff --git a/test/trace_processor/chrome/event_latency_to_breakdowns_test.sql b/test/trace_processor/chrome/event_latency_to_breakdowns_test.sql
index 0ab25aa..a67402d 100644
--- a/test/trace_processor/chrome/event_latency_to_breakdowns_test.sql
+++ b/test/trace_processor/chrome/event_latency_to_breakdowns_test.sql
@@ -16,14 +16,14 @@
 SELECT RUN_METRIC('chrome/event_latency_to_breakdowns.sql');
 
 SELECT
-    event_latency_ts,
-    event_latency_dur,
-    event_type,
-    GenerationToRendererCompositorNs,
-    GenerationToBrowserMainNs,
-    BrowserMainToRendererCompositorNs,
-    RendererCompositorQueueingDelayNs,
-    unknown_stages_seen
+  event_latency_ts,
+  event_latency_dur,
+  event_type,
+  GenerationToRendererCompositorNs,
+  GenerationToBrowserMainNs,
+  BrowserMainToRendererCompositorNs,
+  RendererCompositorQueueingDelayNs,
+  unknown_stages_seen
 FROM event_latency_to_breakdowns
 ORDER BY event_latency_id
-LIMIT 30;
\ No newline at end of file
+LIMIT 30;
diff --git a/test/trace_processor/chrome/experimental_reliable_chrome_tasks_delaying_input_processing_test.sql b/test/trace_processor/chrome/experimental_reliable_chrome_tasks_delaying_input_processing_test.sql
index 4ac5c6e..e25d900 100644
--- a/test/trace_processor/chrome/experimental_reliable_chrome_tasks_delaying_input_processing_test.sql
+++ b/test/trace_processor/chrome/experimental_reliable_chrome_tasks_delaying_input_processing_test.sql
@@ -21,4 +21,4 @@
   full_name,
   duration_ms,
   thread_dur_ms
-FROM chrome_tasks_delaying_input_processing;
\ No newline at end of file
+FROM chrome_tasks_delaying_input_processing;
diff --git a/test/trace_processor/chrome/memory_snapshot_chrome_dump_events_test.sql b/test/trace_processor/chrome/memory_snapshot_chrome_dump_events_test.sql
index 67fbf86..d1a3d6e 100644
--- a/test/trace_processor/chrome/memory_snapshot_chrome_dump_events_test.sql
+++ b/test/trace_processor/chrome/memory_snapshot_chrome_dump_events_test.sql
@@ -22,4 +22,4 @@
   detail_level
 FROM memory_snapshot ms
 LEFT JOIN process_memory_snapshot pms
-  ON ms.id = pms.snapshot_id
+  ON ms.id = pms.snapshot_id;
diff --git a/test/trace_processor/chrome/memory_snapshot_edges_test.sql b/test/trace_processor/chrome/memory_snapshot_edges_test.sql
index 63307ad..a15e30a 100644
--- a/test/trace_processor/chrome/memory_snapshot_edges_test.sql
+++ b/test/trace_processor/chrome/memory_snapshot_edges_test.sql
@@ -20,4 +20,4 @@
   target_node_id,
   importance
 FROM memory_snapshot_edge
-LIMIT 20
+LIMIT 20;
diff --git a/test/trace_processor/chrome/memory_snapshot_general_validation_test.sql b/test/trace_processor/chrome/memory_snapshot_general_validation_test.sql
index 4075041..5fd5846 100644
--- a/test/trace_processor/chrome/memory_snapshot_general_validation_test.sql
+++ b/test/trace_processor/chrome/memory_snapshot_general_validation_test.sql
@@ -33,9 +33,9 @@
     SELECT COUNT(DISTINCT args.id)
     FROM args
     INNER JOIN memory_snapshot_node
-    ON args.arg_set_id = memory_snapshot_node.arg_set_id
+      ON args.arg_set_id = memory_snapshot_node.arg_set_id
   ) AS total_node_args,
   (
     SELECT COUNT(*) FROM profiler_smaps
     INNER JOIN memory_snapshot ON timestamp = ts
-  ) AS total_smaps
+  ) AS total_smaps;
diff --git a/test/trace_processor/chrome/memory_snapshot_node_args_test.sql b/test/trace_processor/chrome/memory_snapshot_node_args_test.sql
index 03df9e9..6d3958c 100644
--- a/test/trace_processor/chrome/memory_snapshot_node_args_test.sql
+++ b/test/trace_processor/chrome/memory_snapshot_node_args_test.sql
@@ -22,4 +22,4 @@
   string_value
 FROM memory_snapshot_node node
 INNER JOIN args ON node.arg_set_id = args.arg_set_id
-LIMIT 20
+LIMIT 20;
diff --git a/test/trace_processor/chrome/memory_snapshot_nodes_test.sql b/test/trace_processor/chrome/memory_snapshot_nodes_test.sql
index 0c014d3..ac049ba 100644
--- a/test/trace_processor/chrome/memory_snapshot_nodes_test.sql
+++ b/test/trace_processor/chrome/memory_snapshot_nodes_test.sql
@@ -22,4 +22,4 @@
   size,
   effective_size
 FROM memory_snapshot_node
-LIMIT 20
+LIMIT 20;
diff --git a/test/trace_processor/chrome/memory_snapshot_os_dump_events_test.sql b/test/trace_processor/chrome/memory_snapshot_os_dump_events_test.sql
index b266773..983e63e 100644
--- a/test/trace_processor/chrome/memory_snapshot_os_dump_events_test.sql
+++ b/test/trace_processor/chrome/memory_snapshot_os_dump_events_test.sql
@@ -28,15 +28,15 @@
 LEFT JOIN (
   SELECT id, upid
   FROM process_counter_track
-  WHERE name IS 'chrome.private_footprint_kb'
+  WHERE name = 'chrome.private_footprint_kb'
   ) AS pct_pf
   ON p.upid = pct_pf.upid
 LEFT JOIN counter pf ON timestamp = pf.ts AND pct_pf.id = pf.track_id
 LEFT JOIN (
   SELECT id, upid
   FROM process_counter_track
-  WHERE name IS 'chrome.peak_resident_set_kb'
+  WHERE name = 'chrome.peak_resident_set_kb'
   ) AS pct_prs
   ON p.upid = pct_prs.upid
 LEFT JOIN counter prs ON timestamp = prs.ts AND pct_prs.id = prs.track_id
-ORDER BY timestamp
+ORDER BY timestamp;
diff --git a/test/trace_processor/chrome/memory_snapshot_smaps_test.sql b/test/trace_processor/chrome/memory_snapshot_smaps_test.sql
index dfd1fce..1d4d207 100644
--- a/test/trace_processor/chrome/memory_snapshot_smaps_test.sql
+++ b/test/trace_processor/chrome/memory_snapshot_smaps_test.sql
@@ -36,4 +36,4 @@
 FROM process
 INNER JOIN profiler_smaps smap ON process.upid = smap.upid
 INNER JOIN memory_snapshot ms ON ms.timestamp = smap.ts
-LIMIT 20
+LIMIT 20;
diff --git a/test/trace_processor/chrome/proto_content_test.sql b/test/trace_processor/chrome/proto_content_test.sql
index b37717c..4ef9770 100644
--- a/test/trace_processor/chrome/proto_content_test.sql
+++ b/test/trace_processor/chrome/proto_content_test.sql
@@ -16,4 +16,4 @@
 SELECT path, total_size
 FROM experimental_proto_content
 ORDER BY total_size DESC, path
-LIMIT 10;
\ No newline at end of file
+LIMIT 10;
diff --git a/test/trace_processor/chrome/scroll_flow_event_queuing_delay_general_validation_test.sql b/test/trace_processor/chrome/scroll_flow_event_queuing_delay_general_validation_test.sql
index 2563840..656d0f8 100644
--- a/test/trace_processor/chrome/scroll_flow_event_queuing_delay_general_validation_test.sql
+++ b/test/trace_processor/chrome/scroll_flow_event_queuing_delay_general_validation_test.sql
@@ -12,8 +12,7 @@
 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
-SELECT RUN_METRIC('chrome/scroll_flow_event_queuing_delay.sql')
-   ;
+SELECT RUN_METRIC('chrome/scroll_flow_event_queuing_delay.sql');
 
 SELECT
   -- Each trace_id (in our example trace not true in general) has 8 steps. There
diff --git a/test/trace_processor/chrome/scroll_flow_event_queuing_delay_test.sql b/test/trace_processor/chrome/scroll_flow_event_queuing_delay_test.sql
index 3e00a31..f712edb 100644
--- a/test/trace_processor/chrome/scroll_flow_event_queuing_delay_test.sql
+++ b/test/trace_processor/chrome/scroll_flow_event_queuing_delay_test.sql
@@ -13,8 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-SELECT RUN_METRIC('chrome/scroll_flow_event_queuing_delay.sql')
- ;
+SELECT RUN_METRIC('chrome/scroll_flow_event_queuing_delay.sql');
 
 -- trace 2956 is janky and 2954 and 2960 surround it (both are not janky). We
 -- just manually computed these values to ensure the queuing time is correct.
diff --git a/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_general_validation_test.sql b/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_general_validation_test.sql
index 11df8a1..09fb1f4 100644
--- a/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_general_validation_test.sql
+++ b/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_general_validation_test.sql
@@ -12,26 +12,25 @@
 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
-SELECT RUN_METRIC('chrome/scroll_jank_cause_queuing_delay.sql')
-   ;
+SELECT RUN_METRIC('chrome/scroll_jank_cause_queuing_delay.sql');
 
 SELECT
-  COUNT(*) as total,
+  COUNT(*) AS total,
   (
-    SELECT
-      DISTINCT(avg_no_jank_dur_overlapping_ns)
+    SELECT DISTINCT
+      (avg_no_jank_dur_overlapping_ns)
     FROM scroll_jank_cause_queuing_delay
     WHERE
-      location = "LatencyInfo.Flow" AND
-      jank
+      location = "LatencyInfo.Flow"
+      AND jank
   ) AS janky_latency_info_non_jank_avg_dur,
   (
-    SELECT
-      DISTINCT(avg_no_jank_dur_overlapping_ns)
+    SELECT DISTINCT
+      (avg_no_jank_dur_overlapping_ns)
     FROM scroll_jank_cause_queuing_delay
     WHERE
-      location = "LatencyInfo.Flow" AND
-      NOT jank
+      location = "LatencyInfo.Flow"
+      AND NOT jank
   ) AS non_janky_latency_info_non_jank_avg_dur
 FROM (
   SELECT
diff --git a/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_restricted_test.sql b/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_restricted_test.sql
index e36ff60..d32a588 100644
--- a/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_restricted_test.sql
+++ b/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_restricted_test.sql
@@ -12,8 +12,7 @@
 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
-SELECT RUN_METRIC('chrome/scroll_jank_cause_queuing_delay.sql')
-   ;
+SELECT RUN_METRIC('chrome/scroll_jank_cause_queuing_delay.sql');
 
 SELECT
   process_name,
@@ -24,4 +23,4 @@
   restricted_metric_name
 FROM scroll_jank_cause_queuing_delay
 WHERE trace_id = 2918 OR trace_id = 2926
-ORDER BY trace_id ASC, ts ASC
+ORDER BY trace_id ASC, ts ASC;
diff --git a/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_test.sql b/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_test.sql
index ce8d3a6..9e8cb32 100644
--- a/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_test.sql
+++ b/test/trace_processor/chrome/scroll_jank_cause_queuing_delay_test.sql
@@ -23,4 +23,4 @@
   metric_name
 FROM scroll_jank_cause_queuing_delay
 WHERE trace_id = 2918 OR trace_id = 2926
-ORDER BY trace_id ASC, ts ASC
+ORDER BY trace_id ASC, ts ASC;
diff --git a/test/trace_processor/chrome/scroll_jank_cause_test.sql b/test/trace_processor/chrome/scroll_jank_cause_test.sql
index 6556b2d..f30e1b2 100644
--- a/test/trace_processor/chrome/scroll_jank_cause_test.sql
+++ b/test/trace_processor/chrome/scroll_jank_cause_test.sql
@@ -16,17 +16,17 @@
 
 SELECT
   COUNT(*) AS total,
-  SUM(jank) as total_jank,
+  SUM(jank) AS total_jank,
   SUM(explained_jank + unexplained_jank) AS sum_explained_and_unexplained,
   SUM(
     CASE WHEN explained_jank THEN
       unexplained_jank
-    ELSE
-      CASE WHEN jank AND NOT unexplained_jank THEN
-        1
       ELSE
-        0
-      END
+        CASE WHEN jank AND NOT unexplained_jank THEN
+          1
+          ELSE
+            0
+        END
     END
   ) AS error_rows
 FROM scroll_jank_cause;
diff --git a/test/trace_processor/chrome/scroll_jank_general_validation_test.sql b/test/trace_processor/chrome/scroll_jank_general_validation_test.sql
index 85af459..23372ea 100644
--- a/test/trace_processor/chrome/scroll_jank_general_validation_test.sql
+++ b/test/trace_processor/chrome/scroll_jank_general_validation_test.sql
@@ -73,10 +73,9 @@
 (
   -- This is floor((non_coalesced_janky_dur/non_coalesced_dur) * 100) in SQLite.
   SELECT
-    CAST((CAST((SELECT SUM(dur) FROM scroll_jank WHERE jank) AS FLOAT) /
-    CAST((SELECT SUM(dur) FROM scroll_jank) AS FLOAT)) * 100 AS INT)
+    CAST((CAST((SELECT SUM(dur) FROM scroll_jank WHERE jank) AS FLOAT)
+      / CAST((SELECT SUM(dur) FROM scroll_jank) AS FLOAT)) * 100 AS INT)
 ) AS janky_percentage,
 (
   SELECT avg_vsync_interval FROM joined_scroll_begin_and_end
-) as avg_vsync_interval;
-
+) AS avg_vsync_interval;
diff --git a/test/trace_processor/chrome/scroll_jank_mojo_simple_watcher_test.sql b/test/trace_processor/chrome/scroll_jank_mojo_simple_watcher_test.sql
index b346f2d..c7251ac 100644
--- a/test/trace_processor/chrome/scroll_jank_mojo_simple_watcher_test.sql
+++ b/test/trace_processor/chrome/scroll_jank_mojo_simple_watcher_test.sql
@@ -12,8 +12,7 @@
 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
-SELECT RUN_METRIC('chrome/scroll_jank_cause_queuing_delay.sql')
-   ;
+SELECT RUN_METRIC('chrome/scroll_jank_cause_queuing_delay.sql');
 
 SELECT
   trace_id,
diff --git a/test/trace_processor/chrome/touch_flow_event_queuing_delay_full_test.sql b/test/trace_processor/chrome/touch_flow_event_queuing_delay_full_test.sql
index d954797..69ecfa7 100644
--- a/test/trace_processor/chrome/touch_flow_event_queuing_delay_full_test.sql
+++ b/test/trace_processor/chrome/touch_flow_event_queuing_delay_full_test.sql
@@ -13,8 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-SELECT RUN_METRIC('chrome/touch_flow_event_queuing_delay.sql')
- ;
+SELECT RUN_METRIC('chrome/touch_flow_event_queuing_delay.sql');
 
 -- trace 6911 is janky and 6915 and 6940 succeed it (both are not janky).
 SELECT
diff --git a/test/trace_processor/chrome/touch_flow_event_queuing_delay_test.sql b/test/trace_processor/chrome/touch_flow_event_queuing_delay_test.sql
index bad05ff..9680a4c 100644
--- a/test/trace_processor/chrome/touch_flow_event_queuing_delay_test.sql
+++ b/test/trace_processor/chrome/touch_flow_event_queuing_delay_test.sql
@@ -13,8 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-SELECT RUN_METRIC('chrome/touch_flow_event_queuing_delay.sql')
- ;
+SELECT RUN_METRIC('chrome/touch_flow_event_queuing_delay.sql');
 
 -- trace 6911 is janky and 6915 and 6940 succeed it (both are not janky).
 SELECT
diff --git a/test/trace_processor/common/list_slices_test.sql b/test/trace_processor/common/list_slices_test.sql
index 55b0d72..505d2a7 100644
--- a/test/trace_processor/common/list_slices_test.sql
+++ b/test/trace_processor/common/list_slices_test.sql
@@ -1,2 +1,2 @@
 SELECT ts, dur, name
-FROM slice
+FROM slice;
diff --git a/test/trace_processor/common/process_track_slices_test.sql b/test/trace_processor/common/process_track_slices_test.sql
index 1b9151d..66c8fae 100644
--- a/test/trace_processor/common/process_track_slices_test.sql
+++ b/test/trace_processor/common/process_track_slices_test.sql
@@ -17,8 +17,8 @@
   ts,
   dur,
   pid,
-  slice.name as slice_name,
-  process_track.name as track_name
+  slice.name AS slice_name,
+  process_track.name AS track_name
 FROM slice
 INNER JOIN process_track ON slice.track_id = process_track.id
-INNER JOIN process USING (upid)
+INNER JOIN process USING (upid);
diff --git a/test/trace_processor/common/process_tracking_test.sql b/test/trace_processor/common/process_tracking_test.sql
index b28859d..278dc14 100644
--- a/test/trace_processor/common/process_tracking_test.sql
+++ b/test/trace_processor/common/process_tracking_test.sql
@@ -13,8 +13,8 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select tid, pid, process.name as pname, thread.name as tname
-from thread
-left join process using(upid)
-where tid > 0
-order by tid
+SELECT tid, pid, process.name AS pname, thread.name AS tname
+FROM thread
+LEFT JOIN process USING(upid)
+WHERE tid > 0
+ORDER BY tid;
diff --git a/test/trace_processor/common/smoke_slices_test.sql b/test/trace_processor/common/smoke_slices_test.sql
index f876c41..9ed001d 100644
--- a/test/trace_processor/common/smoke_slices_test.sql
+++ b/test/trace_processor/common/smoke_slices_test.sql
@@ -13,8 +13,8 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select track.type as type, depth, count(*) as count
-from slice
-inner join track on slice.track_id = track.id
-group by track.type, depth
-order by track.type, depth;
+SELECT track.type AS type, depth, count(*) AS count
+FROM slice
+INNER JOIN track ON slice.track_id = track.id
+GROUP BY track.type, depth
+ORDER BY track.type, depth;
diff --git a/test/trace_processor/common/to_systrace_test.sql b/test/trace_processor/common/to_systrace_test.sql
index b2b6ed0..da5d30a 100644
--- a/test/trace_processor/common/to_systrace_test.sql
+++ b/test/trace_processor/common/to_systrace_test.sql
@@ -1,2 +1,2 @@
-select to_ftrace(id) as line
-from raw
\ No newline at end of file
+SELECT to_ftrace(id) AS line
+FROM raw;
diff --git a/test/trace_processor/dynamic/abs_time_str_test.sql b/test/trace_processor/dynamic/abs_time_str_test.sql
index 2cbae92..ac9a5fd 100644
--- a/test/trace_processor/dynamic/abs_time_str_test.sql
+++ b/test/trace_processor/dynamic/abs_time_str_test.sql
@@ -1,4 +1,4 @@
 SELECT
-  ABS_TIME_STR(15) as t15,
-  ABS_TIME_STR(25) as t25,
-  ABS_TIME_STR(35) as t35;
+  ABS_TIME_STR(15) AS t15,
+  ABS_TIME_STR(25) AS t25,
+  ABS_TIME_STR(35) AS t35;
diff --git a/test/trace_processor/dynamic/ancestor_slice_by_stack_test.sql b/test/trace_processor/dynamic/ancestor_slice_by_stack_test.sql
index 3b5089e..6945ac7 100644
--- a/test/trace_processor/dynamic/ancestor_slice_by_stack_test.sql
+++ b/test/trace_processor/dynamic/ancestor_slice_by_stack_test.sql
@@ -2,4 +2,4 @@
   SELECT stack_id FROM slice
   WHERE name = 'event_depth_2'
   LIMIT 1
-));
+  ));
diff --git a/test/trace_processor/dynamic/annotated_callstack_test.sql b/test/trace_processor/dynamic/annotated_callstack_test.sql
index 36e8b9b..1e3d7bb 100644
--- a/test/trace_processor/dynamic/annotated_callstack_test.sql
+++ b/test/trace_processor/dynamic/annotated_callstack_test.sql
@@ -14,12 +14,11 @@
 -- limitations under the License.
 --
 
-select eac.id, eac.depth, eac.frame_id, eac.annotation,
+SELECT eac.id, eac.depth, eac.frame_id, eac.annotation,
        spf.name
-from experimental_annotated_callstack eac
-join perf_sample ps
-  on (eac.start_id = ps.callsite_id)
-join stack_profile_frame spf
-  on (eac.frame_id = spf.id)
-order by eac.start_id asc, eac.depth asc;
-
+FROM experimental_annotated_callstack eac
+JOIN perf_sample ps
+  ON (eac.start_id = ps.callsite_id)
+JOIN stack_profile_frame spf
+  ON (eac.frame_id = spf.id)
+ORDER BY eac.start_id ASC, eac.depth ASC;
diff --git a/test/trace_processor/dynamic/connected_flow_test.sql b/test/trace_processor/dynamic/connected_flow_test.sql
index 96f079f..7582bf7 100644
--- a/test/trace_processor/dynamic/connected_flow_test.sql
+++ b/test/trace_processor/dynamic/connected_flow_test.sql
@@ -13,18 +13,18 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-SELECT "directly_connected" as type, s.name, s1.name as start_name, s2.name as end_name  FROM slice s
+SELECT "directly_connected" AS type, s.name, s1.name AS start_name, s2.name AS end_name FROM slice s
 JOIN DIRECTLY_CONNECTED_FLOW(s.id) c
 JOIN slice s1 ON s1.id = c.slice_out
 JOIN slice s2 ON s2.id = c.slice_in
 UNION
-SELECT "following" as type, s.name, s1.name as start_name, s2.name as end_name  FROM slice s
+SELECT "following" AS type, s.name, s1.name AS start_name, s2.name AS end_name FROM slice s
 JOIN FOLLOWING_FLOW(s.id) c
 JOIN slice s1 ON s1.id = c.slice_out
 JOIN slice s2 ON s2.id = c.slice_in
 UNION
-SELECT "preceding" as type, s.name, s1.name as start_name, s2.name as end_name  FROM slice s
+SELECT "preceding" AS type, s.name, s1.name AS start_name, s2.name AS end_name FROM slice s
 JOIN PRECEDING_FLOW(s.id) c
 JOIN slice s1 ON s1.id = c.slice_out
 JOIN slice s2 ON s2.id = c.slice_in
-ORDER BY type, s.name, s1.name, s2.name ASC
+ORDER BY type, s.name, s1.name, s2.name ASC;
diff --git a/test/trace_processor/dynamic/descendant_slice_by_stack_test.sql b/test/trace_processor/dynamic/descendant_slice_by_stack_test.sql
index ac42bda..ff40cd8 100644
--- a/test/trace_processor/dynamic/descendant_slice_by_stack_test.sql
+++ b/test/trace_processor/dynamic/descendant_slice_by_stack_test.sql
@@ -2,5 +2,4 @@
   SELECT stack_id FROM slice
   WHERE name = 'event_depth_0'
   LIMIT 1
-));
-
+  ));
diff --git a/test/trace_processor/dynamic/to_monotonic_test.sql b/test/trace_processor/dynamic/to_monotonic_test.sql
index d9bb029..7c801ae 100644
--- a/test/trace_processor/dynamic/to_monotonic_test.sql
+++ b/test/trace_processor/dynamic/to_monotonic_test.sql
@@ -1,4 +1,4 @@
 SELECT
-  TO_MONOTONIC(25) as t15,
-  TO_MONOTONIC(35) as t20,
-  TO_MONOTONIC(50) as t25
+  TO_MONOTONIC(25) AS t15,
+  TO_MONOTONIC(35) AS t20,
+  TO_MONOTONIC(50) AS t25;
diff --git a/test/trace_processor/fs/f2fs_iostat_latency_test.sql b/test/trace_processor/fs/f2fs_iostat_latency_test.sql
index fa20398..a33e8bb 100644
--- a/test/trace_processor/fs/f2fs_iostat_latency_test.sql
+++ b/test/trace_processor/fs/f2fs_iostat_latency_test.sql
@@ -4,7 +4,7 @@
   value
 FROM
   counter AS c
-  JOIN
+JOIN
   counter_track AS ct
   ON c.track_id = ct.id
-ORDER BY name,ts
+ORDER BY name, ts;
diff --git a/test/trace_processor/fs/f2fs_iostat_test.sql b/test/trace_processor/fs/f2fs_iostat_test.sql
index fa20398..a33e8bb 100644
--- a/test/trace_processor/fs/f2fs_iostat_test.sql
+++ b/test/trace_processor/fs/f2fs_iostat_test.sql
@@ -4,7 +4,7 @@
   value
 FROM
   counter AS c
-  JOIN
+JOIN
   counter_track AS ct
   ON c.track_id = ct.id
-ORDER BY name,ts
+ORDER BY name, ts;
diff --git a/test/trace_processor/fuchsia/smoke_args_test.sql b/test/trace_processor/fuchsia/smoke_args_test.sql
index 522f538..4c797a4 100644
--- a/test/trace_processor/fuchsia/smoke_args_test.sql
+++ b/test/trace_processor/fuchsia/smoke_args_test.sql
@@ -13,9 +13,9 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select
+SELECT
   key,
   COUNT(*)
-from args
-group by key
-limit 10;
+FROM args
+GROUP BY key
+LIMIT 10;
diff --git a/test/trace_processor/fuchsia/smoke_counters_test.sql b/test/trace_processor/fuchsia/smoke_counters_test.sql
index b4dc7ed..07093fe 100644
--- a/test/trace_processor/fuchsia/smoke_counters_test.sql
+++ b/test/trace_processor/fuchsia/smoke_counters_test.sql
@@ -13,9 +13,9 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select
+SELECT
   ts,
   value,
   name
-from counters
-limit 10;
+FROM counters
+LIMIT 10;
diff --git a/test/trace_processor/fuchsia/smoke_flow_test.sql b/test/trace_processor/fuchsia/smoke_flow_test.sql
index e0b8af4..dfe6823 100644
--- a/test/trace_processor/fuchsia/smoke_flow_test.sql
+++ b/test/trace_processor/fuchsia/smoke_flow_test.sql
@@ -13,9 +13,9 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select
+SELECT
   id,
   slice_out,
   slice_in
-from flow
-limit 10;
+FROM flow
+LIMIT 10;
diff --git a/test/trace_processor/fuchsia/smoke_instants_test.sql b/test/trace_processor/fuchsia/smoke_instants_test.sql
index cc5c40e..987b9a1 100644
--- a/test/trace_processor/fuchsia/smoke_instants_test.sql
+++ b/test/trace_processor/fuchsia/smoke_instants_test.sql
@@ -13,10 +13,10 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select
+SELECT
   ts,
   name
-from slice
-where
+FROM slice
+WHERE
   dur = 0
-limit 10;
+LIMIT 10;
diff --git a/test/trace_processor/fuchsia/smoke_type_test.sql b/test/trace_processor/fuchsia/smoke_type_test.sql
index 4a29c12..8d6b538 100644
--- a/test/trace_processor/fuchsia/smoke_type_test.sql
+++ b/test/trace_processor/fuchsia/smoke_type_test.sql
@@ -13,9 +13,9 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select
+SELECT
   id,
   name,
   type
-from track
-limit 10;
+FROM track
+LIMIT 10;
diff --git a/test/trace_processor/functions/first_non_null_frame_test.sql b/test/trace_processor/functions/first_non_null_frame_test.sql
index 6bee967..ae93bf6 100644
--- a/test/trace_processor/functions/first_non_null_frame_test.sql
+++ b/test/trace_processor/functions/first_non_null_frame_test.sql
@@ -6,6 +6,6 @@
 SELECT
   id,
   LAST_NON_NULL(val)
-    OVER (ORDER BY id ASC ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING) AS val
+  OVER (ORDER BY id ASC ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING) AS val
 FROM TEST
 ORDER BY id ASC;
diff --git a/test/trace_processor/functions/first_non_null_partition_test.sql b/test/trace_processor/functions/first_non_null_partition_test.sql
index 674bde3..7f3149f 100644
--- a/test/trace_processor/functions/first_non_null_partition_test.sql
+++ b/test/trace_processor/functions/first_non_null_partition_test.sql
@@ -2,13 +2,13 @@
 
 INSERT INTO TEST
 VALUES
-  (1, 'A', 1),
-  (2, 'A', NULL),
-  (3, 'A', 3),
-  (4, 'B', NULL),
-  (5, 'B', 5),
-  (6, 'B', NULL),
-  (7, 'B', 7);
+(1, 'A', 1),
+(2, 'A', NULL),
+(3, 'A', 3),
+(4, 'B', NULL),
+(5, 'B', 5),
+(6, 'B', NULL),
+(7, 'B', 7);
 
 SELECT id, LAST_NON_NULL(val) OVER (PARTITION BY part ORDER BY id ASC) AS val
 FROM TEST
diff --git a/test/trace_processor/graphics/actual_frame_timeline_events_test.sql b/test/trace_processor/graphics/actual_frame_timeline_events_test.sql
index 412f4b7..a46f6aa 100644
--- a/test/trace_processor/graphics/actual_frame_timeline_events_test.sql
+++ b/test/trace_processor/graphics/actual_frame_timeline_events_test.sql
@@ -13,12 +13,12 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-select ts, dur, process.pid as pid, display_frame_token, surface_frame_token, layer_name,
-    present_type, on_time_finish, gpu_composition, jank_type, prediction_type, jank_tag
-from
-  (select t.*, process_track.name as track_name from
-    process_track left join actual_frame_timeline_slice t
-    on process_track.id = t.track_id) s
-join process using(upid)
-where s.track_name = 'Actual Timeline'
-order by ts
+SELECT ts, dur, process.pid AS pid, display_frame_token, surface_frame_token, layer_name,
+  present_type, on_time_finish, gpu_composition, jank_type, prediction_type, jank_tag
+FROM
+  (SELECT t.*, process_track.name AS track_name FROM
+    process_track LEFT JOIN actual_frame_timeline_slice t
+    ON process_track.id = t.track_id) s
+JOIN process USING(upid)
+WHERE s.track_name = 'Actual Timeline'
+ORDER BY ts;
diff --git a/test/trace_processor/graphics/android_sysui_cuj_event_test.sql b/test/trace_processor/graphics/android_sysui_cuj_event_test.sql
index 7a991a6..226d193 100644
--- a/test/trace_processor/graphics/android_sysui_cuj_event_test.sql
+++ b/test/trace_processor/graphics/android_sysui_cuj_event_test.sql
@@ -15,4 +15,4 @@
 
 SELECT RUN_METRIC('android/android_sysui_cuj.sql');
 
-SELECT * FROM android_sysui_cuj_event;
\ No newline at end of file
+SELECT * FROM android_sysui_cuj_event;
diff --git a/test/trace_processor/graphics/clock_sync_test.sql b/test/trace_processor/graphics/clock_sync_test.sql
index ac9e48a..d548296 100644
--- a/test/trace_processor/graphics/clock_sync_test.sql
+++ b/test/trace_processor/graphics/clock_sync_test.sql
@@ -13,6 +13,6 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, cast(value as integer) as int_value
-from counters
-where name GLOB 'gpu_counter*'
\ No newline at end of file
+SELECT ts, cast(value AS integer) AS int_value
+FROM counters
+WHERE name GLOB 'gpu_counter*';
diff --git a/test/trace_processor/graphics/composer_execution_test.sql b/test/trace_processor/graphics/composer_execution_test.sql
index 808927c..b0b9fc3 100644
--- a/test/trace_processor/graphics/composer_execution_test.sql
+++ b/test/trace_processor/graphics/composer_execution_test.sql
@@ -18,8 +18,8 @@
 
 SELECT
   validation_type,
-  COUNT(*) as count,
-  SUM(execution_time_ns) as total
+  COUNT(*) AS count,
+  SUM(execution_time_ns) AS total
 FROM hwc_execution_spans
 GROUP BY validation_type
 ORDER BY validation_type;
diff --git a/test/trace_processor/graphics/drm_gpu_track_test.sql b/test/trace_processor/graphics/drm_gpu_track_test.sql
index b1554a8..3f73d36 100644
--- a/test/trace_processor/graphics/drm_gpu_track_test.sql
+++ b/test/trace_processor/graphics/drm_gpu_track_test.sql
@@ -8,8 +8,8 @@
   string_value
 FROM
   gpu_track
-  JOIN slice
+JOIN slice
   ON slice.track_id = gpu_track.id
-  JOIN args
+JOIN args
   ON slice.arg_set_id = args.arg_set_id
-ORDER BY ts
+ORDER BY ts;
diff --git a/test/trace_processor/graphics/drm_thread_track_test.sql b/test/trace_processor/graphics/drm_thread_track_test.sql
index 4c879fb..624356f 100644
--- a/test/trace_processor/graphics/drm_thread_track_test.sql
+++ b/test/trace_processor/graphics/drm_thread_track_test.sql
@@ -8,8 +8,8 @@
   string_value
 FROM
   thread_track
-  JOIN slice
+JOIN slice
   ON slice.track_id = thread_track.id
-  JOIN args
+JOIN args
   ON slice.arg_set_id = args.arg_set_id
-ORDER BY ts
+ORDER BY ts;
diff --git a/test/trace_processor/graphics/expected_frame_timeline_events_test.sql b/test/trace_processor/graphics/expected_frame_timeline_events_test.sql
index 31669c2..ddf3f2f 100644
--- a/test/trace_processor/graphics/expected_frame_timeline_events_test.sql
+++ b/test/trace_processor/graphics/expected_frame_timeline_events_test.sql
@@ -13,11 +13,11 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-select ts, dur, process.pid as pid, display_frame_token, surface_frame_token, layer_name
-from
-  (select t.*, process_track.name as track_name from
-    process_track left join expected_frame_timeline_slice t
-    on process_track.id = t.track_id) s
-join process using(upid)
-where s.track_name = 'Expected Timeline'
-order by ts
+SELECT ts, dur, process.pid AS pid, display_frame_token, surface_frame_token, layer_name
+FROM
+  (SELECT t.*, process_track.name AS track_name FROM
+    process_track LEFT JOIN expected_frame_timeline_slice t
+    ON process_track.id = t.track_id) s
+JOIN process USING(upid)
+WHERE s.track_name = 'Expected Timeline'
+ORDER BY ts;
diff --git a/test/trace_processor/graphics/frame_missed_event_test.sql b/test/trace_processor/graphics/frame_missed_event_test.sql
index c4b275b..5553e72 100644
--- a/test/trace_processor/graphics/frame_missed_event_test.sql
+++ b/test/trace_processor/graphics/frame_missed_event_test.sql
@@ -16,4 +16,4 @@
 SELECT RUN_METRIC('android/android_surfaceflinger.sql');
 
 SELECT ts, dur
-FROM android_surfaceflinger_event;
\ No newline at end of file
+FROM android_surfaceflinger_event;
diff --git a/test/trace_processor/graphics/gpu_counter_specs_test.sql b/test/trace_processor/graphics/gpu_counter_specs_test.sql
index 9faa557..4ddf6ff 100644
--- a/test/trace_processor/graphics/gpu_counter_specs_test.sql
+++ b/test/trace_processor/graphics/gpu_counter_specs_test.sql
@@ -12,7 +12,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select group_id,c.name,c.description,unit
-from gpu_counter_group as g
-join gpu_counter_track as c
-  on g.track_id = c.id
+SELECT group_id, c.name, c.description, unit
+FROM gpu_counter_group AS g
+JOIN gpu_counter_track AS c
+  ON g.track_id = c.id;
diff --git a/test/trace_processor/graphics/gpu_counters_test.sql b/test/trace_processor/graphics/gpu_counters_test.sql
index 1d8c1c6..8cc24d1 100644
--- a/test/trace_processor/graphics/gpu_counters_test.sql
+++ b/test/trace_processor/graphics/gpu_counters_test.sql
@@ -13,8 +13,8 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select "ts","value","name","gpu_id","description","unit"
-from counter
-join gpu_counter_track
-  on counter.track_id = gpu_counter_track.id
-order by "ts";
+SELECT "ts", "value", "name", "gpu_id", "description", "unit"
+FROM counter
+JOIN gpu_counter_track
+  ON counter.track_id = gpu_counter_track.id
+ORDER BY "ts";
diff --git a/test/trace_processor/graphics/gpu_log_test.sql b/test/trace_processor/graphics/gpu_log_test.sql
index 2e48384..a613335 100644
--- a/test/trace_processor/graphics/gpu_log_test.sql
+++ b/test/trace_processor/graphics/gpu_log_test.sql
@@ -13,10 +13,10 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select scope, track.name as track_name, ts, dur, gpu_slice.name as slice_name,
-    key, string_value as value
-from gpu_track
-left join track using (id)
-left join gpu_slice on gpu_track.id=gpu_slice.track_id
-left join args using (arg_set_id)
-order by ts, slice_name, key
+SELECT scope, track.name AS track_name, ts, dur, gpu_slice.name AS slice_name,
+  key, string_value AS value
+FROM gpu_track
+LEFT JOIN track USING (id)
+LEFT JOIN gpu_slice ON gpu_track.id = gpu_slice.track_id
+LEFT JOIN args USING (arg_set_id)
+ORDER BY ts, slice_name, key;
diff --git a/test/trace_processor/graphics/gpu_mem_total_test.sql b/test/trace_processor/graphics/gpu_mem_total_test.sql
index be985aa..b1b6d89 100644
--- a/test/trace_processor/graphics/gpu_mem_total_test.sql
+++ b/test/trace_processor/graphics/gpu_mem_total_test.sql
@@ -1,6 +1,6 @@
-SELECT ct.name, ct.unit, ct.description, c.ts, p.pid, CAST(c.value as INT) as value
+SELECT ct.name, ct.unit, ct.description, c.ts, p.pid, CAST(c.value AS INT) AS value
 FROM counter_track ct
 LEFT JOIN process_counter_track pct USING (id)
 LEFT JOIN process p USING (upid)
 LEFT JOIN counter c ON c.track_id = ct.id
-ORDER BY ts
+ORDER BY ts;
diff --git a/test/trace_processor/graphics/gpu_render_stages_test.sql b/test/trace_processor/graphics/gpu_render_stages_test.sql
index 50b887c..8d73f8b 100644
--- a/test/trace_processor/graphics/gpu_render_stages_test.sql
+++ b/test/trace_processor/graphics/gpu_render_stages_test.sql
@@ -14,11 +14,11 @@
 -- limitations under the License.
 --
 SELECT track.name AS track_name, gpu_track.description AS track_desc, ts, dur,
-    gpu_slice.name AS slice_name, depth, flat_key, string_value,
-    gpu_slice.context_id, render_target, render_target_name, render_pass, render_pass_name,
-    command_buffer, command_buffer_name, submission_id, hw_queue_id, render_subpasses
+  gpu_slice.name AS slice_name, depth, flat_key, string_value,
+  gpu_slice.context_id, render_target, render_target_name, render_pass, render_pass_name,
+  command_buffer, command_buffer_name, submission_id, hw_queue_id, render_subpasses
 FROM gpu_track
 LEFT JOIN track USING (id)
-INNER JOIN gpu_slice ON gpu_track.id=gpu_slice.track_id
+INNER JOIN gpu_slice ON gpu_track.id = gpu_slice.track_id
 LEFT JOIN args ON gpu_slice.arg_set_id = args.arg_set_id
 ORDER BY ts;
diff --git a/test/trace_processor/graphics/graphics_frame_events_test.sql b/test/trace_processor/graphics/graphics_frame_events_test.sql
index 3e42f53..e234318 100644
--- a/test/trace_processor/graphics/graphics_frame_events_test.sql
+++ b/test/trace_processor/graphics/graphics_frame_events_test.sql
@@ -13,9 +13,9 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, gpu_track.name as track_name, dur, frame_slice.name as slice_name,
-    frame_number, layer_name
-from gpu_track
-left join frame_slice on gpu_track.id=frame_slice.track_id
-where scope='graphics_frame_event'
-order by ts
+SELECT ts, gpu_track.name AS track_name, dur, frame_slice.name AS slice_name,
+  frame_number, layer_name
+FROM gpu_track
+LEFT JOIN frame_slice ON gpu_track.id = frame_slice.track_id
+WHERE scope = 'graphics_frame_event'
+ORDER BY ts;
diff --git a/test/trace_processor/graphics/v4l2_vidioc_flow_test.sql b/test/trace_processor/graphics/v4l2_vidioc_flow_test.sql
index dccb5d9..7b7b63b 100644
--- a/test/trace_processor/graphics/v4l2_vidioc_flow_test.sql
+++ b/test/trace_processor/graphics/v4l2_vidioc_flow_test.sql
@@ -13,7 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select qbuf.ts, qbuf.dur, qbuf.name, dqbuf.ts, dqbuf.dur, dqbuf.name
-from flow
-inner join slice qbuf on flow.slice_out = qbuf.id
-inner join slice dqbuf on flow.slice_in = dqbuf.id
+SELECT qbuf.ts, qbuf.dur, qbuf.name, dqbuf.ts, dqbuf.dur, dqbuf.name
+FROM flow
+INNER JOIN slice qbuf ON flow.slice_out = qbuf.id
+INNER JOIN slice dqbuf ON flow.slice_in = dqbuf.id;
diff --git a/test/trace_processor/graphics/v4l2_vidioc_slice_test.sql b/test/trace_processor/graphics/v4l2_vidioc_slice_test.sql
index 0c08e27..a7c6a24 100644
--- a/test/trace_processor/graphics/v4l2_vidioc_slice_test.sql
+++ b/test/trace_processor/graphics/v4l2_vidioc_slice_test.sql
@@ -13,6 +13,6 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, dur, name
-from slice
-where category = 'Video 4 Linux 2';
+SELECT ts, dur, name
+FROM slice
+WHERE category = 'Video 4 Linux 2';
diff --git a/test/trace_processor/graphics/virtio_video_slice_test.sql b/test/trace_processor/graphics/virtio_video_slice_test.sql
index df50d4f..b2b3832 100644
--- a/test/trace_processor/graphics/virtio_video_slice_test.sql
+++ b/test/trace_processor/graphics/virtio_video_slice_test.sql
@@ -13,6 +13,6 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select slice.ts, slice.dur, slice.name, track.name
-from slice
-inner join track on slice.track_id = track.id;
+SELECT slice.ts, slice.dur, slice.name, track.name
+FROM slice
+INNER JOIN track ON slice.track_id = track.id;
diff --git a/test/trace_processor/graphics/vulkan_api_events_test.sql b/test/trace_processor/graphics/vulkan_api_events_test.sql
index 89fccd9..4b27219 100644
--- a/test/trace_processor/graphics/vulkan_api_events_test.sql
+++ b/test/trace_processor/graphics/vulkan_api_events_test.sql
@@ -14,10 +14,10 @@
 -- limitations under the License.
 --
 SELECT track.name AS track_name, gpu_track.description AS track_desc, ts, dur,
-    gpu_slice.name AS slice_name, depth, flat_key, int_value,
-    gpu_slice.context_id, command_buffer, submission_id
+  gpu_slice.name AS slice_name, depth, flat_key, int_value,
+  gpu_slice.context_id, command_buffer, submission_id
 FROM gpu_track
 LEFT JOIN track USING (id)
-INNER JOIN gpu_slice ON gpu_track.id=gpu_slice.track_id
+INNER JOIN gpu_slice ON gpu_track.id = gpu_slice.track_id
 LEFT JOIN args ON gpu_slice.arg_set_id = args.arg_set_id
 ORDER BY ts;
diff --git a/test/trace_processor/io/ufshcd_command_tag_test.sql b/test/trace_processor/io/ufshcd_command_tag_test.sql
index 8d3e994..bb6ca7c 100644
--- a/test/trace_processor/io/ufshcd_command_tag_test.sql
+++ b/test/trace_processor/io/ufshcd_command_tag_test.sql
@@ -1,5 +1,5 @@
 SELECT ts, dur, slice.name
 FROM slice
-JOIN track on slice.track_id = track.id
+JOIN track ON slice.track_id = track.id
 WHERE track.name GLOB 'io.ufs.command.tag*'
-ORDER BY ts
+ORDER BY ts;
diff --git a/test/trace_processor/io/ufshcd_command_test.sql b/test/trace_processor/io/ufshcd_command_test.sql
index 2f706bb..8a7b82b 100644
--- a/test/trace_processor/io/ufshcd_command_test.sql
+++ b/test/trace_processor/io/ufshcd_command_test.sql
@@ -3,9 +3,9 @@
   value
 FROM
   counter AS c
-  JOIN
+JOIN
   counter_track AS ct
   ON c.track_id = ct.id
 WHERE
   ct.name = "io.ufs.command.count"
-ORDER BY ts
+ORDER BY ts;
diff --git a/test/trace_processor/memory/cma_test.sql b/test/trace_processor/memory/cma_test.sql
index 7729d33..140e31d 100644
--- a/test/trace_processor/memory/cma_test.sql
+++ b/test/trace_processor/memory/cma_test.sql
@@ -1 +1 @@
-SELECT ts, dur, name  FROM slice WHERE name = 'mm_cma_alloc';
\ No newline at end of file
+SELECT ts, dur, name FROM slice WHERE name = 'mm_cma_alloc';
diff --git a/test/trace_processor/memory/shrink_slab_test.sql b/test/trace_processor/memory/shrink_slab_test.sql
index 3fbf1fa..81286ee 100644
--- a/test/trace_processor/memory/shrink_slab_test.sql
+++ b/test/trace_processor/memory/shrink_slab_test.sql
@@ -1 +1 @@
-SELECT ts, dur, name  FROM slice WHERE name = 'mm_vmscan_shrink_slab';
\ No newline at end of file
+SELECT ts, dur, name FROM slice WHERE name = 'mm_vmscan_shrink_slab';
diff --git a/test/trace_processor/network/inet_sock_set_state_test.sql b/test/trace_processor/network/inet_sock_set_state_test.sql
index badba1e..5f76516 100644
--- a/test/trace_processor/network/inet_sock_set_state_test.sql
+++ b/test/trace_processor/network/inet_sock_set_state_test.sql
@@ -5,7 +5,7 @@
   t.name
 FROM
   slice AS s
-  LEFT JOIN track AS t
+LEFT JOIN track AS t
   ON s.track_id = t.id
 WHERE
   t.name GLOB "TCP stream#*"
diff --git a/test/trace_processor/network/kfree_skb_test.sql b/test/trace_processor/network/kfree_skb_test.sql
index 6ec2056..d76d531 100644
--- a/test/trace_processor/network/kfree_skb_test.sql
+++ b/test/trace_processor/network/kfree_skb_test.sql
@@ -4,7 +4,7 @@
   EXTRACT_ARG(arg_set_id, 'protocol') AS prot
 FROM
   counter AS c
-  LEFT JOIN
+LEFT JOIN
   counter_track AS t
   ON c.track_id = t.id
 WHERE
diff --git a/test/trace_processor/network/net_dev_xmit_test.sql b/test/trace_processor/network/net_dev_xmit_test.sql
index 8c4fcd4..5252510 100644
--- a/test/trace_processor/network/net_dev_xmit_test.sql
+++ b/test/trace_processor/network/net_dev_xmit_test.sql
@@ -5,7 +5,7 @@
   EXTRACT_ARG(arg_set_id, 'len') AS len
 FROM
   counter AS c
-  LEFT JOIN
+LEFT JOIN
   counter_track AS t
   ON c.track_id = t.id
 WHERE
diff --git a/test/trace_processor/network/netif_receive_skb_test.sql b/test/trace_processor/network/netif_receive_skb_test.sql
index 20dc468..83a486d 100644
--- a/test/trace_processor/network/netif_receive_skb_test.sql
+++ b/test/trace_processor/network/netif_receive_skb_test.sql
@@ -5,7 +5,7 @@
   EXTRACT_ARG(arg_set_id, 'len') AS len
 FROM
   counter AS c
-  LEFT JOIN
+LEFT JOIN
   counter_track AS t
   ON c.track_id = t.id
 WHERE
diff --git a/test/trace_processor/network/tcp_retransmit_skb_test.sql b/test/trace_processor/network/tcp_retransmit_skb_test.sql
index 44dacb3..57645cc 100644
--- a/test/trace_processor/network/tcp_retransmit_skb_test.sql
+++ b/test/trace_processor/network/tcp_retransmit_skb_test.sql
@@ -4,7 +4,7 @@
   dur
 FROM
   slice AS s
-  LEFT JOIN track AS t
+LEFT JOIN track AS t
   ON s.track_id = t.id
 WHERE
   t.name = "TCP Retransmit Skb"
diff --git a/test/trace_processor/parsing/android_log_counts_test.sql b/test/trace_processor/parsing/android_log_counts_test.sql
index 35a2a47..7ba0af4 100644
--- a/test/trace_processor/parsing/android_log_counts_test.sql
+++ b/test/trace_processor/parsing/android_log_counts_test.sql
@@ -13,10 +13,10 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select count(*) as cnt from android_logs union all
-select count(*) as cnt from android_logs where prio = 3 union all
-select count(*) as cnt from android_logs where prio > 4 union all
-select count(*) as cnt from android_logs where tag = 'screen_toggled' union all
-select count(*) as cnt from android_logs where tag GLOB '*_pss' union all
-select count(*) as cnt from android_logs where msg GLOB '*i2c?write*' or msg GLOB '*I2C?Write*' union all
-select count(*) as cnt from android_logs where ts >= 1510113924391 and ts < 1512610021879;
+SELECT count(*) AS cnt FROM android_logs UNION ALL
+SELECT count(*) AS cnt FROM android_logs WHERE prio = 3 UNION ALL
+SELECT count(*) AS cnt FROM android_logs WHERE prio > 4 UNION ALL
+SELECT count(*) AS cnt FROM android_logs WHERE tag = 'screen_toggled' UNION ALL
+SELECT count(*) AS cnt FROM android_logs WHERE tag GLOB '*_pss' UNION ALL
+SELECT count(*) AS cnt FROM android_logs WHERE msg GLOB '*i2c?write*' OR msg GLOB '*I2C?Write*' UNION ALL
+SELECT count(*) AS cnt FROM android_logs WHERE ts >= 1510113924391 AND ts < 1512610021879;
diff --git a/test/trace_processor/parsing/android_log_msgs_test.sql b/test/trace_processor/parsing/android_log_msgs_test.sql
index 1666095..fde19d7 100644
--- a/test/trace_processor/parsing/android_log_msgs_test.sql
+++ b/test/trace_processor/parsing/android_log_msgs_test.sql
@@ -13,22 +13,22 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create view v1 as select tag, count(*) from android_logs group by tag order by 2 desc limit 5;
+CREATE VIEW v1 AS SELECT tag, count(*) FROM android_logs GROUP BY tag ORDER BY 2 DESC LIMIT 5;
 
-create view v2 as select tag, count(*) from android_logs group by tag order by 2 asc limit 5;
+CREATE VIEW v2 AS SELECT tag, count(*) FROM android_logs GROUP BY tag ORDER BY 2 ASC LIMIT 5;
 
-create view v3 as
-select tag, count(*)
-from android_logs
-where msg GLOB '*wakelock*' or msg GLOB '*Wakelock*' or msg GLOB '*WakeLock*' or msg GLOB '*wakeLock*'
-group by tag;
+CREATE VIEW v3 AS
+SELECT tag, count(*)
+FROM android_logs
+WHERE msg GLOB '*wakelock*' OR msg GLOB '*Wakelock*' OR msg GLOB '*WakeLock*' OR msg GLOB '*wakeLock*'
+GROUP BY tag;
 
-create view v4 as select msg, 1 from android_logs limit 10;
+CREATE VIEW v4 AS SELECT msg, 1 FROM android_logs LIMIT 10;
 
-select * from v1 union all
-select '-----', 0 union all
-select * from v2 union all
-select '-----', 0 union all
-select * from v3 union all
-select '-----', 0 union all
-select * from v4;
+SELECT * FROM v1 UNION ALL
+SELECT '-----', 0 UNION ALL
+SELECT * FROM v2 UNION ALL
+SELECT '-----', 0 UNION ALL
+SELECT * FROM v3 UNION ALL
+SELECT '-----', 0 UNION ALL
+SELECT * FROM v4;
diff --git a/test/trace_processor/parsing/android_log_ring_buffer_mode_test.sql b/test/trace_processor/parsing/android_log_ring_buffer_mode_test.sql
index 2ce2bd1..a06af97 100644
--- a/test/trace_processor/parsing/android_log_ring_buffer_mode_test.sql
+++ b/test/trace_processor/parsing/android_log_ring_buffer_mode_test.sql
@@ -13,4 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select count(*) from android_logs;
+SELECT count(*) FROM android_logs;
diff --git a/test/trace_processor/parsing/args_string_filter_null_test.sql b/test/trace_processor/parsing/args_string_filter_null_test.sql
index c42e2f3..cb4657e 100644
--- a/test/trace_processor/parsing/args_string_filter_null_test.sql
+++ b/test/trace_processor/parsing/args_string_filter_null_test.sql
@@ -13,34 +13,36 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select string_value
-from args
-where string_value = NULL
+-- noqa: disable=L049
+SELECT string_value
+FROM args
+WHERE string_value = NULL  -- noqa
 UNION
-select string_value
-from args
-where string_value != NULL
+SELECT string_value
+FROM args
+WHERE string_value != NULL
 UNION
-select string_value
-from args
-where string_value < NULL
+SELECT string_value
+FROM args
+WHERE string_value < NULL
 UNION
-select string_value
-from args
-where string_value <= NULL
+SELECT string_value
+FROM args
+WHERE string_value <= NULL
 UNION
-select string_value
-from args
-where string_value > NULL
+SELECT string_value
+FROM args
+WHERE string_value > NULL
 UNION
-select string_value
-from args
-where string_value >= NULL
+SELECT string_value
+FROM args
+WHERE string_value >= NULL
 UNION
-select string_value
-from args
-where string_value GLOB NULL
+SELECT string_value
+FROM args
+WHERE string_value GLOB NULL
 UNION
-select string_value
-from args
-where string_value GLOB NULL
+SELECT string_value
+FROM args
+WHERE string_value GLOB NULL;
+-- noqa: enable=L049
diff --git a/test/trace_processor/parsing/args_string_is_not_null_test.sql b/test/trace_processor/parsing/args_string_is_not_null_test.sql
index 971f47d..836eb26 100644
--- a/test/trace_processor/parsing/args_string_is_not_null_test.sql
+++ b/test/trace_processor/parsing/args_string_is_not_null_test.sql
@@ -13,7 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select string_value
-from args
-where string_value IS NOT NULL
-limit 10
+SELECT string_value
+FROM args
+WHERE string_value IS NOT NULL
+LIMIT 10;
diff --git a/test/trace_processor/parsing/args_string_is_null_test.sql b/test/trace_processor/parsing/args_string_is_null_test.sql
index c1feb90..72c2204 100644
--- a/test/trace_processor/parsing/args_string_is_null_test.sql
+++ b/test/trace_processor/parsing/args_string_is_null_test.sql
@@ -13,7 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select string_value
-from args
-where string_value IS NULL
-limit 10
+SELECT string_value
+FROM args
+WHERE string_value IS NULL
+LIMIT 10;
diff --git a/test/trace_processor/parsing/b120487929_test.sql b/test/trace_processor/parsing/b120487929_test.sql
index a266d7a..c9fef00 100644
--- a/test/trace_processor/parsing/b120487929_test.sql
+++ b/test/trace_processor/parsing/b120487929_test.sql
@@ -13,59 +13,59 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create view freq_view as
-  select
-    ts,
-    lead(ts) OVER (PARTITION BY track_id ORDER BY ts) - ts as dur,
-    cpu,
-    name as freq_name,
-    value as freq_value
-  from counter
-  inner join cpu_counter_track
-    on counter.track_id = cpu_counter_track.id
-  where name = 'cpufreq';
+CREATE VIEW freq_view AS
+SELECT
+  ts,
+  lead(ts) OVER (PARTITION BY track_id ORDER BY ts) - ts AS dur,
+  cpu,
+  name AS freq_name,
+  value AS freq_value
+FROM counter
+INNER JOIN cpu_counter_track
+  ON counter.track_id = cpu_counter_track.id
+WHERE name = 'cpufreq';
 
-create view idle_view
-  as select
-    ts,
-    lead(ts) OVER (PARTITION BY track_id ORDER BY ts) - ts as dur,
-    cpu,
-    name as idle_name,
-    value as idle_value
-  from counter
-  inner join cpu_counter_track
-    on counter.track_id = cpu_counter_track.id
-  where name = 'cpuidle';
+CREATE VIEW idle_view
+AS SELECT
+  ts,
+  lead(ts) OVER (PARTITION BY track_id ORDER BY ts) - ts AS dur,
+  cpu,
+  name AS idle_name,
+  value AS idle_value
+FROM counter
+INNER JOIN cpu_counter_track
+  ON counter.track_id = cpu_counter_track.id
+WHERE name = 'cpuidle';
 
-create virtual table freq_idle
-  using span_join(freq_view PARTITIONED cpu, idle_view PARTITIONED cpu);
+CREATE VIRTUAL TABLE freq_idle
+USING span_join(freq_view PARTITIONED cpu, idle_view PARTITIONED cpu);
 
-create virtual table window_freq_idle using window;
+CREATE VIRTUAL TABLE window_freq_idle USING window;
 
-create virtual table span_freq_idle
-  using span_join(freq_idle PARTITIONED cpu, window_freq_idle);
+CREATE VIRTUAL TABLE span_freq_idle
+USING span_join(freq_idle PARTITIONED cpu, window_freq_idle);
 
-update window_freq_idle
-  set
-    window_start=(select min(ts) from sched),
-    window_dur=(select max(ts) - min(ts) from sched),
-    quantum=1000000
-  where rowid = 0;
+UPDATE window_freq_idle
+SET
+  window_start = (SELECT min(ts) FROM sched),
+  window_dur = (SELECT max(ts) - min(ts) FROM sched),
+  quantum = 1000000
+WHERE rowid = 0;
 
-create view counter_view
-  as select
-    ts,
-    dur,
-    quantum_ts,
-    cpu,
-    case idle_value
-      when 4294967295 then "freq"
-      else "idle"
-    end as name,
-    case idle_value
-      when 4294967295 then freq_value
-      else idle_value
-    end as value
-  from span_freq_idle;
+CREATE VIEW counter_view
+AS SELECT
+  ts,
+  dur,
+  quantum_ts,
+  cpu,
+  CASE idle_value
+    WHEN 4294967295 THEN "freq"
+    ELSE "idle"
+  END AS name,
+  CASE idle_value
+    WHEN 4294967295 THEN freq_value
+    ELSE idle_value
+  END AS value
+FROM span_freq_idle;
 
-select cpu, name, value, sum(dur) from counter_view group by cpu, name, value;
+SELECT cpu, name, value, sum(dur) FROM counter_view GROUP BY cpu, name, value;
diff --git a/test/trace_processor/parsing/b120605557_test.sql b/test/trace_processor/parsing/b120605557_test.sql
index 8af6cd9..38eabd8 100644
--- a/test/trace_processor/parsing/b120605557_test.sql
+++ b/test/trace_processor/parsing/b120605557_test.sql
@@ -13,6 +13,6 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select count(*)
-from counter
-inner join counter_track on counter_track.id = counter.track_id
+SELECT count(*)
+FROM counter
+INNER JOIN counter_track ON counter_track.id = counter.track_id;
diff --git a/test/trace_processor/parsing/chrome_metadata_test.sql b/test/trace_processor/parsing/chrome_metadata_test.sql
index 3521cf1..fe40b8a 100644
--- a/test/trace_processor/parsing/chrome_metadata_test.sql
+++ b/test/trace_processor/parsing/chrome_metadata_test.sql
@@ -1 +1 @@
-select * from metadata
+SELECT * FROM metadata;
diff --git a/test/trace_processor/parsing/end_reason_eq_test.sql b/test/trace_processor/parsing/end_reason_eq_test.sql
index e56f5ff..6940325 100644
--- a/test/trace_processor/parsing/end_reason_eq_test.sql
+++ b/test/trace_processor/parsing/end_reason_eq_test.sql
@@ -13,7 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select end_state, count(*)
-from sched
-where end_state = 'D'
-group by end_state
+SELECT end_state, count(*)
+FROM sched
+WHERE end_state = 'D'
+GROUP BY end_state;
diff --git a/test/trace_processor/parsing/end_reason_neq_test.sql b/test/trace_processor/parsing/end_reason_neq_test.sql
index 57e6092..0a2c40a 100644
--- a/test/trace_processor/parsing/end_reason_neq_test.sql
+++ b/test/trace_processor/parsing/end_reason_neq_test.sql
@@ -13,7 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select end_state, count(*)
-from sched
-where end_state != 'D'
-group by end_state
+SELECT end_state, count(*)
+FROM sched
+WHERE end_state != 'D'
+GROUP BY end_state;
diff --git a/test/trace_processor/parsing/flow_events_test.sql b/test/trace_processor/parsing/flow_events_test.sql
index 12e6318..4388b07 100644
--- a/test/trace_processor/parsing/flow_events_test.sql
+++ b/test/trace_processor/parsing/flow_events_test.sql
@@ -13,6 +13,6 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select t1.name as slice_out, t2.name as slice_in from flow t
-join slice t1 on t.slice_out = t1.slice_id
-join slice t2 on t.slice_in = t2.slice_id;
+SELECT t1.name AS slice_out, t2.name AS slice_in FROM flow t
+JOIN slice t1 ON t.slice_out = t1.slice_id
+JOIN slice t2 ON t.slice_in = t2.slice_id;
diff --git a/test/trace_processor/parsing/funcgraph_test.sql b/test/trace_processor/parsing/funcgraph_test.sql
index 301700f..e4b09e4 100644
--- a/test/trace_processor/parsing/funcgraph_test.sql
+++ b/test/trace_processor/parsing/funcgraph_test.sql
@@ -14,9 +14,8 @@
 -- limitations under the License.
 --
 
-select ts, dur, tid, s.name, depth
-from slices s
-join thread_track tt on (s.track_id = tt.id)
-join thread using (utid)
-where tid = 385482;
-
+SELECT ts, dur, tid, s.name, depth
+FROM slices s
+JOIN thread_track tt ON (s.track_id = tt.id)
+JOIN thread USING (utid)
+WHERE tid = 385482;
diff --git a/test/trace_processor/parsing/global_memory_counter_test.sql b/test/trace_processor/parsing/global_memory_counter_test.sql
index fdf24c2..3c03a6a 100644
--- a/test/trace_processor/parsing/global_memory_counter_test.sql
+++ b/test/trace_processor/parsing/global_memory_counter_test.sql
@@ -13,8 +13,8 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, value, name
-from counter
-inner join counter_track on counter.track_id = counter_track.id
-where name = 'MemAvailable' and counter_track.type = 'counter_track'
-limit 10
+SELECT ts, value, name
+FROM counter
+INNER JOIN counter_track ON counter.track_id = counter_track.id
+WHERE name = 'MemAvailable' AND counter_track.type = 'counter_track'
+LIMIT 10;
diff --git a/test/trace_processor/parsing/initial_display_state_test.sql b/test/trace_processor/parsing/initial_display_state_test.sql
index bec5a87..60cb398 100644
--- a/test/trace_processor/parsing/initial_display_state_test.sql
+++ b/test/trace_processor/parsing/initial_display_state_test.sql
@@ -2,5 +2,5 @@
        c.ts,
        c.value
 FROM counter_track t
-    JOIN counter c ON t.id = c.track_id
+JOIN counter c ON t.id = c.track_id
 WHERE t.name = 'ScreenState';
diff --git a/test/trace_processor/parsing/json_counters_test.sql b/test/trace_processor/parsing/json_counters_test.sql
index 604c2c1..76277fe 100644
--- a/test/trace_processor/parsing/json_counters_test.sql
+++ b/test/trace_processor/parsing/json_counters_test.sql
@@ -1,6 +1,6 @@
-select
+SELECT
   process_counter_track.name,
   counter.ts,
   counter.value
-from counter
-join process_counter_track on (counter.track_id = process_counter_track.id);
\ No newline at end of file
+FROM counter
+JOIN process_counter_track ON (counter.track_id = process_counter_track.id);
diff --git a/test/trace_processor/parsing/json_instants_test.sql b/test/trace_processor/parsing/json_instants_test.sql
index d76ef89..1bd78a5 100644
--- a/test/trace_processor/parsing/json_instants_test.sql
+++ b/test/trace_processor/parsing/json_instants_test.sql
@@ -1,12 +1,12 @@
-select
+SELECT
   slice.ts,
-  slice.name as slice_name,
+  slice.name AS slice_name,
   thread.tid,
   process.pid
-from slice
-join track on (slice.track_id = track.id)
-left join thread_track on (slice.track_id = thread_track.id)
-left join thread on (thread_track.utid = thread.utid)
-left join process_track on (slice.track_id = process_track.id)
-left join process on (process_track.upid = process.upid)
-where dur = 0;
\ No newline at end of file
+FROM slice
+JOIN track ON (slice.track_id = track.id)
+LEFT JOIN thread_track ON (slice.track_id = thread_track.id)
+LEFT JOIN thread ON (thread_track.utid = thread.utid)
+LEFT JOIN process_track ON (slice.track_id = process_track.id)
+LEFT JOIN process ON (process_track.upid = process.upid)
+WHERE dur = 0;
diff --git a/test/trace_processor/parsing/list_sched_slice_spans_test.sql b/test/trace_processor/parsing/list_sched_slice_spans_test.sql
index e5122e9..4b5307d 100644
--- a/test/trace_processor/parsing/list_sched_slice_spans_test.sql
+++ b/test/trace_processor/parsing/list_sched_slice_spans_test.sql
@@ -1,4 +1,4 @@
-select ts, dur, tid
-from sched
-join thread using(utid)
-order by ts
\ No newline at end of file
+SELECT ts, dur, tid
+FROM sched
+JOIN thread USING(utid)
+ORDER BY ts;
diff --git a/test/trace_processor/parsing/lmk_test.sql b/test/trace_processor/parsing/lmk_test.sql
index 5b913b3..c0ca207 100644
--- a/test/trace_processor/parsing/lmk_test.sql
+++ b/test/trace_processor/parsing/lmk_test.sql
@@ -16,4 +16,4 @@
 SELECT ts, process.pid
 FROM instant
 JOIN process_track ON instant.track_id = process_track.id
-JOIN process USING (upid);
\ No newline at end of file
+JOIN process USING (upid);
diff --git a/test/trace_processor/parsing/metadata_test.sql b/test/trace_processor/parsing/metadata_test.sql
index 3943251..aa05ab7 100644
--- a/test/trace_processor/parsing/metadata_test.sql
+++ b/test/trace_processor/parsing/metadata_test.sql
@@ -13,4 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select name, str_value from metadata where str_value is not null order by name;
+SELECT name, str_value FROM metadata WHERE str_value IS NOT NULL ORDER BY name;
diff --git a/test/trace_processor/parsing/mm_event_test.sql b/test/trace_processor/parsing/mm_event_test.sql
index d1209c3..595d239 100644
--- a/test/trace_processor/parsing/mm_event_test.sql
+++ b/test/trace_processor/parsing/mm_event_test.sql
@@ -13,10 +13,10 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, name, value
-from counter
-inner join counter_track
-  on counter.track_id = counter_track.id
-where name glob 'mem.mm.*'
-order by ts
-limit 40
+SELECT ts, name, value
+FROM counter
+INNER JOIN counter_track
+  ON counter.track_id = counter_track.id
+WHERE name GLOB 'mem.mm.*'
+ORDER BY ts
+LIMIT 40;
diff --git a/test/trace_processor/parsing/oom_query_test.sql b/test/trace_processor/parsing/oom_query_test.sql
index 68c19ac..6e3de63 100644
--- a/test/trace_processor/parsing/oom_query_test.sql
+++ b/test/trace_processor/parsing/oom_query_test.sql
@@ -16,7 +16,7 @@
 /* Create the file RSS table. */
 CREATE VIEW file_rss AS
 SELECT ts,
-       LEAD(ts, 1, ts) OVER(PARTITION BY track_id ORDER BY ts) - ts as dur,
+       LEAD(ts, 1, ts) OVER(PARTITION BY track_id ORDER BY ts) - ts AS dur,
        upid,
        value AS file
 FROM counter
@@ -25,26 +25,26 @@
 WHERE process_counter_track.name IN ("mem.rss.file", "rss_stat.mm_filepages");
 
 /* Create the anon RSS table. */
-create view anon_rss as
-select ts,
-       LEAD(ts, 1, ts) OVER(PARTITION BY track_id ORDER BY ts) - ts as dur,
+CREATE VIEW anon_rss AS
+SELECT ts,
+       LEAD(ts, 1, ts) OVER(PARTITION BY track_id ORDER BY ts) - ts AS dur,
        upid,
-       value as anon
+       value AS anon
 FROM counter
 JOIN process_counter_track
   ON counter.track_id = process_counter_track.id
-where process_counter_track.name in ("mem.rss.anon", "rss_stat.mm_anonpages");
+WHERE process_counter_track.name IN ("mem.rss.anon", "rss_stat.mm_anonpages");
 
 /* Create the oom adj table. */
-create view oom_adj as
-select ts,
-       LEAD(ts, 1, ts) OVER(PARTITION BY track_id ORDER BY ts) - ts as dur,
+CREATE VIEW oom_adj AS
+SELECT ts,
+       LEAD(ts, 1, ts) OVER(PARTITION BY track_id ORDER BY ts) - ts AS dur,
        upid,
-       value as oom_score_adj
+       value AS oom_score_adj
 FROM counter
 JOIN process_counter_track
   ON counter.track_id = process_counter_track.id
-where process_counter_track.name = 'oom_score_adj';
+WHERE process_counter_track.name = 'oom_score_adj';
 
 /* Harmonise the three tables above into a single table. */
 CREATE VIRTUAL TABLE anon_file USING span_join(anon_rss PARTITIONED upid, file_rss PARTITIONED upid);
@@ -56,12 +56,12 @@
 SELECT ts,
        dur,
        upid,
-       CASE WHEN oom_score_adj < 0 THEN file + anon ELSE 0 END as rss_oom_lt_zero,
-       CASE WHEN oom_score_adj <= 0 THEN file + anon ELSE 0 END as rss_oom_eq_zero,
-       CASE WHEN oom_score_adj < 20 THEN file + anon ELSE 0 END as rss_fg,
-       CASE WHEN oom_score_adj < 700 THEN file + anon ELSE 0 END as rss_bg,
-       CASE WHEN oom_score_adj < 900 THEN file + anon ELSE 0 END as rss_low_bg,
-       file + anon as rss_cached
+       CASE WHEN oom_score_adj < 0 THEN file + anon ELSE 0 END AS rss_oom_lt_zero,
+       CASE WHEN oom_score_adj <= 0 THEN file + anon ELSE 0 END AS rss_oom_eq_zero,
+       CASE WHEN oom_score_adj < 20 THEN file + anon ELSE 0 END AS rss_fg,
+       CASE WHEN oom_score_adj < 700 THEN file + anon ELSE 0 END AS rss_bg,
+       CASE WHEN oom_score_adj < 900 THEN file + anon ELSE 0 END AS rss_low_bg,
+       file + anon AS rss_cached
 FROM anon_file_oom;
 
 /* Convert the raw RSS values to the change in RSS (for a given upid) over time */
@@ -69,37 +69,37 @@
 SELECT ts,
        dur,
        upid,
-       rss_oom_lt_zero - lag(rss_oom_lt_zero, 1, 0) OVER win as rss_oom_lt_zero_diff,
-       rss_oom_eq_zero - lag(rss_oom_eq_zero, 1, 0) OVER win as rss_oom_eq_zero_diff,
-       rss_fg - lag(rss_fg, 1, 0) OVER win as rss_fg_diff,
-       rss_bg - lag(rss_bg, 1, 0) OVER win as rss_bg_diff,
-       rss_low_bg - lag(rss_low_bg, 1, 0) OVER win as rss_low_bg_diff,
-       rss_cached - lag(rss_cached, 1, 0) OVER win as rss_cached_diff
+       rss_oom_lt_zero - lag(rss_oom_lt_zero, 1, 0) OVER win AS rss_oom_lt_zero_diff,
+       rss_oom_eq_zero - lag(rss_oom_eq_zero, 1, 0) OVER win AS rss_oom_eq_zero_diff,
+       rss_fg - lag(rss_fg, 1, 0) OVER win AS rss_fg_diff,
+       rss_bg - lag(rss_bg, 1, 0) OVER win AS rss_bg_diff,
+       rss_low_bg - lag(rss_low_bg, 1, 0) OVER win AS rss_low_bg_diff,
+       rss_cached - lag(rss_cached, 1, 0) OVER win AS rss_cached_diff
 FROM rss_spans_for_oom_upid
 WINDOW win AS (PARTITION BY upid ORDER BY ts);
 
 /*
- * Compute a rolling sum of anon + file for each category of process state.
- * (note: we no longer consider upid in the windows which means we are now
- * computing a rolling sum for all the processes).
- */
+* Compute a rolling sum of anon + file for each category of process state.
+* (note: we no longer consider upid in the windows which means we are now
+* computing a rolling sum for all the processes).
+*/
 CREATE VIEW output AS
 SELECT ts,
-       lead(ts, 1, ts + dur) over win - ts as dur,
-       SUM(rss_oom_lt_zero_diff) OVER win as rss_oom_lt_zero,
-       SUM(rss_oom_eq_zero_diff) OVER win as rss_oom_eq_zero,
-       SUM(rss_fg_diff) OVER win as rss_fg,
-       SUM(rss_bg_diff) OVER win as rss_bg,
-       SUM(rss_low_bg_diff) OVER win as rss_low_bg,
-       SUM(rss_cached_diff) OVER win as rss_cached
+       lead(ts, 1, ts + dur) OVER win - ts AS dur,
+       SUM(rss_oom_lt_zero_diff) OVER win AS rss_oom_lt_zero,
+       SUM(rss_oom_eq_zero_diff) OVER win AS rss_oom_eq_zero,
+       SUM(rss_fg_diff) OVER win AS rss_fg,
+       SUM(rss_bg_diff) OVER win AS rss_bg,
+       SUM(rss_low_bg_diff) OVER win AS rss_low_bg,
+       SUM(rss_cached_diff) OVER win AS rss_cached
 FROM rss_spans_rss_change
-WINDOW win as (ORDER BY ts)
+WINDOW win AS (ORDER BY ts)
 ORDER BY ts;
 
 /*
- * Print out the final result (note: dur = 0 is excluded to account for times
- * where multiple processes report a new memory value at the same timestamp)
- */
+* Print out the final result (note: dur = 0 is excluded to account for times
+* where multiple processes report a new memory value at the same timestamp)
+*/
 SELECT *
 FROM output
-WHERE dur > 0
+WHERE dur > 0;
diff --git a/test/trace_processor/parsing/oom_score_poll_test.sql b/test/trace_processor/parsing/oom_score_poll_test.sql
index f22624b..5f97012 100644
--- a/test/trace_processor/parsing/oom_score_poll_test.sql
+++ b/test/trace_processor/parsing/oom_score_poll_test.sql
@@ -13,10 +13,10 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, name, value, upid
-from counter c
-join process_counter_track t
-  on c.track_id = t.id
-where name = "oom_score_adj"
-order by ts
-limit 20
+SELECT ts, name, value, upid
+FROM counter c
+JOIN process_counter_track t
+  ON c.track_id = t.id
+WHERE name = "oom_score_adj"
+ORDER BY ts
+LIMIT 20;
diff --git a/test/trace_processor/parsing/print_systrace_test.sql b/test/trace_processor/parsing/print_systrace_test.sql
index 7e834eb..9e865e2 100644
--- a/test/trace_processor/parsing/print_systrace_test.sql
+++ b/test/trace_processor/parsing/print_systrace_test.sql
@@ -14,4 +14,4 @@
 -- limitations under the License.
 --
 SELECT to_ftrace(id)
-from raw;
+FROM raw;
diff --git a/test/trace_processor/parsing/process_counter_and_track_test.sql b/test/trace_processor/parsing/process_counter_and_track_test.sql
index eaa29ec..0299110 100644
--- a/test/trace_processor/parsing/process_counter_and_track_test.sql
+++ b/test/trace_processor/parsing/process_counter_and_track_test.sql
@@ -1,5 +1,5 @@
-select ts, pct.name, value, pid
-from counter c
-join process_counter_track pct on c.track_id = pct.id
-join process using (upid)
-order by ts;
+SELECT ts, pct.name, value, pid
+FROM counter c
+JOIN process_counter_track pct ON c.track_id = pct.id
+JOIN process USING (upid)
+ORDER BY ts;
diff --git a/test/trace_processor/parsing/rss_stat_after_free_test.sql b/test/trace_processor/parsing/rss_stat_after_free_test.sql
index d31fab7..d07903c 100644
--- a/test/trace_processor/parsing/rss_stat_after_free_test.sql
+++ b/test/trace_processor/parsing/rss_stat_after_free_test.sql
@@ -1,8 +1,8 @@
-select
+SELECT
   pid,
-  max(c.ts) as last_rss,
-  p.end_ts as process_end
-from counter c
-join process_counter_track t on c.track_id = t.id
-join process p using(upid)
-group by upid
\ No newline at end of file
+  max(c.ts) AS last_rss,
+  p.end_ts AS process_end
+FROM counter c
+JOIN process_counter_track t ON c.track_id = t.id
+JOIN process p USING(upid)
+GROUP BY upid;
diff --git a/test/trace_processor/parsing/rss_stat_test.sql b/test/trace_processor/parsing/rss_stat_test.sql
index 0458f0a..52d2b0b 100644
--- a/test/trace_processor/parsing/rss_stat_test.sql
+++ b/test/trace_processor/parsing/rss_stat_test.sql
@@ -2,4 +2,4 @@
 FROM counter c
 JOIN process_counter_track t ON c.track_id = t.id
 JOIN process p USING (upid)
-ORDER BY ts, pid
+ORDER BY ts, pid;
diff --git a/test/trace_processor/parsing/sched_blocked_reason_function_test.sql b/test/trace_processor/parsing/sched_blocked_reason_function_test.sql
index ffa1e10..ea64ac0 100644
--- a/test/trace_processor/parsing/sched_blocked_reason_function_test.sql
+++ b/test/trace_processor/parsing/sched_blocked_reason_function_test.sql
@@ -1,8 +1,8 @@
-select
+SELECT
   ts,
-  thread.tid as pid,
-  blocked_function as func
-from thread_state
-join thread USING (utid)
-where state = 'D'
-order by ts
+  thread.tid AS pid,
+  blocked_function AS func
+FROM thread_state
+JOIN thread USING (utid)
+WHERE state = 'D'
+ORDER BY ts;
diff --git a/test/trace_processor/parsing/sched_blocked_reason_test.sql b/test/trace_processor/parsing/sched_blocked_reason_test.sql
index 1761c97..48ca4f3 100644
--- a/test/trace_processor/parsing/sched_blocked_reason_test.sql
+++ b/test/trace_processor/parsing/sched_blocked_reason_test.sql
@@ -1,5 +1,5 @@
-select ts, tid, io_wait
-from thread_state
-join thread using (utid)
-where state = 'D'
-order by ts
+SELECT ts, tid, io_wait
+FROM thread_state
+JOIN thread USING (utid)
+WHERE state = 'D'
+ORDER BY ts;
diff --git a/test/trace_processor/parsing/sched_smoke_test.sql b/test/trace_processor/parsing/sched_smoke_test.sql
index 14b26f5..21952b1 100644
--- a/test/trace_processor/parsing/sched_smoke_test.sql
+++ b/test/trace_processor/parsing/sched_smoke_test.sql
@@ -1,2 +1,2 @@
 SELECT COUNT(1)
-FROM sched
\ No newline at end of file
+FROM sched;
diff --git a/test/trace_processor/parsing/sched_waking_instants_test.sql b/test/trace_processor/parsing/sched_waking_instants_test.sql
index 9b5606b..e3a1d30 100644
--- a/test/trace_processor/parsing/sched_waking_instants_test.sql
+++ b/test/trace_processor/parsing/sched_waking_instants_test.sql
@@ -17,4 +17,4 @@
 FROM thread_state
 JOIN thread USING (utid)
 WHERE state = 'R'
-ORDER BY ts
+ORDER BY ts;
diff --git a/test/trace_processor/parsing/slices_test.sql b/test/trace_processor/parsing/slices_test.sql
index d41bd3b..7efc393 100644
--- a/test/trace_processor/parsing/slices_test.sql
+++ b/test/trace_processor/parsing/slices_test.sql
@@ -13,5 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, dur, name from slice order by ts desc;
-
+SELECT ts, dur, name FROM slice ORDER BY ts DESC;
diff --git a/test/trace_processor/parsing/stats_test.sql b/test/trace_processor/parsing/stats_test.sql
index 02316b2..ce0cc27 100644
--- a/test/trace_processor/parsing/stats_test.sql
+++ b/test/trace_processor/parsing/stats_test.sql
@@ -13,5 +13,5 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select name, idx, severity, source, value
-from stats where name GLOB 'ftrace_cpu_*' or name GLOB 'traced_buf_*';
\ No newline at end of file
+SELECT name, idx, severity, source, value
+FROM stats WHERE name GLOB 'ftrace_cpu_*' OR name GLOB 'traced_buf_*';
diff --git a/test/trace_processor/parsing/sys_test.sql b/test/trace_processor/parsing/sys_test.sql
index 7d42be3..ad317a1 100644
--- a/test/trace_processor/parsing/sys_test.sql
+++ b/test/trace_processor/parsing/sys_test.sql
@@ -13,6 +13,6 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, dur, name
-from slices
-limit 10
+SELECT ts, dur, name
+FROM slices
+LIMIT 10;
diff --git a/test/trace_processor/parsing/systrace_html_test.sql b/test/trace_processor/parsing/systrace_html_test.sql
index e94b82a..b5aebdd 100644
--- a/test/trace_processor/parsing/systrace_html_test.sql
+++ b/test/trace_processor/parsing/systrace_html_test.sql
@@ -13,7 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, cpu, dur, ts_end, utid, end_state, priority, upid, name, tid
-from sched
-join thread using(utid)
-order by ts;
+SELECT ts, cpu, dur, ts_end, utid, end_state, priority, upid, name, tid
+FROM sched
+JOIN thread USING(utid)
+ORDER BY ts;
diff --git a/test/trace_processor/parsing/thread_counter_and_track_test.sql b/test/trace_processor/parsing/thread_counter_and_track_test.sql
index 24f3d81..197c704 100644
--- a/test/trace_processor/parsing/thread_counter_and_track_test.sql
+++ b/test/trace_processor/parsing/thread_counter_and_track_test.sql
@@ -1,5 +1,5 @@
-select ts, t.name, value, tid
-from counter c
-join thread_counter_track t on c.track_id = t.id
-join thread using (utid)
-order by ts;
\ No newline at end of file
+SELECT ts, t.name, value, tid
+FROM counter c
+JOIN thread_counter_track t ON c.track_id = t.id
+JOIN thread USING (utid)
+ORDER BY ts;
diff --git a/test/trace_processor/parsing/trace_size_test.sql b/test/trace_processor/parsing/trace_size_test.sql
index 01704a2..58c266f 100644
--- a/test/trace_processor/parsing/trace_size_test.sql
+++ b/test/trace_processor/parsing/trace_size_test.sql
@@ -13,4 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select int_value from metadata where name = 'trace_size_bytes';
+SELECT int_value FROM metadata WHERE name = 'trace_size_bytes';
diff --git a/test/trace_processor/parsing/triggers_packets_test.sql b/test/trace_processor/parsing/triggers_packets_test.sql
index 89d5cdb..a67f265 100644
--- a/test/trace_processor/parsing/triggers_packets_test.sql
+++ b/test/trace_processor/parsing/triggers_packets_test.sql
@@ -39,7 +39,7 @@
   FROM args
   WHERE key = "trusted_producer_uid"
 ) prod_uid ON prod_uid.arg_set_id = slice_prod.arg_set_id
-WHERE slice_prod.track_id in (
+WHERE slice_prod.track_id IN (
   SELECT id FROM track WHERE name = "Trace Triggers"
 )
 ORDER BY ts ASC;
diff --git a/test/trace_processor/parsing/ts_desc_filter_test.sql b/test/trace_processor/parsing/ts_desc_filter_test.sql
index 6f49a98..84384ff 100644
--- a/test/trace_processor/parsing/ts_desc_filter_test.sql
+++ b/test/trace_processor/parsing/ts_desc_filter_test.sql
@@ -13,9 +13,9 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts
-from sched
-inner join thread using(utid)
-where tid = 23850
-order by ts desc
-limit 10
+SELECT ts
+FROM sched
+INNER JOIN thread USING(utid)
+WHERE tid = 23850
+ORDER BY ts DESC
+LIMIT 10;
diff --git a/test/trace_processor/performance/cpu_frequency_limits_test.sql b/test/trace_processor/performance/cpu_frequency_limits_test.sql
index 06e1852..ee47a23 100644
--- a/test/trace_processor/performance/cpu_frequency_limits_test.sql
+++ b/test/trace_processor/performance/cpu_frequency_limits_test.sql
@@ -1,10 +1,10 @@
 SELECT
   ts,
-  value, 
+  value,
   REPLACE(name, " Freq Limit", "") AS cpu
 FROM
   counter AS c
-  LEFT JOIN
+LEFT JOIN
   counter_track AS t
   ON c.track_id = t.id
 WHERE
diff --git a/test/trace_processor/power/energy_breakdown_event_test.sql b/test/trace_processor/power/energy_breakdown_event_test.sql
index 224a452..c6fbece 100644
--- a/test/trace_processor/power/energy_breakdown_event_test.sql
+++ b/test/trace_processor/power/energy_breakdown_event_test.sql
@@ -1,4 +1,4 @@
 SELECT ts, value
 FROM counter
 JOIN energy_counter_track ON counter.track_id = energy_counter_track.id
-ORDER BY ts
+ORDER BY ts;
diff --git a/test/trace_processor/power/energy_breakdown_table_test.sql b/test/trace_processor/power/energy_breakdown_table_test.sql
index c767069..e04606f 100644
--- a/test/trace_processor/power/energy_breakdown_table_test.sql
+++ b/test/trace_processor/power/energy_breakdown_table_test.sql
@@ -1,2 +1,2 @@
 SELECT consumer_id, name, consumer_type, ordinal
-FROM energy_counter_track
\ No newline at end of file
+FROM energy_counter_track;
diff --git a/test/trace_processor/power/energy_breakdown_uid_event_test.sql b/test/trace_processor/power/energy_breakdown_uid_event_test.sql
index 3dbab24..7217efa 100644
--- a/test/trace_processor/power/energy_breakdown_uid_event_test.sql
+++ b/test/trace_processor/power/energy_breakdown_uid_event_test.sql
@@ -1,4 +1,4 @@
 SELECT ts, value
 FROM counter
 JOIN uid_counter_track ON counter.track_id = uid_counter_track.id
-ORDER BY ts
+ORDER BY ts;
diff --git a/test/trace_processor/power/energy_breakdown_uid_table_test.sql b/test/trace_processor/power/energy_breakdown_uid_table_test.sql
index 64192f1..bf0c7ed 100644
--- a/test/trace_processor/power/energy_breakdown_uid_table_test.sql
+++ b/test/trace_processor/power/energy_breakdown_uid_table_test.sql
@@ -1,2 +1,2 @@
 SELECT uid, name
-FROM uid_counter_track
\ No newline at end of file
+FROM uid_counter_track;
diff --git a/test/trace_processor/power/energy_per_uid_table_test.sql b/test/trace_processor/power/energy_per_uid_table_test.sql
index 5f207d3..a5e03b8 100644
--- a/test/trace_processor/power/energy_per_uid_table_test.sql
+++ b/test/trace_processor/power/energy_per_uid_table_test.sql
@@ -1,2 +1,2 @@
 SELECT consumer_id, uid
-FROM energy_per_uid_counter_track
\ No newline at end of file
+FROM energy_per_uid_counter_track;
diff --git a/test/trace_processor/power/p_state_test.sql b/test/trace_processor/power/p_state_test.sql
index 509e932..45f2338 100644
--- a/test/trace_processor/power/p_state_test.sql
+++ b/test/trace_processor/power/p_state_test.sql
@@ -1,3 +1,3 @@
 SELECT RUN_METRIC("android/p_state.sql");
 
-SELECT * FROM P_STATE_OVER_INTERVAL(2579596465618, 2579606465618);
\ No newline at end of file
+SELECT * FROM P_STATE_OVER_INTERVAL(2579596465618, 2579606465618);
diff --git a/test/trace_processor/power/power_rails_event_test.sql b/test/trace_processor/power/power_rails_event_test.sql
index ca04ce2..a5cca33 100644
--- a/test/trace_processor/power/power_rails_event_test.sql
+++ b/test/trace_processor/power/power_rails_event_test.sql
@@ -13,7 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, value
-from counters
-where name GLOB "power.*"
-limit 20
+SELECT ts, value
+FROM counters
+WHERE name GLOB "power.*"
+LIMIT 20;
diff --git a/test/trace_processor/power/power_rails_test.sql b/test/trace_processor/power/power_rails_test.sql
index 31af227..de4ef4e 100644
--- a/test/trace_processor/power/power_rails_test.sql
+++ b/test/trace_processor/power/power_rails_test.sql
@@ -13,8 +13,8 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select name, AVG(value), COUNT(*)
-from counters
-where name GLOB "power.*"
-group by name
-limit 20
\ No newline at end of file
+SELECT name, AVG(value), COUNT(*)
+FROM counters
+WHERE name GLOB "power.*"
+GROUP BY name
+LIMIT 20;
diff --git a/test/trace_processor/power/power_rails_timestamp_sort_test.sql b/test/trace_processor/power/power_rails_timestamp_sort_test.sql
index aeb452e..df0182a 100644
--- a/test/trace_processor/power/power_rails_timestamp_sort_test.sql
+++ b/test/trace_processor/power/power_rails_timestamp_sort_test.sql
@@ -13,7 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, value, t.name as name
-from counter c inner join counter_track t on t.id = c.track_id
-order by ts
-limit 20
+SELECT ts, value, t.name AS name
+FROM counter c INNER JOIN counter_track t ON t.id = c.track_id
+ORDER BY ts
+LIMIT 20;
diff --git a/test/trace_processor/power/suspend_resume_test.sql b/test/trace_processor/power/suspend_resume_test.sql
index 30f4542..46170e6 100644
--- a/test/trace_processor/power/suspend_resume_test.sql
+++ b/test/trace_processor/power/suspend_resume_test.sql
@@ -4,7 +4,7 @@
   s.name AS action
 FROM
   slice AS s
-  JOIN
+JOIN
   track AS t
   ON s.track_id = t.id
 WHERE
diff --git a/test/trace_processor/power/wakesource_test.sql b/test/trace_processor/power/wakesource_test.sql
index 8497e87..08d7b34 100644
--- a/test/trace_processor/power/wakesource_test.sql
+++ b/test/trace_processor/power/wakesource_test.sql
@@ -1,5 +1,5 @@
 SELECT ts, dur, slice.name
 FROM slice
-JOIN track on slice.track_id = track.id
+JOIN track ON slice.track_id = track.id
 WHERE track.name GLOB 'Wakelock*'
-ORDER BY ts
+ORDER BY ts;
diff --git a/test/trace_processor/process_tracking/process_parent_pid_test.sql b/test/trace_processor/process_tracking/process_parent_pid_test.sql
index a836c92..dcc4cbe 100644
--- a/test/trace_processor/process_tracking/process_parent_pid_test.sql
+++ b/test/trace_processor/process_tracking/process_parent_pid_test.sql
@@ -14,9 +14,9 @@
 -- limitations under the License.
 --
 SELECT
-  child.pid as child_pid,
-  parent.pid as parent_pid
-FROM process as child
-INNER JOIN process as parent
-ON child.parent_upid = parent.upid
-ORDER BY child_pid
+  child.pid AS child_pid,
+  parent.pid AS parent_pid
+FROM process AS child
+INNER JOIN process AS parent
+  ON child.parent_upid = parent.upid
+ORDER BY child_pid;
diff --git a/test/trace_processor/process_tracking/process_tracking_uid_test.sql b/test/trace_processor/process_tracking/process_tracking_uid_test.sql
index fcc590b..7087424 100644
--- a/test/trace_processor/process_tracking/process_tracking_uid_test.sql
+++ b/test/trace_processor/process_tracking/process_tracking_uid_test.sql
@@ -13,6 +13,6 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select pid, uid
-from process
-order by pid;
+SELECT pid, uid
+FROM process
+ORDER BY pid;
diff --git a/test/trace_processor/process_tracking/slice_with_pid_test.sql b/test/trace_processor/process_tracking/slice_with_pid_test.sql
index c0ea0d2..9c3aef6 100644
--- a/test/trace_processor/process_tracking/slice_with_pid_test.sql
+++ b/test/trace_processor/process_tracking/slice_with_pid_test.sql
@@ -1,5 +1,5 @@
-select s.name, dur, tid, pid
-from slice s
-join thread_track t on s.track_id = t.id
-join thread using(utid)
-left join process using(upid);
\ No newline at end of file
+SELECT s.name, dur, tid, pid
+FROM slice s
+JOIN thread_track t ON s.track_id = t.id
+JOIN thread USING(utid)
+LEFT JOIN process USING(upid);
diff --git a/test/trace_processor/profiling/callstack_sampling_flamegraph_multi_process_test.sql b/test/trace_processor/profiling/callstack_sampling_flamegraph_multi_process_test.sql
index 4dff21d..acf48ed 100644
--- a/test/trace_processor/profiling/callstack_sampling_flamegraph_multi_process_test.sql
+++ b/test/trace_processor/profiling/callstack_sampling_flamegraph_multi_process_test.sql
@@ -1,26 +1,26 @@
-select count(*) as count, 'BothProcesses' as description
-from experimental_flamegraph
-where
+SELECT count(*) AS count, 'BothProcesses' AS description
+FROM experimental_flamegraph
+WHERE
   upid_group = (
-    select group_concat(distinct upid)
-    from perf_sample join thread t using (utid) join process p using (upid)
+    SELECT group_concat(DISTINCT upid)
+    FROM perf_sample JOIN thread t USING (utid) JOIN process p USING (upid)
   )
-  and profile_type = 'perf'
-  and ts <= 7689491063351
-  and size > 0
-union all
-select count(*) as count, 'FirstProcess' as description
-from experimental_flamegraph
-  join process using (upid)
-where pid = 1728
-  and profile_type = 'perf'
-  and ts <= 7689491063351
-  and size > 0
-union all
-select count(*) as count, 'SecondProcess' as description
-from experimental_flamegraph
-  join process using (upid)
-where pid = 703
-  and profile_type = 'perf'
-  and ts <= 7689491063351
-  and size > 0;
+  AND profile_type = 'perf'
+  AND ts <= 7689491063351
+  AND size > 0
+UNION ALL
+SELECT count(*) AS count, 'FirstProcess' AS description
+FROM experimental_flamegraph
+JOIN process USING (upid)
+WHERE pid = 1728
+  AND profile_type = 'perf'
+  AND ts <= 7689491063351
+  AND size > 0
+UNION ALL
+SELECT count(*) AS count, 'SecondProcess' AS description
+FROM experimental_flamegraph
+JOIN process USING (upid)
+WHERE pid = 703
+  AND profile_type = 'perf'
+  AND ts <= 7689491063351
+  AND size > 0;
diff --git a/test/trace_processor/profiling/callstack_sampling_flamegraph_test.sql b/test/trace_processor/profiling/callstack_sampling_flamegraph_test.sql
index 1ed2717..54d33ae 100644
--- a/test/trace_processor/profiling/callstack_sampling_flamegraph_test.sql
+++ b/test/trace_processor/profiling/callstack_sampling_flamegraph_test.sql
@@ -1,7 +1,7 @@
-select ef.*
-from experimental_flamegraph ef
-  join process using (upid)
-where pid = 1728
-  and profile_type = 'perf'
-  and ts <= 7689491063351
-limit 10;
+SELECT ef.*
+FROM experimental_flamegraph ef
+JOIN process USING (upid)
+WHERE pid = 1728
+  AND profile_type = 'perf'
+  AND ts <= 7689491063351
+LIMIT 10;
diff --git a/test/trace_processor/profiling/heap_graph_flamegraph_focused_test.sql b/test/trace_processor/profiling/heap_graph_flamegraph_focused_test.sql
index e6b514c..086a587 100644
--- a/test/trace_processor/profiling/heap_graph_flamegraph_focused_test.sql
+++ b/test/trace_processor/profiling/heap_graph_flamegraph_focused_test.sql
@@ -8,8 +8,8 @@
   cumulative_size,
   parent_id
 FROM experimental_flamegraph
-where upid = (select max(upid) from heap_graph_object)
-  and profile_type = 'graph'
-  and ts = (select max(graph_sample_ts) from heap_graph_object)
-  and focus_str = 'left'
-LIMIT 10
+WHERE upid = (SELECT max(upid) FROM heap_graph_object)
+  AND profile_type = 'graph'
+  AND ts = (SELECT max(graph_sample_ts) FROM heap_graph_object)
+  AND focus_str = 'left'
+LIMIT 10;
diff --git a/test/trace_processor/profiling/heap_graph_flamegraph_matches_objects_test.sql b/test/trace_processor/profiling/heap_graph_flamegraph_matches_objects_test.sql
index 59674af..42e5214 100644
--- a/test/trace_processor/profiling/heap_graph_flamegraph_matches_objects_test.sql
+++ b/test/trace_processor/profiling/heap_graph_flamegraph_matches_objects_test.sql
@@ -20,4 +20,4 @@
   heap_graph_object AS obj
 WHERE
   obj.reachable != 0
-GROUP BY obj.upid, obj.graph_sample_ts
+GROUP BY obj.upid, obj.graph_sample_ts;
diff --git a/test/trace_processor/profiling/heap_graph_flamegraph_test.sql b/test/trace_processor/profiling/heap_graph_flamegraph_test.sql
index 34692ef..0b3033f 100644
--- a/test/trace_processor/profiling/heap_graph_flamegraph_test.sql
+++ b/test/trace_processor/profiling/heap_graph_flamegraph_test.sql
@@ -9,7 +9,7 @@
   cumulative_size,
   parent_id
 FROM experimental_flamegraph
-where upid = (select max(upid) from heap_graph_object)
-  and profile_type = 'graph'
-  and ts = (select max(graph_sample_ts) from heap_graph_object)
-LIMIT 10
+WHERE upid = (SELECT max(upid) FROM heap_graph_object)
+  AND profile_type = 'graph'
+  AND ts = (SELECT max(graph_sample_ts) FROM heap_graph_object)
+LIMIT 10;
diff --git a/test/trace_processor/profiling/heap_graph_native_size_test.sql b/test/trace_processor/profiling/heap_graph_native_size_test.sql
index fcef1f6..1b6b061 100644
--- a/test/trace_processor/profiling/heap_graph_native_size_test.sql
+++ b/test/trace_processor/profiling/heap_graph_native_size_test.sql
@@ -13,7 +13,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select c.name as type_name,
+SELECT c.name AS type_name,
        o.native_size
-from heap_graph_object o join heap_graph_class c on o.type_id = c.id
-where o.root_type = "ROOT_JAVA_FRAME"
+FROM heap_graph_object o JOIN heap_graph_class c ON o.type_id = c.id
+WHERE o.root_type = "ROOT_JAVA_FRAME";
diff --git a/test/trace_processor/profiling/heap_graph_object_test.sql b/test/trace_processor/profiling/heap_graph_object_test.sql
index b7ad1b1..7267f3c 100644
--- a/test/trace_processor/profiling/heap_graph_object_test.sql
+++ b/test/trace_processor/profiling/heap_graph_object_test.sql
@@ -13,14 +13,14 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select o.id,
+SELECT o.id,
        o.type,
        o.upid,
        o.graph_sample_ts,
        o.self_size,
        o.reference_set_id,
        o.reachable,
-       c.name as type_name,
-       c.deobfuscated_name as deobfuscated_type_name,
+       c.name AS type_name,
+       c.deobfuscated_name AS deobfuscated_type_name,
        o.root_type
-from heap_graph_object o join heap_graph_class c on o.type_id = c.id
+FROM heap_graph_object o JOIN heap_graph_class c ON o.type_id = c.id;
diff --git a/test/trace_processor/profiling/heap_graph_reference_test.sql b/test/trace_processor/profiling/heap_graph_reference_test.sql
index f3b6894..5563758 100644
--- a/test/trace_processor/profiling/heap_graph_reference_test.sql
+++ b/test/trace_processor/profiling/heap_graph_reference_test.sql
@@ -13,4 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select * from heap_graph_reference
+SELECT * FROM heap_graph_reference;
diff --git a/test/trace_processor/profiling/heap_graph_superclass_test.sql b/test/trace_processor/profiling/heap_graph_superclass_test.sql
index 6526d28..2fd1095 100644
--- a/test/trace_processor/profiling/heap_graph_superclass_test.sql
+++ b/test/trace_processor/profiling/heap_graph_superclass_test.sql
@@ -1,2 +1,2 @@
-SELECT c.id, c.superclass_id, c.name, s.name superclass_name, c.location
-FROM heap_graph_class c LEFT JOIN heap_graph_class s ON c.superclass_id = s.id;
\ No newline at end of file
+SELECT c.id, c.superclass_id, c.name, s.name AS superclass_name, c.location
+FROM heap_graph_class c LEFT JOIN heap_graph_class s ON c.superclass_id = s.id;
diff --git a/test/trace_processor/profiling/heap_profile_flamegraph_test.sql b/test/trace_processor/profiling/heap_profile_flamegraph_test.sql
index e1feb37..4155b84 100644
--- a/test/trace_processor/profiling/heap_profile_flamegraph_test.sql
+++ b/test/trace_processor/profiling/heap_profile_flamegraph_test.sql
@@ -1,5 +1,5 @@
-select * from experimental_flamegraph
-where ts = 605908369259172
-    and upid = 1
-    and profile_type = 'native'
-limit 10;
+SELECT * FROM experimental_flamegraph
+WHERE ts = 605908369259172
+  AND upid = 1
+  AND profile_type = 'native'
+LIMIT 10;
diff --git a/test/trace_processor/profiling/heap_profile_tracker_new_stack_test.sql b/test/trace_processor/profiling/heap_profile_tracker_new_stack_test.sql
index efed7da..c042ade 100644
--- a/test/trace_processor/profiling/heap_profile_tracker_new_stack_test.sql
+++ b/test/trace_processor/profiling/heap_profile_tracker_new_stack_test.sql
@@ -1 +1 @@
-select * from heap_profile_allocation;
+SELECT * FROM heap_profile_allocation;
diff --git a/test/trace_processor/profiling/heap_profile_tracker_twoheaps_test.sql b/test/trace_processor/profiling/heap_profile_tracker_twoheaps_test.sql
index efed7da..c042ade 100644
--- a/test/trace_processor/profiling/heap_profile_tracker_twoheaps_test.sql
+++ b/test/trace_processor/profiling/heap_profile_tracker_twoheaps_test.sql
@@ -1 +1 @@
-select * from heap_profile_allocation;
+SELECT * FROM heap_profile_allocation;
diff --git a/test/trace_processor/profiling/no_build_id_test.sql b/test/trace_processor/profiling/no_build_id_test.sql
index 46514db..70866fe 100644
--- a/test/trace_processor/profiling/no_build_id_test.sql
+++ b/test/trace_processor/profiling/no_build_id_test.sql
@@ -1 +1 @@
-SELECT value FROM stats WHERE name = 'symbolization_tmp_build_id_not_found'
+SELECT value FROM stats WHERE name = 'symbolization_tmp_build_id_not_found';
diff --git a/test/trace_processor/profiling/perf_sample_test.sql b/test/trace_processor/profiling/perf_sample_test.sql
index 9336740..9fd92a8 100644
--- a/test/trace_processor/profiling/perf_sample_test.sql
+++ b/test/trace_processor/profiling/perf_sample_test.sql
@@ -14,18 +14,17 @@
 -- limitations under the License.
 --
 
-select ps.ts, ps.cpu, ps.cpu_mode, ps.unwind_error, ps.perf_session_id,
-       pct.name cntr_name, pct.is_timebase,
+SELECT ps.ts, ps.cpu, ps.cpu_mode, ps.unwind_error, ps.perf_session_id,
+       pct.name AS cntr_name, pct.is_timebase,
        thread.tid,
        spf.name
-from experimental_annotated_callstack eac
-join perf_sample ps
-  on (eac.start_id = ps.callsite_id)
-join perf_counter_track pct
-  using(perf_session_id, cpu)
-join thread
-  using(utid)
-join stack_profile_frame spf
-  on (eac.frame_id = spf.id)
-order by ps.ts asc, eac.depth asc
-
+FROM experimental_annotated_callstack eac
+JOIN perf_sample ps
+  ON (eac.start_id = ps.callsite_id)
+JOIN perf_counter_track pct
+  USING(perf_session_id, cpu)
+JOIN thread
+  USING(utid)
+JOIN stack_profile_frame spf
+  ON (eac.frame_id = spf.id)
+ORDER BY ps.ts ASC, eac.depth ASC;
diff --git a/test/trace_processor/profiling/profiler_smaps_test.sql b/test/trace_processor/profiling/profiler_smaps_test.sql
index 53e5fd2..d2f404e 100644
--- a/test/trace_processor/profiling/profiler_smaps_test.sql
+++ b/test/trace_processor/profiling/profiler_smaps_test.sql
@@ -1,2 +1,2 @@
-select id, type, upid, ts, path, size_kb, private_dirty_kb, swap_kb
-from profiler_smaps;
+SELECT id, type, upid, ts, path, size_kb, private_dirty_kb, swap_kb
+FROM profiler_smaps;
diff --git a/test/trace_processor/profiling/stack_profile_symbols_test.sql b/test/trace_processor/profiling/stack_profile_symbols_test.sql
index e57f84d..a2c0a77 100644
--- a/test/trace_processor/profiling/stack_profile_symbols_test.sql
+++ b/test/trace_processor/profiling/stack_profile_symbols_test.sql
@@ -1 +1 @@
-select name, source_file, line_number from stack_profile_symbol
+SELECT name, source_file, line_number FROM stack_profile_symbol;
diff --git a/test/trace_processor/profiling/stack_profile_tracker_empty_callstack_test.sql b/test/trace_processor/profiling/stack_profile_tracker_empty_callstack_test.sql
index c61df0d..78dc96e 100644
--- a/test/trace_processor/profiling/stack_profile_tracker_empty_callstack_test.sql
+++ b/test/trace_processor/profiling/stack_profile_tracker_empty_callstack_test.sql
@@ -1 +1 @@
-select count(1) as count from heap_profile_allocation;
+SELECT count(1) AS count FROM heap_profile_allocation;
diff --git a/test/trace_processor/scheduler/sched_cpu_util_cfs_test.sql b/test/trace_processor/scheduler/sched_cpu_util_cfs_test.sql
index c1175fe..52e35bd 100644
--- a/test/trace_processor/scheduler/sched_cpu_util_cfs_test.sql
+++ b/test/trace_processor/scheduler/sched_cpu_util_cfs_test.sql
@@ -4,7 +4,7 @@
   c.value
 FROM
   counter AS c
-  LEFT JOIN
+LEFT JOIN
   counter_track AS t
   ON c.track_id = t.id
 WHERE
diff --git a/test/trace_processor/smoke/thread_cpu_time_test.sql b/test/trace_processor/smoke/thread_cpu_time_test.sql
index 93f101c..a4d09a5 100644
--- a/test/trace_processor/smoke/thread_cpu_time_test.sql
+++ b/test/trace_processor/smoke/thread_cpu_time_test.sql
@@ -13,20 +13,20 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select
+SELECT
   tid,
   pid,
-  thread.name as threadName,
-  process.name as processName,
-  total_dur as totalDur
-from
+  thread.name AS threadName,
+  process.name AS processName,
+  total_dur AS totalDur
+FROM
   thread
-  left join process using(upid)
-  left join
-    (select upid, sum(dur) as total_dur
-      from sched join thread using(utid)
-      where dur != -1
-      group by upid
-    ) using(upid)
-where utid != 0
-order by total_dur desc, pid, tid
+LEFT JOIN process USING(upid)
+LEFT JOIN
+  (SELECT upid, sum(dur) AS total_dur
+    FROM sched JOIN thread USING(utid)
+    WHERE dur != -1
+    GROUP BY upid
+  ) USING(upid)
+WHERE utid != 0
+ORDER BY total_dur DESC, pid, tid;
diff --git a/test/trace_processor/span_join/slice_span_join_b118665515_test.sql b/test/trace_processor/span_join/slice_span_join_b118665515_test.sql
index 34bacf0..aaf9c6d 100644
--- a/test/trace_processor/span_join/slice_span_join_b118665515_test.sql
+++ b/test/trace_processor/span_join/slice_span_join_b118665515_test.sql
@@ -13,10 +13,10 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create virtual table window_8 using window;
+CREATE VIRTUAL TABLE window_8 USING window;
 
-create virtual table span_8 using span_join(sched PARTITIONED cpu, window_8);
+CREATE VIRTUAL TABLE span_8 USING span_join(sched PARTITIONED cpu, window_8);
 
-update window_8 set window_start=81473010031230, window_dur=19684693341, quantum=10000000 where rowid = 0;
+UPDATE window_8 SET window_start = 81473010031230, window_dur = 19684693341, quantum = 10000000 WHERE rowid = 0;
 
-select quantum_ts as bucket, sum(dur)/cast(10000000 as float) as utilization from span_8 where cpu = 7 and utid != 0 group by quantum_ts;
+SELECT quantum_ts AS bucket, sum(dur) / cast(10000000 AS float) AS utilization FROM span_8 WHERE cpu = 7 AND utid != 0 GROUP BY quantum_ts;
diff --git a/test/trace_processor/span_join/span_join_unordered_cols_reverse_test.sql b/test/trace_processor/span_join/span_join_unordered_cols_reverse_test.sql
index 8eec670..2c67277 100644
--- a/test/trace_processor/span_join/span_join_unordered_cols_reverse_test.sql
+++ b/test/trace_processor/span_join/span_join_unordered_cols_reverse_test.sql
@@ -13,13 +13,13 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   a1 STRING,
   a2 BIGINT,
   dur BIGINT,
   a3 BIGINT,
   ts BIGINT PRIMARY KEY
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t1(a1, a2, dur, a3, ts)
 VALUES
@@ -27,7 +27,7 @@
 ("B", 2, 90, 101, 10),
 ("C", 3, 1, 102, 100);
 
-create table t2(
+CREATE TABLE t2(
   b1 STRING,
   ts BIGINT,
   b2 BIGINT,
@@ -35,7 +35,7 @@
   dur BIGINT,
   b3 BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t2(b1, ts, b2, part, dur, b3)
 VALUES
@@ -46,6 +46,6 @@
 ("B", 50, 90, 1, 40, 200),
 ("C", 90, 1, 1, 100, 300);
 
-create virtual table sp using span_join(t2 PARTITIONED part, t1);
+CREATE VIRTUAL TABLE sp USING span_join(t2 PARTITIONED part, t1);
 
-select ts,dur,part,b1,b2,b3,a1,a2,a3 from sp;
+SELECT ts, dur, part, b1, b2, b3, a1, a2, a3 FROM sp;
diff --git a/test/trace_processor/span_join/span_join_unordered_cols_test.sql b/test/trace_processor/span_join/span_join_unordered_cols_test.sql
index 2987665..ac7d35f 100644
--- a/test/trace_processor/span_join/span_join_unordered_cols_test.sql
+++ b/test/trace_processor/span_join/span_join_unordered_cols_test.sql
@@ -13,13 +13,13 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   a1 STRING,
   a2 BIGINT,
   dur BIGINT,
   a3 BIGINT,
   ts BIGINT PRIMARY KEY
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t1(a1, a2, dur, a3, ts)
 VALUES
@@ -27,7 +27,7 @@
 ("B", 2, 90, 101, 10),
 ("C", 3, 1, 102, 100);
 
-create table t2(
+CREATE TABLE t2(
   b1 STRING,
   ts BIGINT,
   b2 BIGINT,
@@ -35,7 +35,7 @@
   dur BIGINT,
   b3 BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t2(b1, ts, b2, part, dur, b3)
 VALUES
@@ -46,6 +46,6 @@
 ("B", 50, 90, 1, 40, 200),
 ("C", 90, 1, 1, 100, 300);
 
-create virtual table sp using span_join(t1, t2 PARTITIONED part);
+CREATE VIRTUAL TABLE sp USING span_join(t1, t2 PARTITIONED part);
 
-select ts,dur,part,b1,b2,b3,a1,a2,a3 from sp;
+SELECT ts, dur, part, b1, b2, b3, a1, a2, a3 FROM sp;
diff --git a/test/trace_processor/span_join/span_join_unpartitioned_empty_test.sql b/test/trace_processor/span_join/span_join_unpartitioned_empty_test.sql
index ae59a56..bfd97e0 100644
--- a/test/trace_processor/span_join/span_join_unpartitioned_empty_test.sql
+++ b/test/trace_processor/span_join/span_join_unpartitioned_empty_test.sql
@@ -15,17 +15,17 @@
 --
 
 -- Model that the first table is empty and the second is has some data.
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts, dur)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts, dur)
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t2(ts, dur)
 VALUES
@@ -33,6 +33,6 @@
 (5, 0),
 (1, 1);
 
-create virtual table sp using span_join(t1, t2);
+CREATE VIRTUAL TABLE sp USING span_join(t1, t2);
 
-select ts, dur from sp;
+SELECT ts, dur FROM sp;
diff --git a/test/trace_processor/span_join/span_join_zero_negative_dur_test.sql b/test/trace_processor/span_join/span_join_zero_negative_dur_test.sql
index ff8237a..2e25ec9 100644
--- a/test/trace_processor/span_join/span_join_zero_negative_dur_test.sql
+++ b/test/trace_processor/span_join/span_join_zero_negative_dur_test.sql
@@ -13,12 +13,12 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts, dur)
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t1(ts, dur, part)
 VALUES
@@ -26,12 +26,12 @@
 (5, -1, 0),
 (2, 0, 1);
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts, dur)
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t2(ts, dur, part)
 VALUES
@@ -39,6 +39,6 @@
 (5, 0, 0),
 (1, 1, 1);
 
-create virtual table sp using span_outer_join(t1 PARTITIONED part, t2 PARTITIONED part);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1 PARTITIONED part, t2 PARTITIONED part);
 
-select ts,dur,part from sp;
+SELECT ts, dur, part FROM sp;
diff --git a/test/trace_processor/span_join/span_left_join_empty_right_test.sql b/test/trace_processor/span_join/span_left_join_empty_right_test.sql
index ac7d8ba..0b6c253 100644
--- a/test/trace_processor/span_join/span_left_join_empty_right_test.sql
+++ b/test/trace_processor/span_join/span_left_join_empty_right_test.sql
@@ -13,25 +13,25 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t1(ts, dur, part)
 VALUES
 (500, 500, 100);
 
-create virtual table sp using span_left_join(t1 PARTITIONED part,
+CREATE VIRTUAL TABLE sp USING span_left_join(t1 PARTITIONED part,
                                              t2 PARTITIONED part);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_left_join_left_partitioned_test.sql b/test/trace_processor/span_join/span_left_join_left_partitioned_test.sql
index 3610935..7297d03 100644
--- a/test/trace_processor/span_join/span_left_join_left_partitioned_test.sql
+++ b/test/trace_processor/span_join/span_left_join_left_partitioned_test.sql
@@ -13,20 +13,20 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   a BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   b BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Then insert some rows into t1 in part 1, 3, 4 and 5.
 INSERT INTO t1(ts, dur, part, a)
@@ -44,6 +44,6 @@
 (300, 100, 222),
 (400, 250, 333);
 
-create virtual table sp using span_left_join(t1 PARTITIONED part, t2);
+CREATE VIRTUAL TABLE sp USING span_left_join(t1 PARTITIONED part, t2);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_left_join_left_unpartitioned_test.sql b/test/trace_processor/span_join/span_left_join_left_unpartitioned_test.sql
index 2b6d66c..8aa1385 100644
--- a/test/trace_processor/span_join/span_left_join_left_unpartitioned_test.sql
+++ b/test/trace_processor/span_join/span_left_join_left_unpartitioned_test.sql
@@ -13,20 +13,20 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   a BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   b BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Insert some rows into t2 which are in part 0 and 1 but before t1's rows.
 INSERT INTO t2(ts, dur, part, b)
@@ -70,6 +70,6 @@
 -- Insert a row into t2 which misses everything in partition 6.
 INSERT INTO t2(ts, dur, part, b) VALUES (0, 100, 6, 2222);
 
-create virtual table sp using span_left_join(t1, t2 PARTITIONED part);
+CREATE VIRTUAL TABLE sp USING span_left_join(t1, t2 PARTITIONED part);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_left_join_test.sql b/test/trace_processor/span_join/span_left_join_test.sql
index bfccd28..f8d9119 100644
--- a/test/trace_processor/span_join/span_left_join_test.sql
+++ b/test/trace_processor/span_join/span_left_join_test.sql
@@ -13,21 +13,21 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   a BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   b BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Insert some rows into t2 which are in part 0 and 1 but before t1's rows.
 INSERT INTO t2(ts, dur, part, b)
@@ -72,7 +72,7 @@
 -- Insert a row into t2 which intersects the first row of partition 5.
 INSERT INTO t2(ts, dur, part, b) VALUES (190, 20, 5, 2222);
 
-create virtual table sp using span_left_join(t1 PARTITIONED part,
+CREATE VIRTUAL TABLE sp USING span_left_join(t1 PARTITIONED part,
                                              t2 PARTITIONED part);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_left_join_unordered_test.sql b/test/trace_processor/span_join/span_left_join_unordered_test.sql
index 51bb62c..913068a 100644
--- a/test/trace_processor/span_join/span_left_join_unordered_test.sql
+++ b/test/trace_processor/span_join/span_left_join_unordered_test.sql
@@ -1,16 +1,16 @@
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Insert a single row into t1.
 INSERT INTO t1(ts, dur, part)
@@ -20,7 +20,7 @@
 INSERT INTO t2(ts, dur, part)
 VALUES (500, 100, 5);
 
-create virtual table sp using span_left_join(t1 PARTITIONED part,
+CREATE VIRTUAL TABLE sp USING span_left_join(t1 PARTITIONED part,
                                              t2 PARTITIONED part);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_left_join_unpartitioned_test.sql b/test/trace_processor/span_join/span_left_join_unpartitioned_test.sql
index 459308e..4a24a3c 100644
--- a/test/trace_processor/span_join/span_left_join_unpartitioned_test.sql
+++ b/test/trace_processor/span_join/span_left_join_unpartitioned_test.sql
@@ -13,19 +13,19 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   a BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   b BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Then insert some rows into t1 in part 1, 3, 4 and 5.
 INSERT INTO t1(ts, dur, a)
@@ -44,6 +44,6 @@
 -- Insert a row into t2 which should span between t1's first and second rows.
 INSERT INTO t2(ts, dur, b) VALUES (400, 250, 333);
 
-create virtual table sp using span_left_join(t1, t2);
+CREATE VIRTUAL TABLE sp USING span_left_join(t1, t2);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_empty_test.sql b/test/trace_processor/span_join/span_outer_join_empty_test.sql
index b26fe22..61b2b2b 100644
--- a/test/trace_processor/span_join/span_outer_join_empty_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_empty_test.sql
@@ -13,19 +13,19 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Insert a single row into t1.
 INSERT INTO t1(ts, dur, part)
@@ -33,7 +33,7 @@
 
 -- t2 is empty.
 
-create virtual table sp using span_outer_join(t1 PARTITIONED part,
-                                             t2 PARTITIONED part);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1 PARTITIONED part,
+                                              t2 PARTITIONED part);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_mixed_empty_test.sql b/test/trace_processor/span_join/span_outer_join_mixed_empty_test.sql
index 6894501..42e1fb8 100644
--- a/test/trace_processor/span_join/span_outer_join_mixed_empty_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_mixed_empty_test.sql
@@ -13,21 +13,21 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- t1 and t2 are empty.
 
-create virtual table sp using span_outer_join(t1 PARTITIONED part, t2);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1 PARTITIONED part, t2);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_mixed_left_empty_rev_test.sql b/test/trace_processor/span_join/span_outer_join_mixed_left_empty_rev_test.sql
index edba216..734ff43 100644
--- a/test/trace_processor/span_join/span_outer_join_mixed_left_empty_rev_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_mixed_left_empty_rev_test.sql
@@ -13,18 +13,18 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t1(ts, dur, part)
 VALUES
@@ -32,6 +32,6 @@
 (100, 50, 1),
 (600, 100, 1);
 
-create virtual table sp using span_outer_join(t2, t1 PARTITIONED part);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t2, t1 PARTITIONED part);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_mixed_left_empty_test.sql b/test/trace_processor/span_join/span_outer_join_mixed_left_empty_test.sql
index cf16856..19a4870 100644
--- a/test/trace_processor/span_join/span_outer_join_mixed_left_empty_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_mixed_left_empty_test.sql
@@ -13,18 +13,18 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t2(ts, dur)
 VALUES
@@ -32,6 +32,6 @@
 (500, 50),
 (600, 100);
 
-create virtual table sp using span_outer_join(t1 PARTITIONED part, t2);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1 PARTITIONED part, t2);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_mixed_right_empty_rev_test.sql b/test/trace_processor/span_join/span_outer_join_mixed_right_empty_rev_test.sql
index 24184ec..461237a 100644
--- a/test/trace_processor/span_join/span_outer_join_mixed_right_empty_rev_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_mixed_right_empty_rev_test.sql
@@ -13,19 +13,19 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   b BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t2(ts, dur)
 VALUES
@@ -33,6 +33,6 @@
 (500, 50),
 (600, 100);
 
-create virtual table sp using span_outer_join(t2, t1 PARTITIONED part);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t2, t1 PARTITIONED part);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_mixed_right_empty_test.sql b/test/trace_processor/span_join/span_outer_join_mixed_right_empty_test.sql
index 7785dc1..b507d8a 100644
--- a/test/trace_processor/span_join/span_outer_join_mixed_right_empty_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_mixed_right_empty_test.sql
@@ -13,19 +13,19 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   b BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 INSERT INTO t1(ts, dur, part)
 VALUES
@@ -33,6 +33,6 @@
 (100, 50, 1),
 (600, 100, 1);
 
-create virtual table sp using span_outer_join(t1 PARTITIONED part, t2);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1 PARTITIONED part, t2);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_mixed_test.sql b/test/trace_processor/span_join/span_outer_join_mixed_test.sql
index 531f862..4e9f44d 100644
--- a/test/trace_processor/span_join/span_outer_join_mixed_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_mixed_test.sql
@@ -13,20 +13,20 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   a BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   b BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Add some rows to t1.
 INSERT INTO t1(ts, dur, part, a)
@@ -44,6 +44,6 @@
 (600, 50, 16),
 (900, 500, 17);
 
-create virtual table sp using span_outer_join(t1 PARTITIONED part, t2);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1 PARTITIONED part, t2);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_test.sql b/test/trace_processor/span_join/span_outer_join_test.sql
index 5454853..46ff1cc 100644
--- a/test/trace_processor/span_join/span_outer_join_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_test.sql
@@ -13,21 +13,21 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   a BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   part BIGINT,
   b BIGINT,
   PRIMARY KEY (part, ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Insert some rows into t2 which are in part 0 and 1 but before t1's rows.
 INSERT INTO t2(ts, dur, part, b)
@@ -72,7 +72,7 @@
 -- Insert a row into t2 which intersects the first row of partition 5.
 INSERT INTO t2(ts, dur, part, b) VALUES (190, 20, 5, 2222);
 
-create virtual table sp using span_outer_join(t1 PARTITIONED part,
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1 PARTITIONED part,
                                               t2 PARTITIONED part);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_unpartitioned_empty_test.sql b/test/trace_processor/span_join/span_outer_join_unpartitioned_empty_test.sql
index db950c5..196075e 100644
--- a/test/trace_processor/span_join/span_outer_join_unpartitioned_empty_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_unpartitioned_empty_test.sql
@@ -13,20 +13,20 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- t1 and t2 are empty.
 
-create virtual table sp using span_outer_join(t1, t2);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1, t2);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_unpartitioned_left_empty_test.sql b/test/trace_processor/span_join/span_outer_join_unpartitioned_left_empty_test.sql
index d660316..5af8041 100644
--- a/test/trace_processor/span_join/span_outer_join_unpartitioned_left_empty_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_unpartitioned_left_empty_test.sql
@@ -13,17 +13,17 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Add some rows to t2.
 INSERT INTO t2(ts, dur)
@@ -32,6 +32,6 @@
 (500, 50),
 (600, 100);
 
-create virtual table sp using span_outer_join(t1, t2);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1, t2);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_unpartitioned_right_empty_test.sql b/test/trace_processor/span_join/span_outer_join_unpartitioned_right_empty_test.sql
index 5f5f091..99f1d80 100644
--- a/test/trace_processor/span_join/span_outer_join_unpartitioned_right_empty_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_unpartitioned_right_empty_test.sql
@@ -13,17 +13,17 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Add some rows to t1.
 INSERT INTO t1(ts, dur)
@@ -32,6 +32,6 @@
 (500, 50),
 (600, 100);
 
-create virtual table sp using span_outer_join(t1, t2);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1, t2);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/span_join/span_outer_join_unpartitioned_test.sql b/test/trace_processor/span_join/span_outer_join_unpartitioned_test.sql
index 96b9110..71928d2 100644
--- a/test/trace_processor/span_join/span_outer_join_unpartitioned_test.sql
+++ b/test/trace_processor/span_join/span_outer_join_unpartitioned_test.sql
@@ -13,19 +13,19 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-create table t1(
+CREATE TABLE t1(
   ts BIGINT,
   dur BIGINT,
   a BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
-create table t2(
+CREATE TABLE t2(
   ts BIGINT,
   dur BIGINT,
   b BIGINT,
   PRIMARY KEY (ts)
-) without rowid;
+) WITHOUT ROWID;
 
 -- Add some rows to t1.
 INSERT INTO t1(ts, dur, a)
@@ -42,6 +42,6 @@
 (600, 50, 6),
 (900, 500, 7);
 
-create virtual table sp using span_outer_join(t1, t2);
+CREATE VIRTUAL TABLE sp USING span_outer_join(t1, t2);
 
-select * from sp;
+SELECT * FROM sp;
diff --git a/test/trace_processor/tables/b119301023_test.sql b/test/trace_processor/tables/b119301023_test.sql
index c5efec1..6aa3634 100644
--- a/test/trace_processor/tables/b119301023_test.sql
+++ b/test/trace_processor/tables/b119301023_test.sql
@@ -13,6 +13,6 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts from sched
-where ts > 0.1 + 1e9
-limit 10;
+SELECT ts FROM sched
+WHERE ts > 0.1 + 1e9
+LIMIT 10;
diff --git a/test/trace_processor/tables/b119496959_test.sql b/test/trace_processor/tables/b119496959_test.sql
index 207ca4f..31cb7e1 100644
--- a/test/trace_processor/tables/b119496959_test.sql
+++ b/test/trace_processor/tables/b119496959_test.sql
@@ -13,4 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, cpu from sched where ts >= 81473797418963 limit 10
+SELECT ts, cpu FROM sched WHERE ts >= 81473797418963 LIMIT 10;
diff --git a/test/trace_processor/tables/b120278869_neg_ts_end_test.sql b/test/trace_processor/tables/b120278869_neg_ts_end_test.sql
index bee5180..16a740a 100644
--- a/test/trace_processor/tables/b120278869_neg_ts_end_test.sql
+++ b/test/trace_processor/tables/b120278869_neg_ts_end_test.sql
@@ -13,4 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select count(*) from counters where -1 < ts
+SELECT count(*) FROM counters WHERE -1 < ts;
diff --git a/test/trace_processor/tables/counter_dur_test.sql b/test/trace_processor/tables/counter_dur_test.sql
index 5bf2366..67a60b9 100644
--- a/test/trace_processor/tables/counter_dur_test.sql
+++ b/test/trace_processor/tables/counter_dur_test.sql
@@ -1 +1 @@
-select ts, dur from experimental_counter_dur where track_id in (1, 2, 3) order by dur limit 10;
+SELECT ts, dur FROM experimental_counter_dur WHERE track_id IN (1, 2, 3) ORDER BY dur LIMIT 10;
diff --git a/test/trace_processor/tables/counters_group_by_freq_test.sql b/test/trace_processor/tables/counters_group_by_freq_test.sql
index 2bd1706..4ed0282 100644
--- a/test/trace_processor/tables/counters_group_by_freq_test.sql
+++ b/test/trace_processor/tables/counters_group_by_freq_test.sql
@@ -15,13 +15,13 @@
 --
 SELECT
   value,
-  sum(dur) as dur_sum
+  sum(dur) AS dur_sum
 FROM (
   SELECT value,
-  lead(ts) OVER (PARTITION BY name, track_id ORDER BY ts) - ts AS dur
+    lead(ts) OVER (PARTITION BY name, track_id ORDER BY ts) - ts AS dur
   FROM counter
   INNER JOIN counter_track ON counter.track_id = counter_track.id
 )
 WHERE value > 0
 GROUP BY value
-ORDER BY dur_sum desc
+ORDER BY dur_sum DESC;
diff --git a/test/trace_processor/tables/filter_row_vector_test.sql b/test/trace_processor/tables/filter_row_vector_test.sql
index 855d40c..699c4f4 100644
--- a/test/trace_processor/tables/filter_row_vector_test.sql
+++ b/test/trace_processor/tables/filter_row_vector_test.sql
@@ -16,14 +16,14 @@
 SELECT ts
 FROM counter
 WHERE
-  ts > 72563651549 AND
-  track_id = (
+  ts > 72563651549
+  AND track_id = (
     SELECT t.id
     FROM process_counter_track t
     JOIN process p USING (upid)
     WHERE
       t.name = 'Heap size (KB)'
       AND p.pid = 1204
-  ) AND
-  value != 17952.000000
-LIMIT 20
+  )
+  AND value != 17952.000000
+LIMIT 20;
diff --git a/test/trace_processor/tables/filter_sched_test.sql b/test/trace_processor/tables/filter_sched_test.sql
index 07ff56c..72fe7dc 100644
--- a/test/trace_processor/tables/filter_sched_test.sql
+++ b/test/trace_processor/tables/filter_sched_test.sql
@@ -13,10 +13,10 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select ts, cpu, dur from sched
-where
-  cpu = 1 and
-  dur > 50 and
-  dur <= 100 and
-  ts >= 100 and
-  ts <= 400;
+SELECT ts, cpu, dur FROM sched
+WHERE
+  cpu = 1
+  AND dur > 50
+  AND dur <= 100
+  AND ts >= 100
+  AND ts <= 400;
diff --git a/test/trace_processor/tables/ftrace_setup_errors_test.sql b/test/trace_processor/tables/ftrace_setup_errors_test.sql
index cc1b3c0..7d15bcb 100644
--- a/test/trace_processor/tables/ftrace_setup_errors_test.sql
+++ b/test/trace_processor/tables/ftrace_setup_errors_test.sql
@@ -1,3 +1,3 @@
 SELECT value FROM stats WHERE name = 'ftrace_setup_errors'
 UNION ALL
-SELECT str_value FROM metadata WHERE name = 'ftrace_setup_errors'
+SELECT str_value FROM metadata WHERE name = 'ftrace_setup_errors';
diff --git a/test/trace_processor/tables/nulls_test.sql b/test/trace_processor/tables/nulls_test.sql
index cccbc47..8074046 100644
--- a/test/trace_processor/tables/nulls_test.sql
+++ b/test/trace_processor/tables/nulls_test.sql
@@ -33,10 +33,10 @@
   start_double_nulls
 )
 VALUES
-(1,     "test",   2.0,  NULL, NULL,   NULL),
-(2,     NULL,     NULL, NULL, "test", NULL),
-(1,     "other",  NULL, NULL, NULL,   NULL),
-(4,     NULL,     NULL, NULL, NULL,   1.0),
-(NULL,  "test",   1.0,  1,    NULL,   NULL);
+(1, "test", 2.0, NULL, NULL, NULL),
+(2, NULL, NULL, NULL, "test", NULL),
+(1, "other", NULL, NULL, NULL, NULL),
+(4, NULL, NULL, NULL, NULL, 1.0),
+(NULL, "test", 1.0, 1, NULL, NULL);
 
-SELECT * from null_test;
+SELECT * FROM null_test;
diff --git a/test/trace_processor/tables/smoke_window_test.sql b/test/trace_processor/tables/smoke_window_test.sql
index 7fe479f..315b005 100644
--- a/test/trace_processor/tables/smoke_window_test.sql
+++ b/test/trace_processor/tables/smoke_window_test.sql
@@ -13,4 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select * from window;
+SELECT * FROM "window";
diff --git a/test/trace_processor/track_event/experimental_slice_layout_depth_test.sql b/test/trace_processor/track_event/experimental_slice_layout_depth_test.sql
index b13dbe6..03527ed 100644
--- a/test/trace_processor/track_event/experimental_slice_layout_depth_test.sql
+++ b/test/trace_processor/track_event/experimental_slice_layout_depth_test.sql
@@ -10,5 +10,5 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-select layout_depth from experimental_slice_layout
-where filter_track_ids = (select group_concat(track_id, ',') from slice);
\ No newline at end of file
+SELECT layout_depth FROM experimental_slice_layout
+WHERE filter_track_ids = (SELECT group_concat(track_id, ',') FROM slice);
diff --git a/test/trace_processor/track_event/flow_events_test.sql b/test/trace_processor/track_event/flow_events_test.sql
index 12e6318..4388b07 100644
--- a/test/trace_processor/track_event/flow_events_test.sql
+++ b/test/trace_processor/track_event/flow_events_test.sql
@@ -13,6 +13,6 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select t1.name as slice_out, t2.name as slice_in from flow t
-join slice t1 on t.slice_out = t1.slice_id
-join slice t2 on t.slice_in = t2.slice_id;
+SELECT t1.name AS slice_out, t2.name AS slice_in FROM flow t
+JOIN slice t1 ON t.slice_out = t1.slice_id
+JOIN slice t2 ON t.slice_in = t2.slice_id;
diff --git a/test/trace_processor/track_event/merging_regression_test.sql b/test/trace_processor/track_event/merging_regression_test.sql
index 270e269..21cbb5e 100644
--- a/test/trace_processor/track_event/merging_regression_test.sql
+++ b/test/trace_processor/track_event/merging_regression_test.sql
@@ -16,4 +16,4 @@
 
 -- Actual query in this file does not matter: we only want to ensure that
 -- parsing of the trace succeeds.
-select ts from slice order by ts limit 10;
+SELECT ts FROM slice ORDER BY ts LIMIT 10;
diff --git a/test/trace_processor/track_event/track_event_args_test.sql b/test/trace_processor/track_event/track_event_args_test.sql
index d1d4cc3..a760456 100644
--- a/test/trace_processor/track_event/track_event_args_test.sql
+++ b/test/trace_processor/track_event/track_event_args_test.sql
@@ -13,4 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select flat_key, key, int_value, string_value from args order by arg_set_id, key asc;
\ No newline at end of file
+SELECT flat_key, key, int_value, string_value FROM args ORDER BY arg_set_id, key ASC;
diff --git a/test/trace_processor/track_event/track_event_counters_test.sql b/test/trace_processor/track_event/track_event_counters_test.sql
index ffa5d57..3426ab0 100644
--- a/test/trace_processor/track_event/track_event_counters_test.sql
+++ b/test/trace_processor/track_event/track_event_counters_test.sql
@@ -13,19 +13,19 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select
-  counter_track.name as counter_name,
-  process.name as process,
-  thread.name as thread,
-  thread_process.name as thread_process,
-  counter_track.unit as unit,
+SELECT
+  counter_track.name AS counter_name,
+  process.name AS process,
+  thread.name AS thread,
+  thread_process.name AS thread_process,
+  counter_track.unit AS unit,
   counter.ts,
   counter.value
-from counter
-left join counter_track on counter.track_id = counter_track.id
-left join process_counter_track on counter.track_id = process_counter_track.id
-left join process on process_counter_track.upid = process.upid
-left join thread_counter_track on counter.track_id = thread_counter_track.id
-left join thread on thread_counter_track.utid = thread.utid
-left join process thread_process on thread.upid = thread_process.upid
-order by ts asc;
+FROM counter
+LEFT JOIN counter_track ON counter.track_id = counter_track.id
+LEFT JOIN process_counter_track ON counter.track_id = process_counter_track.id
+LEFT JOIN process ON process_counter_track.upid = process.upid
+LEFT JOIN thread_counter_track ON counter.track_id = thread_counter_track.id
+LEFT JOIN thread ON thread_counter_track.utid = thread.utid
+LEFT JOIN process thread_process ON thread.upid = thread_process.upid
+ORDER BY ts ASC;
diff --git a/test/trace_processor/track_event/track_event_processes_test.sql b/test/trace_processor/track_event/track_event_processes_test.sql
index 316e927..3a04f17 100644
--- a/test/trace_processor/track_event/track_event_processes_test.sql
+++ b/test/trace_processor/track_event/track_event_processes_test.sql
@@ -13,8 +13,8 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select
+SELECT
   id,
   name,
-  extract_arg(arg_set_id, "chrome.host_app_package_name") as host_app
-from process;
+  extract_arg(arg_set_id, "chrome.host_app_package_name") AS host_app
+FROM process;
diff --git a/test/trace_processor/track_event/track_event_slice_with_args_test.sql b/test/trace_processor/track_event/track_event_slice_with_args_test.sql
index 8cf8501..51ee2d7 100644
--- a/test/trace_processor/track_event/track_event_slice_with_args_test.sql
+++ b/test/trace_processor/track_event/track_event_slice_with_args_test.sql
@@ -13,11 +13,11 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select
-  track.name as track,
-  process.name as process,
-  thread.name as thread,
-  thread_process.name as thread_process,
+SELECT
+  track.name AS track,
+  process.name AS process,
+  thread.name AS thread,
+  thread_process.name AS thread_process,
   slice.ts,
   slice.dur,
   slice.category,
@@ -25,12 +25,12 @@
   args.key,
   args.string_value,
   args.int_value
-from slice
-left join track on slice.track_id = track.id
-left join process_track on slice.track_id = process_track.id
-left join process on process_track.upid = process.upid
-left join thread_track on slice.track_id = thread_track.id
-left join thread on thread_track.utid = thread.utid
-left join process thread_process on thread.upid = thread_process.upid
-left join args on slice.arg_set_id = args.arg_set_id
-order by ts asc;
+FROM slice
+LEFT JOIN track ON slice.track_id = track.id
+LEFT JOIN process_track ON slice.track_id = process_track.id
+LEFT JOIN process ON process_track.upid = process.upid
+LEFT JOIN thread_track ON slice.track_id = thread_track.id
+LEFT JOIN thread ON thread_track.utid = thread.utid
+LEFT JOIN process thread_process ON thread.upid = thread_process.upid
+LEFT JOIN args ON slice.arg_set_id = args.arg_set_id
+ORDER BY ts ASC;
diff --git a/test/trace_processor/track_event/track_event_slices_test.sql b/test/trace_processor/track_event/track_event_slices_test.sql
index 8308b16..f93f3ad 100644
--- a/test/trace_processor/track_event/track_event_slices_test.sql
+++ b/test/trace_processor/track_event/track_event_slices_test.sql
@@ -13,20 +13,20 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select
-  track.name as track,
-  process.name as process,
-  thread.name as thread,
-  thread_process.name as thread_process,
+SELECT
+  track.name AS track,
+  process.name AS process,
+  thread.name AS thread,
+  thread_process.name AS thread_process,
   slice.ts,
   slice.dur,
   slice.category,
   slice.name
-from slice
-left join track on slice.track_id = track.id
-left join process_track on slice.track_id = process_track.id
-left join process on process_track.upid = process.upid
-left join thread_track on slice.track_id = thread_track.id
-left join thread on thread_track.utid = thread.utid
-left join process thread_process on thread.upid = thread_process.upid
-order by ts asc;
+FROM slice
+LEFT JOIN track ON slice.track_id = track.id
+LEFT JOIN process_track ON slice.track_id = process_track.id
+LEFT JOIN process ON process_track.upid = process.upid
+LEFT JOIN thread_track ON slice.track_id = thread_track.id
+LEFT JOIN thread ON thread_track.utid = thread.utid
+LEFT JOIN process thread_process ON thread.upid = thread_process.upid
+ORDER BY ts ASC;
diff --git a/test/trace_processor/track_event/track_event_tracks_test.sql b/test/trace_processor/track_event/track_event_tracks_test.sql
index 620b0e8..a95d304 100644
--- a/test/trace_processor/track_event/track_event_tracks_test.sql
+++ b/test/trace_processor/track_event/track_event_tracks_test.sql
@@ -12,12 +12,12 @@
   LEFT JOIN thread_track t2 USING (id)
   LEFT JOIN thread USING (utid)
   LEFT JOIN process_track t3 USING (id)
-  LEFT JOIN process ON t3.upid=process.id
+  LEFT JOIN process ON t3.upid = process.id
   ORDER BY id
 )
 SELECT t1.full_name AS name, t2.full_name AS parent_name,
        EXTRACT_ARG(t1.source_arg_set_id, 'has_first_packet_on_sequence')
-           AS has_first_packet_on_sequence
+       AS has_first_packet_on_sequence
 FROM track_with_name t1
-LEFT JOIN track_with_name t2 ON t1.parent_id=t2.id
+LEFT JOIN track_with_name t2 ON t1.parent_id = t2.id
 ORDER BY 1, 2;
diff --git a/test/trace_processor/translation/chrome_args_test.sql b/test/trace_processor/translation/chrome_args_test.sql
index 63c2492..fc4bf5b 100644
--- a/test/trace_processor/translation/chrome_args_test.sql
+++ b/test/trace_processor/translation/chrome_args_test.sql
@@ -13,4 +13,4 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-select flat_key, key, int_value, string_value from args order by arg_set_id, key asc;
+SELECT flat_key, key, int_value, string_value FROM args ORDER BY arg_set_id, key ASC;