Skip to content

SQL Operations

Useful commands for SQL Injections

https://github.com/SmotrovaLilit/sql-sandbox/blob/main/SQL-OPERATIONS.MD

Postgres

Get tables from database Postgres

You can get tables from only current database without additional tools dblink.
SQL bellow returns an error if current database is not sandbox-postgres

select table_name from sandbox-postgres.information_schema.tables where table_schema = 'public'  

List of schemas

SELECT schema_name  
FROM information_schema.schemata;  

Oracle

List of schemas

The database creates schema for each user. Schema is a set of tables, views, procedures, functions, etc.
Owner it is a name of schema.

select owner from all_tables group by owner;  

Referenses

  1. web200.Introduction to SQL