Hi, How can i define multiple attribute in database. Suppose the name field. It has three parts: Firstname, Middlename, Lastname. And the Address Attribute:
Street Address City State Zipcode Country .......
Hi, How can i define multiple attribute in database. Suppose the name field. It has three parts: Firstname, Middlename, Lastname. And the Address Attribute:
Street Address City State Zipcode Country .......
Each part of the name is a separate attribute:
CREATE TABLE People (
persion_id INTEGER NOT NULL PRIMARY KEY,
first_name VARCHAR(20),
middle_name VARCHAR(20),
last_name VARCHAR(30) )
Similarly for addresses the street_address, city, state_or_province, post_code, and country are generally separate attributes. In some applications you might want to split the street address into building_number, street_name, and additional attributes.
In a database, each attribute becomes a column e.g.
create table person (firstname varchar(20), middlename varchar(20),
lastname varchar(20), ...);
create table address (street_address varchar(30), city varchar(30), ...);