Draw The Triangle 1 SQL Hacker Rank Solution

Hello coders, In this post, you will learn how to solve the Draw The Triangle 1 SQL Hacker Rank Solution. This problem is a part of the SQL Hacker Rank series.

Draw The Triangle 1 SQL Hacker Rank Solution
Draw The Triangle 1 SQL Hacker Rank Solution

Draw The Triangle 1 SQL Hacker Rank Solution

Problem

P(R) represents a pattern drawn by Julia in R rows. The following pattern represents P(5):

* * * * *
* * * *
* * *
* *
*

Write a query to print the pattern P(20).

Draw The Triangle 1 SQL Hacker Rank Solution

SET @TEMP:=21;
SELECT REPEAT('* ', @TEMP:= @TEMP - 1)
FROM INFORMATION_SCHEMA.TABLES;

Disclaimer: The above Problem (Draw The Triangle 1) generated by Hackerrank but the Solution is Provided by Chase2Learn. This tutorial is only for Educational and Learning purposes.

Sharing Is Caring