Firebird はリレーショナル・データベース管理システム
【目次】
【関連する外部ページ】
利用条件などは利用者で確認すること.
謝辞:このページで紹介するソフトウェア等の作者に感謝する
「DOWNLOADS」をクリック
64 ビット版の Ubuntu を使っているときは, 「Linux AMD64」の .exe ファイルを選択する。
sudo apt -y install libtommath-dev libtommath1
sudo mkdir /usr/local/firebird sudo chown $USER /usr/local/firebird
sudo chown -R $USER /usr/local/firebird cd /usr/local/firebird tar -xvzof Firebird-4.0.2.2816-0.amd64.tar.gz cd Firebird-4.0.2.2816-0.amd64 sudo bash install.sh
HOGE$#34hoge5 のように設定する.
パスワードは,必ず独自に設定してください.
export PATH=/opt/firebird/bin:${PATH} echo 'export PATH=/opt/firebird/bin:${PATH}' >> ${HOME}/.bashrc
データベース管理者の権限で起動している.
isql -u sysdba
ISQL の終了は 「exit;」.
exit;
データベースを作成するために,SQL の create database コマンドを使用する.
データベース管理者の権限で起動している.
sudo /opt/firebird/bin/isql -u sysdba
utf8の場合
create database 'testdb' default character set utf8;
sjisの場合
create database 'testdb' default character set sjis;
show database;
exit;
sudo /opt/firebird/bin/isql -u sysdba
connect 'testdb';
create table order_records ( id integer primary key not null, yy integer not null CHECK ( yy > 2008 ), mm integer not null CHECK ( mm >= 1 AND mm <= 12 ), dd integer not null CHECK ( dd >= 1 AND dd <= 31 ), customer_name varchar(32) not null, product_name varchar(32) not null, unit_price real not null check ( unit_price > 0 ), qty integer not null check ( qty > 0 ), created_at timestamp not null, updated_at timestamp, check ( ( unit_price * qty ) < 200000 ) );
insert into order_records values( 1, 2020, 7, 26, 'kaneko', 'orange A', 1.2, 10, current_timestamp, NULL ); insert into order_records (id, yy, mm, dd, customer_name, product_name, unit_price, qty, created_at) values( 2, 2020, 7, 26, 'miyamoto', 'Apple M', 2.5, 2, current_timestamp ); insert into order_records (id, yy, mm, dd, customer_name, product_name, unit_price, qty, created_at) values( 3, 2020, 7, 27, 'kaneko', 'orange B', 1.2, 8, current_timestamp ); insert into order_records (id, yy, mm, dd, customer_name, product_name, unit_price, qty, created_at) values( 4, 2020, 7, 28, 'miyamoto', 'Apple L', 3, 1, current_timestamp );
select * from order_records;
update order_records set unit_price = 11.2 where id = 1; select * from order_records;
show tables;
exit;