This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |