リレーショナル データベースでいくつかのクエリ操作を実行してみたいと思います。たとえば
relation cars
brandname type year
acura suv 2012
bmw sedan 2013
および/または
relation transport
transport vehicle capacity ticketprice
bus 40 30
airplane 300 500
taxi 3 125
in this database has up to 100 relations.
each relation could has 10 attributes.
each relation could has 10000 row data.
このデータベースには 1 つのテキスト ファイルがあります。このファイル、2 台の車の輸送
最初の行は、このファイルにどのような関係がありますか? およびその他の行の関係の名前。
リレーションごとに 2 つの異なるファイルがあります。最初の 1 つのテキスト ファイル、
3
brandname String 20
type String 10
year Int 4
最初の行は、このリレーション テーブル内の属性の数です。他の行の属性と型 (文字列/整数) および属性のサイズ (バイト)
2 番目のファイルはバイナリ ファイルで、各行データに関する情報があります。「acura suv 2012」ですが、バイナリです。
そう、
そんなことを考えているのですが、
まず、次のような構造体を作成する必要があります。
struct relation{
char attribute[10];
char row[10000];
}
struct row {
char type[2]; //string or integer
char title[???]; //i think i have to read from binary file how many title in this file ??
long size; //how many bytes size of each attribute
}
しかし、私の考えが正しいかどうかはわかりません。