Executing the SQL with CSQL

After the CSQL has been executed, you can enter the SQL into the CSQL prompt. Each SQL statement must end with a semicolon (;). Multiple SQL statements can be entered in a single line. You can find the simple usage of the session commands with the ;help command. For more information, see Session Commands.

% csql demodb

CUBRID SQL Interpreter

Type `;help' for help messages.

csql> select * from olympic;

=== <Result of SELECT Command in Line 1> ===

 

    host_year  host_nation           host_city             opening_date  closing

_date  mascot                slogan                introduction

================================================================================

=======================================================================

         2004  'Greece'              'Athens'              08/13/2004    08/29/2

004    'Athena  Phevos'      'Welcome Home'        'In 2004 the Olympic Games re

turned to Greece, the home of both the ancient Olympics and the first modern Olympics.

 

<omitted>

25 rows selected.

 

Current transaction has been committed.

 

1 command(s) successfully processed.

csql> SELECT SUM(n) FROM (SELECT gold FROM participant WHERE nation_code='KOR'

csql> UNION ALL SELECT silver FROM participant WHERE nation_code='JPN') AS t(n);

 

=== <Result of SELECT Command in Line 1> ===

 

       sum(n)

=============

           82

 

 

1 rows selected.

 

Current transaction has been committed.

 

1 command(s) successfully processed.

csql> ;exit