Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 924 Bytes

README.md

File metadata and controls

11 lines (7 loc) · 924 Bytes

Drawing_Triangles_with_MySQL

This repository contains simple sets of codes that draw triangles in the form of ASCII art using MySQL. I cam across these codes on HackerRank and I thought it was a very strange concept to SQL to draw triangles with ASCII art. But then it became a challenging tasks and I learned to use information_schema.tables, a dummy table that exists in every MySQL session.

You can find the original problems and discussions from the following links:

Draw the Triangle 1: https://bit.ly/3ATG0WY Draw the Triangle 2: https://bit.ly/3oqjEam

The propblem #2 is simply the reverse version of the #1, however it imposes an additional logical step in the code.

Each set of the code also requires the user to create a user-defined variable using '@' assignment syntax. More information about user- and system-defined variables in MySQL with '@' assignment syntax can be found here: https://bit.ly/34A9oVV