Concept explainers
a.
Normalization:
The process used to minimize data redundancy and dependency in a relational
Second normal form (2NF):
- The value of all non-primary key attributes should be dependent on the primary key attribute.
- If any attribute is depending on the partial primary key then it should determine the other attributes for an instance of the entity.
- The partial dependencies should be removed from the data model.
Third normal form (3NF):
- The value of any non-primary key attributes will not depend on any other non-primary key attributes.
- If any non-primary key attributes depend on any other non-primary key attribute then it should be moved or deleted.
- It is termed as transitive dependency.
Partial dependency:
A partial dependency exists at that time of an attributes depends only a part of primary key. This dependency is related with 1st normal form.
Transitive dependency:
A transitive dependency exists at that time of an attributes depends on another attribute which is not part of primary key.
Functional dependency:
An association between two attributes or two set of attributes in a same relational database table, which is having some constraints is known as functional dependency.
- In a table one attribute is functionally dependent on another attribute to take one value.
a.
Explanation of Solution
Construct the dependency diagram with all partial and transitive dependencies:
The relational schema for given INVOICE table is given below:
Invoice(INV_NUM, PROD_NUM, SALE_DATE, PROD_LABEL, VEND_CODE, VEND_NAME, QUANT_SOLD, PROD_PRICE)
- Here, “INV_NUM” and “PROD_NUM” indicates the primary key.
The representation of dependency diagram with all partial and transitive dependencies is shown below:
Explanation:
In the above dependency diagram,
- The partial dependencies are,
INV_NUM -> (SALE_DATE)
PROD_NUM -> (PROD_LABEL, VEND_CODE, VEND_NAME, PROD_PRICE)
- The transitive dependency is,
VEND_CODE -> (VEND_NAME)
b.
Normalization:
The process used to minimize data redundancy and dependency in a relational database is known as normalization. The database table is divided into two or more tables and defines the relationship between those tables.
Second normal form (2NF):
- The value of all non-primary key attributes should be dependent on the primary key attribute.
- If any attribute is depending on the partial primary key then it should determine the other attributes for an instance of the entity.
- The partial dependencies should be removed from the data model.
Third normal form (3NF):
- The value of any non-primary key attributes will not depend on any other non-primary key attributes.
- If any non-primary key attributes depend on any other non-primary key attribute then it should be moved or deleted.
- It is termed as transitive dependency.
Partial dependency:
A partial dependency exists at that time of an attributes depends only a part of primary key. This dependency is related with 1st normal form.
Transitive dependency:
A transitive dependency exists at that time of an attributes depends on another attribute which is not part of primary key.
Functional dependency:
An association between two attributes or two set of attributes in a same relational database table, which is having some constraints is known as functional dependency.
- In a table one attribute is functionally dependent on another attribute to take one value.
b.
Explanation of Solution
Construct the dependency diagram by removing all partial dependencies:
The new dependency diagram is represented by removing all partial dependencies in INVOICE table.
First table:
The relational schema for first table is given below:
3NF(INV_NUM, PROD_NUM, SALE_DATE, QUANT_SOLD)
- Here, “INV_NUM” and “PROD_NUM” indicates the primary keys.
- The relation is in third normal form (3NF), since there is no transitive dependency and no repeated attributes.
The representation of dependency diagram removes all partial dependencies in first table are shown below:
Second table:
The relational schema for second table is given below:
3NF(INV_NUM, SALE_DATE)
- Here, “INV_NUM” indicates the primary key.
- The relation is in third normal form (3NF), since there is no transitive dependency and no repeated attributes.
The representation of dependency diagram removes all partial dependencies in second table are shown below:
Third table:
The relational schema for third table is given below:
2NF(PROD_NUM, PROD_LABEL, VEND_CODE, VEND_NAME, PROD_PRICE)
- Here, “PROD_NUM” indicates the primary key.
- The relation is in third normal form (2NF), since there is transitive dependency in table.
The representation of dependency diagram removes all partial dependencies in third table are shown below:
c.
Normalization:
The process used to minimize data redundancy and dependency in a relational database is known as normalization. The database table is divided into two or more tables and defines the relationship between those tables.
Second normal form (2NF):
- The value of all non-primary key attributes should be dependent on the primary key attribute.
- If any attribute is depending on the partial primary key then it should determine the other attributes for an instance of the entity.
- The partial dependencies should be removed from the data model.
Third normal form (3NF):
- The value of any non-primary key attributes will not depend on any other non-primary key attributes.
- If any non-primary key attributes depend on any other non-primary key attribute then it should be moved or deleted.
- It is termed as transitive dependency.
Partial dependency:
A partial dependency exists at that time of an attributes depends only a part of primary key. This dependency is related with 1st normal form.
Transitive dependency:
A transitive dependency exists at that time of an attributes depends on another attribute which is not part of primary key.
Functional dependency:
An association between two attributes or two set of attributes in a same relational database table, which is having some constraints is known as functional dependency.
- In a table one attribute is functionally dependent on another attribute to take one value.
c.
Explanation of Solution
Construct the dependency diagram by removing all transitive dependencies:
The new dependency diagram is represented by removing all transitive dependencies in INVOICE table.
First table:
The relational schema for first table is given below:
3NF(INV_NUM, PROD_NUM, QUANT_SOLD)
- Here, “INV_NUM” and “PROD_NUM” indicates the primary keys.
- The relation is in third normal form (3NF), since there is no transitive dependency and no repeated attributes.
The representation of dependency diagram removes all partial dependencies in first table are shown below:
Second table:
The relational schema for second table is given below:
3NF(INV_NUM, SALE_DATE)
- Here, “INV_NUM” indicates the primary key.
- The relation is in third normal form (3NF), since there is no transitive dependency and no repeated attributes.
The representation of dependency diagram removes all transitive dependencies in second table are shown below:
Third table:
The relational schema for third table is given below:
3NF(VEND_CODE, VEND_NAME)
- Here, “VEND_CODE” indicates the primary key.
- The relation is in third normal form (3NF), since there is no transitive dependency and no repeated attributes.
The representation of dependency diagram removes all transitive dependencies in third table are shown below:
Fourth table:
The relational schema for final table is given below:
2NF(PROD_NUM, PROD_LABEL, VEND_CODE, PROD_PRICE)
- Here, “PROD_NUM” indicates the primary key.
- The relation is in third normal form (3NF), since there is no transitive dependency and no repeated attributes.
The representation of dependency diagram removes all transitive dependencies are shown below:
d.
Explanation of Solution
The representation of Crow’s Foot Entity Relational Diagram (ERD) is shown below:
The following data model shows the solution for the given question.
Explanation:
- In the above data model, one invoice can contains many invoice line.
- The “INVOICE” entity contains the “INV_NUM” and “SALE_DATE” attributes.
- The primary key of “INVOICE” entity is “INV_NUM”.
- The “INV_LINE” entity contains the “INV_NUM”, “PROD_NUM” and “QUANT_SOLD” attributes.
- The primary and foreign key of this entity is “INV_NUM”.
- The foreign key of this entity is “PROD_NUM”.
- The “INVOICE” entity contains the “INV_NUM” and “SALE_DATE” attributes.
- The product is written in more than one invoice line.
- The “PRODUCT” entity contains the “PROD_NUM”, “VEND_CODE”, “PROD_LABEL”, and “PROD_PRICE” attributes.
- The primary key of “PROD_NUM” for this entity.
- The foreign key of this entity is “VEND_CODE”.
- The “PRODUCT” entity contains the “PROD_NUM”, “VEND_CODE”, “PROD_LABEL”, and “PROD_PRICE” attributes.
- The vendor supplies more than one product.
- The “VENDOR” entity contains the “VEND_CODE” and “VEND_NAME” attributes.
- The primary key of “VEND_CODE” entity.
- The “VENDOR” entity contains the “VEND_CODE” and “VEND_NAME” attributes.
Want to see more full solutions like this?
Chapter 6 Solutions
Database Systems: Design, Implementation, & Management
- Activity No. Activity Time (weeks) Immediate Predecessors 1 Requirements collection 3 2 Requirements structuring 4 1 3 Process analysis 3 2 4 Data analysis 3 2 5 Logical design 50 3,4 6 Physical design 5 5 7 Implementation 6 6 c. Using the information from part b, prepare a network diagram. Identify the critical path.arrow_forwardGiven the following Extended-BNF grammar of the basic mathematical expressions: Show the derivation steps for the expression: ( 2 + 3 ) * 6 – 20 / ( 3 + 1 ) Draw the parsing tree of this expression. SEE IMAGEarrow_forwardWhentheuserenters!!,themostrecentcommandinthehistoryisexecuted.In the example above, if the user entered the command: Osh> !! The ‘ls -l’ command should be executed and echoed on user’s screen. The command should also be placed in the history buffer as the next command. Whentheuserentersasingle!followedbyanintegerN,theNthcommandin the history is executed. In the example above, if the user entered the command: Osh> ! 3 The ‘ps’ command should be executed and echoed on the user’s screen. The command should also be placed in the history buffer as the next command. Error handling: The program should also manage basic error handling. For example, if there are no commands in the history, entering !! should result in a message “No commands in history.” Also, if there is no command corresponding to the number entered with the single !, the program should output "No such command in history."arrow_forward
- Activity No. Activity Time (weeks) Immediate Predecessors 1 Requirements collection 3 2 Requirements structuring 4 1 3 Process analysis 3 2 4 Data analysis 3 2 5 Logical design 50 3,4 6 Physical design 5 5 7 Implementation 6 6 c. Using the information from part b, prepare a network diagram. Identify the critical path.arrow_forward2. UNIX Shell and History Feature [20 points] This question consists of designing a C program to serve as a shell interface that accepts user commands and then executes each command in a separate process. A shell interface gives the user a prompt, after which the next command is entered. The example below illustrates the prompt osh> and the user's next command: cat prog.c. The UNIX/Linux cat command displays the contents of the file prog.c on the terminal using the UNIX/Linux cat command and your program needs to do the same. osh> cat prog.c The above can be achieved by running your shell interface as a parent process. Every time a command is entered, you create a child process by using fork(), which then executes the user's command using one of the system calls in the exec() family (as described in Chapter 3). A C program that provides the general operations of a command-line shell can be seen below. #include #include #define MAX LINE 80 /* The maximum length command */ { int…arrow_forwardQuestion#2: Design and implement a Java program using Abstract Factory and Singleton design patterns. The program displays date and time in one of the following two formats: Format 1: Date: MM/DD/YYYY Time: HH:MM:SS Format 2: Date: DD-MM-YYYY Time: SS,MM,HH The following is how the program works. In the beginning, the program asks the user what display format that she wants. Then the program continuously asks the user to give one of the following commands, and performs the corresponding task. Note that the program gets the current date and time from the system clock (use the appropriate Java date and time operations for this). 'd' display current date 't': display current time 'q': quit the program. • In the program, there should be 2 product hierarchies: "DateObject” and “TimeObject”. Each hierarchy should have format and format2 described above. • Implement the factories as singletons. • Run your code and attach screenshots of the results. • Draw a UML class diagram for the program.arrow_forward
- #include <linux/module.h> #include <linux/kernel.h> // part 2 #include <linux/sched.h> // part 2 extra #include <linux/hash.h> #include <linux/gcd.h> #include <asm/param.h> #include <linux/jiffies.h> void print_init_PCB(void) { printk(KERN_INFO "init_task pid:%d\n", init_task.pid); printk(KERN_INFO "init_task state:%lu\n", init_task.state); printk(KERN_INFO "init_task flags:%d\n", init_task.flags); printk(KERN_INFO "init_task runtime priority:%d\n", init_task.rt_priority); printk(KERN_INFO "init_task process policy:%d\n", init_task.policy); printk(KERN_INFO "init_task task group id:%d\n", init_task.tgid); } /* This function is called when the module is loaded. */ int simple_init(void) { printk(KERN_INFO "Loading Module\n"); print_init_PCB(); printk(KERN_INFO "Golden Ration Prime = %lu\n", GOLDEN_RATIO_PRIME); printk(KERN_INFO "HZ = %d\n", HZ); printk(KERN_INFO "enter jiffies = %lu\n", jiffies); return 0; } /* This function is called when the…arrow_forwardList at least five Operating Systems you know. What is the difference between the kernel mode and the user mode for the Linux? What is the system-call? Give an example of API in OS that use the system-call. What is cache? Why the CPU has cache? What is the difference between the Static Linking and Dynamic Linking when compiling the code.arrow_forwardIn the GoF book, List interface is defined as follows: interface List { int count(); //return the current number of elements in the list Object get(int index); //return the object at the index in the list Object first(); //return the first object in the list Object last(); //return the last object in the list boolean include(Object obj); //return true is the object in the list void append(Object obj); //append the object to the end of the list void prepend(Object obj); //insert the object to the front of the list void delete(Object obj); //remove the object from the list void deleteLast(); //remove the last element of the list void deleteFirst(); //remove the first element of the list void deleteAll(); //remove all elements of the list (a) Write a class adapter to adapt Java ArrayList to GoF List interface. (b) Write a main program to test your adapters through List interface. (c) Same requirement as (a) and (b), but write an object adapter to adapt Java ArrayList to GoF List…arrow_forward
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage LearningA Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr
- Principles of Information Systems (MindTap Course...Computer ScienceISBN:9781285867168Author:Ralph Stair, George ReynoldsPublisher:Cengage Learning