Print Pattern Examples Using Sql

Print Pattern Examples Using Sql
Written by Thomas Brown

There are 11 star pattern examples in this tutorial. I will add more example…

In Sql we use replicate function to print pattern easily.

How Replicate Function Works In Sql

The Replicate function get to parameters. The first parameter is the character we want to print and the second parameter is, how many times we want to print the character. Example Select replicate(‘*’,5); The Code prints star character 5 times side by side. Now we can print patterns ;

1. Pattern: Print Left Triangle Example

Result Of Code

2. Pattern: Print Right Triangle Example

Result Of Code

3. Pattern: Print Reverse Left Triangle Example

Result Of Code

4. Pattern: Print Reverse Right Triangle Example

Result Of Code

5. Pattern: Print Pyramid Example

Result Of Code

6. Pattern: Print Diamon Example

Result Of Code

7. Pattern: Print Twisted Sentence Example

Result Of Code

8. Pattern: Print Pyramid Example

Result of Code

Result Of Code

9. Pattern: Print Hollow Diamond Example

You can change max value to see different view. But the value must be odd number.

Result of Code

Result Of Code

10. Pattern: Print Right Arrow Example

Result of Code

Result Of Code

11. Pattern: Print A Word Triangle Example

Result of Code

Result Of Code

12. Pattern: Print Right Arrow – 2

Result OF Code

That’s all for now. I will write new ones soon as possible. I hope you like it.

YOU MAY WANT TO SEE OUR ALL EXAMPLES PAGE, THEN CLICK HERE

2 Comments

Leave a Reply to VARAHA RAI X

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: