SQL Exercises: Display the numbers in columns
SQL Basic Select Statement: Exercise-3 with Solution
Write a SQL query to display three numbers in three columns.
Sample Solution:
-- This query selects three numeric literals (5, 10, and 15) as separate columns.
SELECT 5, 10, 15;
Output of the Query:
?column? 15
:Code Explanation:
The above query in SQL that selects a row with three columns, each with a different value: 5, 10, and 15. These values will be in a single row and multiple columns.
Visual presentation:
Practice Online
Query Visualization:
Duration:
Rows:
Cost:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous SQL Exercise: Display a given string.
Next SQL Exercise: Display the sum of two numbers.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/sql-exercises/sql-retrieve-exercise-3.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics