Question

In: Computer Science

(mysql)Lab 10 Database Normalization The relation (PatientLab) below provides some sample data for a clinic office...

(mysql)Lab 10 Database Normalization

The relation (PatientLab) below provides some sample data for a clinic office that stores patient, insurance, lab test, and lab test result information. The relation is already in first normal form (1NF). Assuming that one patient can have multiple different tests performed in one day and same test can be performed for the same patient in different dates.

Patient _ID

Name

Insurance_Code

Insurance_Name

DOB

Lab_Test_ID

Lab_Test_Name

Lab_Result

Lab_Test_Date

P001

Joe Doe

IN001

B&B

1/1/1990

L001

WBC

5

5/5/2019

P001

Joe Doe

IN001

B&B

1/1/1990

L002

RBC

5.2

5/5/2019

P001

Joe Doe

IN001

B&B

1/1/1990

L003

MCV

90

5/5/2019

P002

John Smith

IN002

Aetna

2/2/1988

L002

RBC

5.8

5/6/2019

P002

John Smith

IN002

Aetna

2/2/1988

L004

MCH

32

5/6/2019

P001

Joe Doe

IN001

B&B

1/1/1990

L001

WBC

4.2

5/7/2019

1. Provide examples to show that insertion, deletion, and modification anomalies could occur on this table.

a. Insertion anomaly

b. Deletion anomaly

c. Update anomaly

2. Identify the functional dependencies represented by the attributes shown in the above table.   State any assumptions you make about the data and the attributes.

Note: Assume that the primary key is (Patient_ID, Lab_Test_ID, Lab_Test_Date) which fully functionally determines the Lab_Result.

Patient _ID

Name

Insuranc_Code

Insurance_Name

DOB

Lab_Test_ID

Lab_Test_Name

Lab_Result

Lab_Test_Date

3. Describe and illustrate the process of normalizing the table shown above to 3NF. Identify the primary keys and foreign keys in your resulting relations after 3NF.

1NF: (Find any repeating group and process it if there is any.)

Relations after 1NF

2NF: (Find any partial dependency and process it if there is any.)

Relations after 2NF

3NF: (Find any transitive dependency and process it if there is any.)

Relations after 3NF (Show primary key and foreign key in each relation.)

Q: answer for 1,2,3 plz

Solutions

Expert Solution

Answer 1)

a)

Insertion anomaly is the inability of a database to add a new record to an existing database due to the absence of the other attributes.

In the given database if we want to add a new Patient detail in the table we won’t be able to add unless we have Lab test detail also. Here both Patient_ID and Lab_test_ID are combined identifier of the table hence one record cannot be added in the absence of other value.

b)

Delete anomaly in a database exist when certain attributes are lost from a table because of the deletion of other attributes.

In the given database, if we want to delete a particular Patient then all the associated Lab test detail will also get deleted.

c)

Update anomaly is a database exist when one or more instances of duplicate data is updated, but not all.

For the given database, suppose the name of a lab test ID L001 need to be changed. This can not be done easily because of the multiple occurrence of the lab test ID L001.


Related Solutions

Using the sample.sql script, create the sample database in MySQL. Submit the MySQL interactive screen that...
Using the sample.sql script, create the sample database in MySQL. Submit the MySQL interactive screen that results. create database sample; use sample; create table customer (custno int auto_increment primary key, firstname varchar(20), middle varchar(20), lastname varchar(20), address varchar(60), telnum1 varchar(10), telnum2 varchar(10), telnum3 varchar(10), pin varchar(6), email varchar(30)); create table accttype (id int primary key, type varchar(10)); insert into accttype (id, type) values (1,'check'); insert into accttype (id, type) values (2,'save'); insert into accttype (id, type) values (3,'cd'); insert into...
Part #4: Data normalization: Background: Data in a relational database is stored in a normalized form....
Part #4: Data normalization: Background: Data in a relational database is stored in a normalized form. Data normalization or just normalization is a strategy used to organize data into multiple related tables to reduce data redundancy while preserving data integrity. Exercise: Normalize the student data in the University table (sample data is shown further below) into 3 tables, namely, Student, Department, and Course. You do not need to populate data. Just illustrate the schema for the 3 tables. You may...
using mysql and the schema is provided below. thanks In this lab, you will be manipulating...
using mysql and the schema is provided below. thanks In this lab, you will be manipulating the database to add, delete and modify the values in the database. Please use a "select * from..." after each query to show the effects of your data manipulation query. 1. The title 'Time Flies' now has a new track, the 11th track 'Spring', which is 150 seconds long and has only a MP3 file. Insert the new track into Tracks table (Don’t hand-code...
PHP, JAVASCRIPT, MYSQL below is what I have. Can fill in the details for the database...
PHP, JAVASCRIPT, MYSQL below is what I have. Can fill in the details for the database 5. “Login to DB”, “Logout DB”, sub-menus of “File” 5.1 _____ When the user selects “Login to DB”, a window should popup asking the user to enter login and password. Your program should verify the login and password against the DV_User table in the datamining database. A corresponding message should be shown in the message area when the login failed or successful. If it...
the mysql lyrics database is provided below 1.)What is a primary key used for? Can you...
the mysql lyrics database is provided below 1.)What is a primary key used for? Can you give me an example of a primary key in the Lyrics database? 2.)What is the purpose of doing a join between two tables. Ex. Why would I ever want to join the Tracks and Titles tables together? 3.)Why is isolation important in database design? DROP TABLES IF EXISTS Artists,Genre, Members, Titles, Tracks,SalesPeople,Studios,XrefArtistsMembers; DROP TABLES IF EXISTS Authors,Publishers,Titles,Title_Authors,Royalties; DROP TABLES IF EXISTS Products,Customers,Orders,Order_details; DROP TABLES...
using the lyrics database schema in mysql provided below. 1.)List the artist name of the artists...
using the lyrics database schema in mysql provided below. 1.)List the artist name of the artists who do not have a webaddress and their leadsource is “Directmail”? 2.)List the names of members in the artist called 'Today'. 3.)Report the total runtime in minutes FOR EACH album in the Titles table. 4.)List the firstname, lastname of members who are represented by the salesperson “Lisa Williams” 5.)List EACH salesperson’s firstname along with the number of Members that EACH SalesPerson represents. below is...
Normalization: Answer all 4 questions. You are given the following relation R and some functional dependencies....
Normalization: Answer all 4 questions. You are given the following relation R and some functional dependencies. R(SID, Project, Code, ListOfSupplies, Name, Initials, Abbrev) Project → ListOfSupplies SID → Name Name → Initials Project, Initials → Abbrev SID, Project → Code Code → SID Is R in 1NF? If not, normalize R into a collection of 1NF relations. Is R in 2NF? If not, normalize R (or your collection of 1NF relations) into a collection of 2NF relations. Is R in...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The first database table will contain the names of at least four movies. The second table will be a list of actors who appear in the movies. The third table will be an associative table that describes the relationship between the actors and their movies (which actors appear in which movies). Actors and movies have a “many-to-many relationship,” meaning an actor can be in multiple...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The first database table will contain the names of at least four movies. The second table will be a list of actors who appear in the movies. The third table will be an associative table that describes the relationship between the actors and their movies (which actors appear in which movies). Actors and movies have a “many-to-many relationship,” meaning an actor can be in multiple...
Data Manipulation In this lab, you will be manipulating the database to add, delete and modify...
Data Manipulation In this lab, you will be manipulating the database to add, delete and modify the values in the database. Please use a "select * from..." after each query to show the effects of your data manipulation query. 1. The title 'Time Flies' now has a new track, the 11th track 'Spring', which is 150 seconds long and has only a MP3 file. Insert the new track into Tracks table (Don’t hand-code any data for insert that can be...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT