1. Consider a Relation that holds attributes of courses and sections at a university: R = CourseNo, SecNo, OfferingDept, CreditHours, CourseLevel, InstructorSSN, Semester, Year, Days Hours, RoomNo, NoOfStudents Assume that the following functional dependencies hold:
• CourseNo → Offering Dept, CreditHours, CourseLevel
• CourseNo, SecNo, Semester, Year → Days Hours, RoomNo, NoOfStudents, InstructorSSN
• RoomNo, Days Hours, Semester, Year → InstructorSSN, CourseNo, SecNo Normalize Relation R upto 3NF.
2. Consider the relation for published books: Book = Book title, AuthorName, Book type, ListPrice, Author affil, Publisher Author affil refers to affiliation of the author. Assume that the following FDs exist: • Book title → Publisher, Book type • Book type → ListPrice • AuthorName → Author affil Apply normalization to Book relation until 3NF
can you please show 1nf 2nf and 3nf
thank you
1.to explain in a simplest way,
All the attributes in the right hand side of functional dependencies can be derived so attributes that are not in right hand side of functional dependencies should be present in candidate key
Now, closure of an attribute is the set of those attributes which can be derived from the closure attribute
So closure of course No is {Course No}+ = {Course No, Offering Dept, CreditHours, CourseLevel} as courseNo can be derived from CourseNo simply ----(1)
{CourseNo, SecNo, Semester, Year}+ = {CourseNo, SecNo, Semester, Year, Days Hours, RoomNo, NoOfStudents, InstructorSSN,Offering Dept, CreditHours, CourseLevel} = R -----(2)
Now, {RoomNo, Days Hours, Semester, Year}+ = {RoomNo, Days Hours, Semester, Year,InstructorSSN, CourseNo, SecNo} now as {Course No}+ = {Course No, Offering Dept, CreditHours, CourseLevel}} we can substitute that and get
{RoomNo, Days Hours, Semester, Year}+ = {RoomNo, Days Hours, Semester, Year,InstructorSSN, CourseNo,Offering Dept, CreditHours, CourseLevel, SecNo}
From (2) we can say {CourseNo, SecNo, Semester, Year}+ contained {NoOfStudents} as well
So, {RoomNo, Days Hours, Semester, Year}+ will contain {NoOfStudents} too
So, {RoomNo, Days Hours, Semester, Year}+ = {RoomNo, Days Hours, Semester, Year,InstructorSSN, CourseNo,Offering Dept, CreditHours, CourseLevel, SecNo,NoOfStudents} = R ------(3)
From (2) and (3) we can say, following both are candidate keys:
Key1 = {CourseNo, SecNo, Semester, Year}
Key2 = {RoomNo, Days Hours, Semester, Year}
The relationship is in 1NF but not in 2NF
Now for 2NF, we can see CourseNo → Offering Dept, CreditHours, CourseLevel is a partial dependency for Key1 as CourseNo is there in Key1 So 2NF form of the Relation R is as follows:
R1 = {Course no, Offering dept, Credit hours, Course level}
R2 = {Course no, Sec no, Instructor ssn, Semester, Year, Days hours, Room no, No of students}
As there is no transitive dependency of R1 and R2 on candidate keys , we can safely say R1 and R2 are in 3NF also
2. Candidate key has been found as {BookTitle , AuthorName} as
{BookTitle , AuthorName}+ = {BookTitle , AuthorName,Publisher,Book type,Author affil } = {BookTitle , AuthorName,Publisher,Book type,ListPrice,Author affil } as {Book type}+ = {Book type,ListPrice} [substituted for {Book type}]
So, {BookTitle , AuthorName}+ = Book
The relationship is in 1NF
The relationship is not in 2NF as no attributes are totally functionally dependent on the key
So, required 2NF decomposition is
B1 = {BookTitle, AuthorName}
B2 = {BookTitle, BookType, ListPrice, Publisher}
B3 = {AuthorName, AuthorAffil}
The above relation is not in 3NF as there is transitive dependency BookTitle->BookType->ListPrice and BookType is not a key
Required decomposition
B1 = {BookTitle, AuthorName}
B21 = {BookTitle, BookType, Publisher}
B22 = {BookType,ListPrice}
B3 = {AuthorName, AuthorAffil}
1. Consider a Relation that holds attributes of courses and sections at a university: R =...
Consider the following relation for published books: BOOK(Book title, Author_name, Book type, List price, Author affil, Publisher) Author_affil refers to the affiliation of author. Suppose the following dependencies exist: Book title Publisher, Book type Book type List price Author_name > Author affil (a) What normal form is the Book relation in? Why? (b) Decompose Book into 2NF relations. . (c) Decompose Book into 3NF relations.
Consider the following relation R, where {A, B} is its PK. Assume that R is in the first normal form (INF). R (A, B, C, D, E, F) Functional dependencies: FD1: BàC FD2: AàDE FD3: ABàF Why is this table not in 2NF? Specify which FDs make R violate 2NF. Normalize the data shown in this table to second normal form (2NF). Specify the primary and foreign key (if any) in each table of your 3NF relations. Normalize the data...
Question: Consider the following relation for published books: BOOK (Book title, Author_name, Book_type, List_price, Author_affil, Publisher) Author _affil refers to the affiliation of an author. Suppose the following dependencies exist Book_title Publisher, Book type Book-type → List-pricej Author name → Authoraffil - a. What normal form is the relation in? Explain your answer.
Consider relation R = (A,B,C,D,E) for the following: 2. Is R in 2NF with the following functional dependencies? If not, normalize it. [5 points] A→BC -AD → E в с 3. Are the relations from the answer of question 2 in 3NF? If not normalize it. 5 points]
Question 1: Functional Dependencies [7 marks Consider a relation R on attributes (A, B, C, D, E, F,G, H) and the following functional dependen- cies. B →G C →D DE →GC → EF DEF → H (a) What is the closure of [F, G, Hy? (b) List all of the candidate keys of R under the dependencies above. (c) List all of the FDs above that are 3NF violations (d) List all of the FDs above that are BCNF violations....
Consider the relation R(A,B,C,D) with FDs A -> B, C -> D, AD -> C, BC -> A. Check for both BCNF and 3NF status. Which of the following is the most accurate summary of the results?R is in BCNF and 3NF. No normalization is necessary.R is in 3NF but not in BCNF. We should try normalizing to BCNF, but this results in information being lost. As such, we stay with the original schema.R is in BCNF but not in 3NF....
Language: SQL - Normalization and Functional Dependencies Part 4 Normalization and Functional Dependencies Consider the following relation R(A, B, C, D)and functional dependencies F that hold over this relation. F=D → C, A B,A-C Question 4.1 (3 Points) Determine all candidate keys of R Question 4.2 (4 Points) Compute the attribute cover of X-(C, B) according to F Question 43 (5 Points) Compute the canonical cover of F.Show each step of the generation according to the algorithm shown in class....
Answer the following questions: Consider the relation schema R = (N. Y, P. M. and assume that the following set of functional dependencies holds on R: The letters can be interpreted as follows: R=(Model_Number. Year, Price, Manufacturing Plant Color). 1. [25 points] Give a lossless.join decomposition of Rinto Boyce-Codd normal form. Make sure to use the algorithm studied in class (Figure 7.11, page 331 of the book) and to show all details. 2. [25 points] Does your decomposition preserve functional dependencies? Justify your...