Web domain - Bear in mind that field settings for the
Wednesday, December 26th, 2007Bear in mind that field settings for the OLTP database model discussed in the previous section, are input mask restrictions (MASK), CHECK constraints, and output display formats (FORMAT). Data warehouse tables are rarely, if ever, manually entered into. Data warehouse tables are fully generated. using coding and scripting, all generated from source databases, such as an OLTP database. Therefore, no MASK settings are required. This approach applies to CHECK constraints as well because CHECK constraints are intended to check specific values on field input. FORMAT settings are useful for output only and thus do apply for a data warehouse, where those fields may someday be output in reports. In short, there are very few changes for the data warehouse model shown in the following scripts. Additionally, for any CHECK constraints across multiple fields, you should assume them to be correct, because the code generating data warehouse entries should be correct. First up are the CATEGORY and SELLER tables: CREATE TABLE CATEGORY ( CATEGORY_ID INTEGER PRIMARY KEY NOT NULL, PARENT_ID INTEGER FOREIGN KEY REFERENCES CATEGORY WITH NULL, CATEGORY CHAR VARYING(32) UNIQUE NOT NULL ); CREATE TABLE SELLER ( SELLER_ID INTEGER PRIMARY KEY NOT NULL, SELLER CHAR VARYING(32) UNIQUE NOT NULL, COMPANY CHAR VARYING(32) UNIQUE NOT NULL, COMPANY_URL CHAR VARYING(64) FORMAT WWW.[X…].XXX UNIQUE NOT NULL, POPULARITY_RATING SMALLINT NULL, FEEDBACK_POSITIVE SMALLINT FORMAT 99990 NULL, FEEDBACK_NEUTRAL SMALLINT FORMAT 99990 NULL, FEEDBACK_NEGATIVE SMALLINT FORMAT 99990 NULL ); The FORMAT setting for the COMPANY_URL field is the same as for the SELLER table in the OLTP database model, shown in the previous section. All UNIQUE settings could be deleted. There is no reason why UNIQUE key restrictions should be retained within data warehouse tables because data warehouse table data is supposed to be automatically generated. The generation code could take uniqueness into account. The FORMAT 99990 settings for the feedback aggregations means that the number 0 is returned as 0 , 456 is returned as 456 not 00456 . Obviously, 12345 is returned as 12345 . Now look at the BIDDER and LOCATION tables: CREATE TABLE BIDDER ( BIDDER_ID INTEGER PRIMARY KEY NOT NULL, BIDDER CHAR VARYING(32) UNIQUE NOT NULL, 371 Business Rules and Field Settings
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.