Key-value tables - what is all about? Consider the following example table:
CREATE TABLE EMPLOYEES ( ID INT NOT NULL, NAME VARCHAR (10) NOT NULL, SALARY INT NOT NULL); ALTER TABLE EMPLOYEES ADD CONSTRAINT EMPLOYEES_PK PRIMARY KEY (ID); INSERT INTO EMPLOYEES (ID, NAME, SALARY) VALUES (1, 'Dany', The above script produces the following table:
This table holds employee description, specifically employee name and salary. You might have noticed that there is an additional column called “ID.” We use this column as a primary key, i.e. a unique identifier of each row in the table, which can never be set with a NULL value. In a general development process, after collecting the requirements and designing the model, the DBA would create this table, and the programmer would start coding with it. In case the requirement changes, we will need to change the table design. For example, what happens if the customer adds a new requirement? We will look at the case of a customer wanting to include additional information which describes whether the employee has a company vehicle and the year that the employee started working with the company.
blog comments powered by Disqus | ||||||||||||||||||||||||||||||||