Ravi Sir's Cyber Security Cards › Revision Cards
Working with Databases
Working with Databases Basic commands to manage databases: CREATE DATABASE , SHOW DATABASES , USE dbname . In SQL injection, attackers list databases from information_schema . With least privilege, the web app user sees only its own database. Even a successful attack cannot list the others. Forgetti

Read card text
What this card says
What it is
Basic commands to manage databases: CREATE DATABASE, SHOW DATABASES, USE dbname.
Why it matters for security
In SQL injection, attackers list databases from information_schema.
With least privilege, the web app user sees only its own database. Even a successful attack cannot list the others.
Common mistake
Forgetting USE dbname; and getting “No database selected”. Run it after every login.
| Statement type | Meaning | Examples |
|---|---|---|
| DDL – Data Definition | Structure | CREATE, ALTER, DROP, TRUNCATE, RENAME |
| DML – Data Manipulation | Rows | INSERT, UPDATE, DELETE |
| DQL – Data Query | Reading | SELECT |
| DCL – Data Control | Permissions | GRANT, REVOKE |
| TCL – Transaction Control | Transactions | START TRANSACTION, COMMIT, ROLLBACK |
Learn more in the lesson: 10.2 Working with Databases