Table is crucial A table is an essential element of any relational database management system. Data stored in the columns and rows of a table, and the relationship that may exist between the various tables, is at the core of RDBMS. The creator of the table becomes the owner of the table. An owner cannot have two tables with the same name. Some of the other dos and don'ts for creating a table are: The table name cannot use any of the keywords used in the system It cannot be a combination of two names separated by a white space The maximum length of a table is 28 characters. The table name's first character should be alphabetic The table name's other characters better be confined to numbers and In any case, if and when you violate the rules you do get a error message telling you what was wrong. In that sense, you are covered. Since the Wizard tells you immediately what is wrong in some cases, you know what you have to do to correct it. We will start with a very simple example of creating just one table called Htek_Employees for the Htek company. The Employee table will consist solely of the Employee information such as: First_Name Last_Name Hire_Date Birth_Date Title Salary Address City State Zip Home_Phone Office_Phone_Phone Cell_Phone Email Health_Coverage Notes Columns in the table In addition to this, to associate this information uniquely to an individual an Employee_ID is also added. This table will have 16 columns. The 16 columns are the attributes of the Employee physically stored in a table. A row in the table may contain values for each of these columns. For example, for an employee whose Employee_ID is 1, the details are: First_Name; John Last_Name; Newcomb Hire_Date: 2/1/1998 Birth_Date: 1/1/1980 Salary: $40000 Title: Supervisor Address: 123 Cox Street City: Princeville State: NJ ZIP: 08536 Home Phone: (738)123-1235 Office Phone: (738)234-2335 Call Phone: (981)222-2345 Email: jnewcomb@htek.com Health Coverage (Yes/No): Yes Notes: Dependable reliable employee If the Employee_ID is known, everything about this employee should be available from this table. Column Data Types For each column in the above table, the type of information it contains is different. While names are represented by 'text', hire_date and birth_date consists of 'date' type information. The salary contains 'money' type information. Telephone numbers and the Zip code consists of numerals, but they are not number type; who will ever think of adding two zip codes, or subtracting one telephone number from another? So these are no different than names. So the different columns may be stored as different data types. The Oracle table designer gives you options from which you can choose the data type that you may want to assign.
blog comments powered by Disqus |