Question

Theory. Describe the ERD to Relations algorithm. We are interested in the steps and a brief...

  1. Theory. Describe the ERD to Relations algorithm. We are interested in the steps and a brief description.
  2. Theory. What is an integrity constraint? Provide an example for an airline system.
  3. Set Theory. Let S = {d, b} and T = {1, 7, 3}, computer:
    • T X S =
    • S X T =
    • |S| =
    • S T =
  4. Transactions. What are the 4 properties of transactions? Explain each of them succinctly.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

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:
Person Name Phone Email Lastname
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.

Phone Person Name


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

Name Wife Have Email Lastname Person Phone Name
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:
Addres House Num IN Has Email Lastname Person Phone Name
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:
Addres Country Num Has Email Lastname N Person Phone Name
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.

  • Integrity constraints are a set of rules. It is used to maintain the quality of information.
  • Integrity constraints ensure that the data insertion, updating, and other processes have to be performed in such a way that data integrity is not affected.
  • Thus, integrity constraint is used to guard against accidental damage to the database.

For example, consider the following instances of three relations:

      Passenger       Flight       BookedOn
     
id name city
001 Tom Brady San Mateo, CA
002 David Ortiz Santo Domingo, Dom. Rep
003 Kevin Youkilis Cincinnati, Oh
004 Ray Allen Riverside, CA
005 Kevin Garnett Greenville, SC
006 Zdeno Chara Trencin, SVK
     
number origin destination
DL5882 Boston, MA Indianapolis, IN
BA215 London, United Kingdom Boston, MA
AA573 Boston, MA Miami, FL
LH422 Frankfurt, Germany Boston, MA
UA717 Boston, MA Los Angeles, CA
UA898 Beijing, China Boston, MA
     
person flight
005 UA898
002 AA573
005 UA717
006 BA215
001 DL5882
004 DL5882

Notes:

  • Every person in the Passenger relation has a unique value for the id attribute.
  • Every flight in the Flight relation has a unique value for the number attribute.
  • The BookedOn relation captures the relationships between people and the flights on which they are booked.
    • Example: the tuple (001, DL5882) in BookedOn tells us that Tom Brady (001) is booked on a flight from Boston to Indianapolis (DL5882).

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.

Add a comment
Know the answer?
Add Answer to:
Theory. Describe the ERD to Relations algorithm. We are interested in the steps and a brief...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please help me with this answer. Performance Comparison for Dijkstra Algorithm and Bellman-Ford Algorithm Problem Description...

    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...

    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,...

    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...

    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...

    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...

    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....

    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...

    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...

  • Your internship term paper assignment is to do an interview-based term paper dealing with career ...

    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...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT