SQL Injection(SQLi) is websecurity loop hole which can be exploited by attackers to modify the query which the application sends to RDBMS for execution. An attacker may be able to view/modify/delete data without any authorization. Simialar to XSS attack, untrusted user input if used in queries can lead to SQLi

SQL Injection examples

Preventing SQL injection

SQLi can be blocked via parameterized queries / prepared statements.

Read more

https://portswigger.net/web-security/sql-injection/examining-the-database (union attack can be used for examining the database).