Skip to content

Instantly share code, notes, and snippets.

View lcaldara-oracle's full-sized avatar

Ludovico Caldara lcaldara-oracle

View GitHub Profile
sql() {
# REMOTE source this script
#
# . <(curl -s https://gist.githubusercontent.com/krisrice/fec43fd9f53e4286e5cc360b554e3c0f/raw/62ec382d7511c7cc44703a9a2f75a4a7f233efe2/sqlcl.sh)
# Set the stage directory
STAGE_DIR=/tmp
# Check whether internet connection exists
if ping -c 1 -t 3 download.oracle.com > /dev/null; then
@lcaldara-oracle
lcaldara-oracle / quick_sqlcl_setup.sh
Created January 5, 2023 14:27
Quick download and setup steps for SQLcl inside $HOME
cd $HOME
wget https://download.oracle.com/otn_software/java/sqldeveloper/sqlcl-latest.zip
rm -rf $HOME/sqlcl/
unzip sqlcl-latest.zip
echo "export PATH=$HOME/sqlcl/bin:$PATH" >> .bash_profile && . .bash_profile
@lcaldara-oracle
lcaldara-oracle / continents_and_countries.sql
Created January 4, 2023 08:18
Create and populate tables for continents and countries in the world. Source: https://en.wikipedia.org/wiki/List_of_sovereign_states_and_dependent_territories_by_continent_(data_file). Removed duplicated entries for countries that belong to two continents.
create table continents (
continent_code varchar2(2) not null
,continent varchar2(400) not null
,constraint pk_continents primary key (continent_code)
);
create table countries (
country_code varchar2(2) not null
,country varchar2(400) not null
,continent_code varchar2(2) not null