Quiz 1: Creating a Database
Field is a single characteristic of a person, place, object, event, or idea. Database table can contain more than one field with different names. Other name for fields is column or attributes. Consider a student table with the fields such as student name, student address, student phone number, grade, marks. It gives complete details about students in a class. Here student's address is a characteristic of a place. • Collection of fields is called a record. Field is the part of record. • In every table, a particular field will be a primary key. • Every field belongs to certain data type such as text, auto number, date/time, number, currency and many other data types. • Field is an integral part of a table. • Field data can be duplicated to more than one record in the table except the primary key field's data. • There are some possible actions can be done in table field such as adding, deleting fields, reordering fields, editing field values whenever needed. • Using field one table can be linked to another table. There forms a relationship between the tables. • Field name should be meaningful to describe the characteristics of the field. For each and every field you can define some properties such as caption, default value, length, index, format, text alignment and many other properties.
You connect the records in two separate tables through a (n) Common field that appears in both tables. • Common field means two tables having the same field name with the same set of data. • Through relationship between common fields of two tables, records in one table can be linked to records in another table. • A table can have one primary key and one or more foreign keys, where these keys have an important role in table relationship. • Common field in one table acts as a primary key and the same field acts as a foreign key in another table. Example Consider two tables Customer and Order. Customer table have attributes such as CustomerID, CustomerName, CustomerAddress, and PhoneNumber. Order table have attributes such as OrderID, CustomerID, and Amount. Customer Order Here common field between two tables is CustomerID. Primary key of Customer table is CustomerID. Primary key of Order table is OrderID. Foreign key of Order table is CustomerID. You can create relationship between these two tables. One - to- one relationship exists between common fields of two tables. So records of two tables can be connected easily. Once when you type the CustomerID, you can get their OrderID, Amount, Name, Address, PhoneNumber.
The primary key , whose values uniquely identify each record in a table, is called a (n) foreign key when it is placed in a second table to form a relationship between the two tables. Primary key • Primary key field does not allow repeated and null values. • Every table must have primary key field. Either the table have one primary key field or more than one primary key field that is called as composite key. • You can retrieve whole record of a particular row using the primary key field value of that row. • Access generates a default primary key field which is the ID field with AutoNumber data type. • A primary key appears as fields in database. • Primary key field concatenates ID of the parent table with unique ID of another table. • It is used to differentiate one record from another record in table. Foreign key • Foreign key field refers to primary key field in another table. • This field should also have not null values. • When you change the data in primary key, it affects the foreign key value in related tables. • It is used to maintain data integrity. • The foreign key field values must also appear in primary key of related table to maintain data integrity. • It is used to manage same person's record in two different tables. Consider two tables' student and library. Student table consist of fields such as StudID, StudName, and Grade. Library table consist of field such as LibraryCardNo, StudID, and BookName. Student Library Primary key of student table is StudID. Primary key of library table is LibraryCardNo and foreign key of library table is StudID. StudID in student table acts as a foreign key in library table. With the help of these keys, you can form relationship between two tables. When you change any StudID number in student table such as 788 instead of 888, these changes will affect in library table's StudID field and 788 are displayed instead of 888 through enforcing relationship between two tables.
There is no answer for this question