The list of cities between two chosen cities

Bumped into a question:

I have trouble with database design and don’t know how to overcome this. The problem is with list of cities between two chosen city. User chooses start and finish city, and OPTIONALLY, user can write which cities between he will pass, so it can be 0,1,…N. How can I store this in my database ? I already have table with list of States and another table with list of cities.

I thought a bit, and if there is no better option, I will have row in which I will store IDs of cities in format «ID1,ID2,ID3,…» and in software I will separate IDs, but I think this is not normal.

Let’s solve it using oracle:
We’ll use parent-child oriented recursive table,


so if you wish to visit city 4, you have several ways: you may travel

you may travel

or

or

OK, let’s start Читать далее The list of cities between two chosen cities

Get records for work shift (24 hour, 9 am — 9 am Oracle)

 

Installing oracle client in Ubuntu server

Install RPMs

  • Download the Oracle Instantclient RPM files from //www.oracle.com/technetwork/database/features/instant-client/index-097480.html. Everyone needs either «Basic» or «Basic lite», and most users will want «SQL*Plus» and the «SDK».
  • Convert these .rpm files into .deb packages and install using «alien» («sudo apt-get install alien» if you don’t have it):
  • Test your Instantclient install by using «sqlplus» to connect to your database

    If sqlplus complains of a missing libaio.so.1 file, run

    If sqlplus complains of a missing libsqlplus.so file, follow the steps in the section «Integrate Oracle Libraries» below.

    If you execute sqlplus and get «sqlplus: command not found», see the section below about adding the ORACLE_HOME variable.
    You will see something like this:

connected

Читать далее Installing oracle client in Ubuntu server