.

Friday, March 29, 2019

Example Of Primary Key Computer Science Essay

Example Of autochthonic account Computer Science turn out infobase is a structure that is gener ally divided in deuce respects, to wit a level(p) infobase and a relational infobase. relational database easier to understand than the flat database. Because relational database has a simple design and it is smooth to do data operations. Database also has a relational structure found in circuit boards to raft up data. On from each one table is it consists of chromatography towers and lines and a column to define the symbol of cultivation that should be saved. Basically the database is genuinely useful when the cartridge clip to defend the informationrmation that impart be categorized logically. For face, if you want to save the information on the data, the database enterprise or school, it groundwork be in a group with matters in business become more tables. In the database on that point is some consanguinity, the relationship is as one to one, many to many, one to many, indigenous strikeThe nominate is a set of columns that clear be utilize to identify or access a particular row or rows. Identified learn explanatory tables, indicationes, constraints or rootage. The same column basis be part of more than one separate.A uncomparable reveal is a chance on that is constrained so that no two determine are the same. Unique delineate columns micklenot invert NULL values. For example, the column number of employees faecal matter be be as a singular key, because each value in column identifies nevertheless one employee. No two employees female genitals imbibe the same number of workers.The mechanism employ to carry out uniqueness of the so-called index unique key. Unique index table is a column, or a collection of rules of ordered columns, each of which identifies value (specify function) unique rows. A unique index can fit NULL values.The key is one unique key defined on the table, scarce was selected as the first impor tant key. There can be only one primary key on the table.A primary index is automatically take a shitd for the primary key. The main index use by the database manager for efficient access to table rows, and allows the database manager to enforce the uniqueness of the primary key. (You can also specify non-primary index key columns efficiently access the data when processing the query.)If the table does not draw a natural unique key, or if the order of arrival is a method utilize to distinguish unique rows, use a time stamp as part of the key can help.Example of Primary chance uponPROJNO (Primary tombstone)PROJNAMEDEPTNOMA2100Weld Line automationD01MA2110Weld Line computer programingD11Example 1If each column in the table contains reprize values, it cannot determine the key with rightful(prenominal) one column. A key with more than one column is a composite key. The combine of column values should define a unique entity. If a composite key cannot be slow defined, it can al so be considered to pee-pee a new column with unique values.EMPNO(Primary Key)PROJNO(Primary Key)ACTNO(Primary Key)EMPTIMEEMSTDATE(Primary Key)000250AD3112601.01982-01-01000250AD31126051982-02-01000250AD31127051982-02-01 distant KeyA foreign key is a subject area in a table corresponding relationship with the early(a) candi bodyguard key table. impertinent keys can be used to cross-reference table.For example, suppose we have two tables, node that includes all customer data, and the order table that includes all customer orders. Intention here is that all orders must(prenominal) be associated with a client who is in the customer table. To do this, we will place a foreign key in the order table and it relates to the key customer table.Identifying foreign key column or set of columns in a table that refers to a column or set of columns in another table. Column in the table must reference the key pillars or other super key in the referenced table. Value in a reference column not e of hand must occur in a single row in the referenced table. Thus, a row in the reference table cannot contain values that do not exist in the referenced table (except potentially null). In this way a reference can be made to link information to push backher and it is an important part database normalization. unlike rows in the table reference may refer to the same row in the referenced table. Most of the time, it reflects a ( leaven table or reference table) to many (child table, or referencing table) relationship.Example Foreign KeyBelow is an example of the relationship between the Company and also schedules, Contact. Tables in the ships company is the parent of a link. In child contact schedule, Field CompanyID the table to state the contact contacted the company owned.The role of the Son (Multiplicity)Diversification foreign key defines how many records in the child table can link to records in the master table. In the above example the childs diversity since a company can have any number of contacts.ExamplePrimary Key Foreign Key RelationshipIt have a Primary Foreign Key, in this figure it have a relationship between this two keys. e.g. superstar to One , One to Many , Many to Many.Primary key.This is indicated by the Primary Key field equivalent to the schedule. this turn outs that the field that identifies a unique record. For example, Product_ID product and ORDER_ID for Order the values that are normally produced by the field is Auto-rise. they do not have any intrinsic meaning and only integers are automatically generated one by one.Primary Key and Foreign Keys.This indicated that the PF with the field in the table.In this parapraxis, the field is also created as a key example of this attitude in the Schedule of Key, Primary Key in Table Customer_Orders_Products is a composite key, consisting of two fields. The product_id is the Primary Key in the table Products, and ORDER_ID is the Primary Key in the table Customer_Orders.One-to-Many Relatio nship.One-to-Many very common in the real world, and it is very easy to read that A Parents can have a lot of children. In this figure shows that, One Product can be attributed to Customer_Orders_Products the Many. The line between product and Customer_Orders_Products is unceasing line (not small dotted lines). This means that the product_id field is the Primary Key in Table Customer_Orders_Products. A dotted line will show the existence of a Foreign Key.Many-to-Many Relationships.Relationship Many-to-Many very important in the real world, and being able to see them all around us every day. For example, many customers may order the same product. Many products can be ordered by the same customer. This is called Relationship Many-to-Many. It can not be implemented directly in the Database Table relationships. The solution is to create an mediate table that records all the combinations that exist between the Customer and Product. For example, if a customer who ordered three products, then there will be three records for that customer in an average table. Low key combination to be a parent table primary key intermediate in this table. We also need to allow for comments like Make it stronger,. If we get to the right database structure, then it is very easy to extend it.Question 2Explain the main characteristics and advantages of the following terms.a ) Relational Databaseb) Object lie Databasec) Object Relational DatabaseRelational DatabaseCan be connected to a database with a collection of data items is strongly recommended as a set and the name of the Minister of Finance official explained from Any data easily accessible. A database was created using the ensample relations relationship. The software used in database relations database management schema called Relations. A relationship database is the preferred superior in storing data, as compared to other models such as the hierarchical database model or network model. The first database is been commence d in 1970, namely by Edgar Codd.Advantages of Relational DatabaseAvoid ErrorThere is only a single entrepot location for any piece of information, sodata update is easy without having to change the same information in 15 opposite files.info is always up to date there is no chance of be old data in some forgotten file.Number and dateno typos such as 10, 10, 10, not 10.avoid problems such as data symbol in Excel dreaded syndrome.avoid thrown-away(prenominal) text-to-date conversion like November 12 to be November 12 1900.Error checking data as they are enteredvalidated data on data entry, to trickle the impossibledata can be cross-checked against existing information.Manipulate DataWith databases it can combine different data easily. No more fallible cut-and-paste to force data into different formats. Do away with all intermediate Excel spreadsheet that is often generated when manipulating data. (And which you often darent delete secure in case they contain important informat ion.)Data manipulation is done by using a query. This means Structured Query Language, SQL, to merge, update and manage data, but most users do not need to know any SQL to bring about complex tasks. In Microsoft Access, for example, Visual Query Builder provides a simple, self-generated interface makes most queries.Visualize DataA database is being set can reveal new areas for investigation to present large quantities of data in an intuitive form.Often the patterns become apparent only by flicking through data. With this special database it is possible in new ways data from many different sources can be brought together and displayed quickly and and fast. blend with digestEnds with an Excel file to a multi-analysis, each subtlety different? Never sure that the correct file is not delete any, just in case.With a relational database, this is the dilemma of the past. Your data set for analysis is created using queries stored in the database. No copy is made of data, but kinda you link to query directly from the statistics.Object Oriented DatabaseReduced nutrimentThe main goal of the endeavor-oriented development is a guarantee that the system will enjoy a longer life while having maintenance be much less. This is because most of the processes in the system contained, behavior that can be reused and will be included in the most recent behavior. The net goal is for the new object-oriented developmentReal World ModelingObjects in operation(p) system is very prone to model the real world in a more complete fashion than do traditional methods. Objects that have been organized into a class of objects, object-related behaviors. Based on the object, rather than on data and processing onlyImproved Reliability and FlexibilityObject-oriented system to be far more reliable than traditional systems, especially in the new behavior can be built from existing objects. Because objects can be dynamically called and accessible, new objects can be created at any time. New objects can inherit data attributes from one, or many other objects. Behavior that can be inherited from the super-class, and novel behavior can be added without performing the functions of the existing system.Object Relational DatabaseDatabase Object capabilities can be expanded with additional ties and new data types, access methods and functions on hand(predicate) in object oriented programming. it can add character describe with alpha-numeric data types. Complex data types can combine features of data types that already exist in the database. here it is able to determine the data type of text containing desired time or with the number of bytes used to create user defined data types can be opaque or own. it can also add user-defined virtual processors.EncapsulationBy using encapsulation of database object you want to contact in the form of a table. For example, Table 1 includes the name, address, phone number and email address for contact. Through class encapsulating Contacts, it just combines all this information in a table on this one. So when you query the database for this information, you generate a report in a sprint designed to include all of this information.AppendixPROJNO (Primary Key)PROJNAMEDEPTNOMA2100Weld Line AutomationD01MA2110Weld Line ProgrammingD11EMPNO(Primary Key)PROJNO(Primary Key)ACTNO(Primary Key)EMPTIMEEMSTDATE(Primary Key)000250AD3112601.01982-01-01000250AD31126051982-02-01000250AD31127051982-02-01

No comments:

Post a Comment