1.
1. Entities and Simple Attributes:
An entity type within ER diagram is turned into a table. You may
preferably keep the same name for the entity or give it a sensible
name but avoid DBMS reserved words as well as avoid the use of
special characters.
Each attribute turns into a column (attribute) in the table. The
key attribute of the entity is the primary key of the table which
is usually underlined. It can be composite if required but can
never be null.
Taking the following simple ER diagram:
The initial relational schema is expressed in the following format
writing the table names with the attributes list inside a
parentheses as shown below for
Persons( personid , name, lastname, email )
Persons and Phones are Tables. name, lastname, are Table Columns (Attributes).
personid is the primary key for the table : Person
2. Multi-Valued Attributes
A multi-valued attribute is usually represented with a double-line oval.
If you have a multi-valued attribute, take the attribute and turn
it into a new entity or table of its own. Then make a 1:N
relationship between the new entity and the existing one. In simple
words. 1. Create a table for the attribute. 2. Add the primary (id)
column of the parent entity as a foreign key within the new table
as shown below:
Persons( personid , name, lastname, email )
Phones ( phoneid , personid, phone )
personid within the table Phones is a foreign key referring to the personid of Persons
3. 1:1 Relationships
To keep it simple and even for better performances at data
retrieval, I would personally recommend using attributes to
represent such relationship. For instance, let us consider the case
where the Person has or optionally has one wife. You can place the
primary key of the wife within the table of the Persons which we
call in this case Foreign key as shown below.
Persons( personid , name, lastname, email ,
wifeid )
Wife ( wifeid , name )
Or vice versa to put the personid as a foreign key within the Wife table as shown below:
Persons( personid , name, lastname, email )
Wife ( wifeid , name , personid)
For cases when the Person is not married i.e. has no wifeID, the attribute can set to NULL
4. 1:N Relationships
This is the tricky part ! For simplicity, use attributes in the
same way as 1:1 relationship but we have only one choice as opposed
to two choices. For instance, the Person can have a
House from zero to many , but a
House can have only one Person.
To represent such relationship the personid as the
Parent node must be placed within the Child table as a foreign key
but not the other way around as shown next:
It should convert to :
Persons( personid , name, lastname, email )
House ( houseid , num , address,
personid)
5. N:N Relationships
We normally use tables to express such type of relationship.
This is the same for N − ary relationship of ER diagrams. For
instance, The Person can live or work in many countries. Also, a
country can have many people. To express this relationship within a
relational schema we use a separate table as shown below:
It should convert into :
Persons( personid , name, lastname, email )
Countries ( countryid , name, code)
HasRelat ( hasrelatid , personid , countryid)
Relationship with attributes:
It is recommended to use table to represent them to keep the design tidy and clean regardless of the cardinality of the relationship.
2.
For example, consider the following instances of three relations:
Passenger | Flight | BookedOn | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Notes:
NOTE: As per HOMEWORKLIB POLICY, I am allowed to answer only 2 questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.
Theory. Describe the ERD to Relations algorithm. We are interested in the steps and a brief...
Please help me with this answer. Performance Comparison for Dijkstra Algorithm and Bellman-Ford Algorithm Problem Description The shortest path problem is one of most important problems in graph theory and computer science in general. Shortest path problem is one of typical optimization problems. Given a graph G = (V,E), the goal is to nd a minimum cost path from s → t, s,t ∈ V . This variant is called one-to-one shortest path problem. Other variants are one-to-all (compute shortest...
1. A. Name the three planes and the positions they each describe to identify a unique position in the human body. B. Name the two major ventral body cavities plus the major organs found in them. C. Name the cavities that the heart and lungs reside in. D. Finally, list the six levels of organization in nature. 2. A. Describe the three components of an atom in terms of charge and location. Define atomic mass and atomic number. B. For...
You are running a physics experiment with n complicated steps that you must do in order, and students sign-up for some steps to help. Your experiment requires n steps, and each of the m students gives you a list of which steps they can help out with (steps require special skills). From experience, you know things run most smoothly when you have as little switching of shifts as possible. For example, if your experiment has <1, 2, 3, 4, 5,...
In the original flashcard problem, a user can ask the program to show an entry picked randomly from a glossary. When the user presses return, the program shows the definition corresponding to that entry. The user is then given the option of seeing another entry or quitting. A sample session might run as follows: Enter s to show a flashcard and q to quit: s Define: word1 Press return to see the definition definition1 Enter s to show a flashcard...
can anybody explain how to do #9 by using the theorem 2.7? i know the vectors in those matrices are linearly independent, span, and are bases, but i do not know how to show them with the theorem 2.7 a matrix ever, the the col- ons of B. e rela- In Exercises 6-9, use Theorem 2.7 to determine which of the following sets of vectors are linearly independent, which span, and which are bases. 6. In R2t], bi = 1+t...
All work must be shown. That is, you need to show the steps and calculations you used to arrive at every answer for credit - For example, I need to see which two numbers you divided to arrive at a particular S? value, F-ratio value, etc. The "Pygmalion Effect" refers to the effect of teacher expectations on student academic achievement and performance (for the classic study on this phenomenon, see Rosenthal & Jacobson, 1968; for a more recent review of...
The discussion: 150 -200 words. Auditing We know that computer security audits are important in business. However, let’s think about the types of audits that need to be performed and the frequency of these audits. Create a timeline that occurs during the fiscal year of audits that should occur and “who” should conduct the audits? Are they internal individuals, system administrators, internal accountants, external accountants, or others? Let me start you: (my timeline is wrong but you should use some...
C++ OPTION A (Basic): Complex Numbers A complex number, c, is an ordered pair of real numbers (doubles). For example, for any two real numbers, s and t, we can form the complex number: This is only part of what makes a complex number complex. Another important aspect is the definition of special rules for adding, multiplying, dividing, etc. these ordered pairs. Complex numbers are more than simply x-y coordinates because of these operations. Examples of complex numbers in this...
please HELP Your internship term paper assignment is to do an interview-based term paper dealing with career information on your field of career interest. Specifically, you will be interviewing three persons who currently work in the field you hope to enter. It is up to you to decide who to interview and how to define your field of interest. Your interest may be a broad category or you may have a very focused or specific interest. By attempting to define...