Kata SQ

SQL Basics: Truncating

Given the following table ‘decimals’:

** decimals table schema **

  • id
  • number1
  • number2

Return a table with one column (towardzero) where the values are the result of number1 + number2 truncated towards zero.

Hint: The syntax should be “TRUNC” instead of “TRUNCATE”

Solution:

select trunc(number1+number2) as towardzero from decimals;

Link

Reference

--

--

--

My homepage to record my thought processes for solving SQL and Algorithm questions

Recommended from Medium

Mushroom Classification Project part 1 — Project Environment Setup

Reorganise Strings — Java Solution

Flutter unit testing using Mockito

Quick Sort

Fun Times Binary Patching the Mach-O Format

5 Myths About Software Development

How To Implement Adapter Design Pattern Using Java?

Building No-Cost Conversational BOT

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Isabelle

Isabelle

In love with telling stories with data

More from Medium

Why Windows function should be in your Data Science repertoire?

The importance of data in communications

What Data Tracking has done to me.

Data Harvesting