Database structure and forms
導入済みこのレッスンの内容
| English | 意味 |
|---|---|
| primary key/ˈpraɪməri kiː/ | A field or combination of fields that uniquely identifies each record in a database table. |
| foreign key/ˈfɒrən kiː/ | A field or group of fields that refers to a candidate key in another or the same database table. |
| redundancy/rɪˈdʌndənsi/ | Additional or repeated data, capacity or components beyond what is strictly necessary, sometimes provided for reliability. |
| radio button | |
| check box | |
| relational database/rɪˈleɪʃənl ˈdeɪtəbeɪs/ |
Tables that talk to each other
- A database table holds records (rows) made of fields (columns). Linking tables avoids repeating data.
Data types
| type | use | formats |
|---|---|---|
| text | names, codes, phone numbers | |
| numeric | quantities, prices | decimals, %, currency |
| date/time | dates, times | 25/02/2026, 14:30 |
| Boolean | two values | yes/no, checkbox |
- Data can be imported from .csv or .txt.
Match each field to the best data type.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Phone numbers are text because they are not calculated and may start with 0.
A primary key value can be repeated in a table.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
It must be unique for each record.
Keys
- A primary key 主键 is unique for each record and identifies it.
- A foreign key 外键 is another table's primary key; it links the tables in a relationship.
Books(BookID, Title, Author) and Loans(LoanID, BookID, MemberID, DateOut): LoanID is the primary key of Loans; BookID is a foreign key in Loans.
In Loans(LoanID, BookID, MemberID, DateOut), what is BookID?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
It is the primary key of Books, linking the tables.
Which are advantages of a relational database over a flat file?
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Flat files are simpler to set up.
Flat file or relational?
| flat file | relational |
|---|---|
| one table | linked tables |
| simple | more complex design |
| repeated data (redundancy 冗余) | shared details stored once |
| can become inconsistent | change once, correct everywhere |
Which form control lets the user choose exactly one option?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Check boxes allow several.
Data entry forms
- Title, instructions, logical order, white space, clear font.
- Radio buttons 单选按钮 (one choice), check boxes 复选框 (several), drop-down menus reduce typing errors; navigation buttons.
Phone numbers are text, not numbers. They are not calculated, and a number field drops the leading 0.
Choose the right data type for each field. A primary key is unique; a foreign key links tables. Relational databases 关系型数据库 cut redundancy. Forms use controls that limit typing.
何が問題でしたか?この内容はサイトの運営チームだけが確認します。