Question

In: Computer Science

Normalizing the Relational Model for the Student Project and Creating a Normalized SQL Database Patient (patientNo,...

Normalizing the Relational Model for the Student Project and
Creating a Normalized SQL Database

Patient (patientNo, name, address, phone, dateOfBirth, sex, insuranceCo, policyNo, relationshipToInsured)

Appointment(patientNo, apptdate, appttime, reason, staffNo, visitNo)

Visit(visitNo, patientNo, visitdate, visittime, duration, reason, visitType, visitCost, staffNo, roomNo)

Staff(staffNo, name, title, specialty, address, phone)

Availability(staffNo, availDate, startTime, endTime)

InsurancePolicy (company, policyNo, insuredName, policytype, medicalCoPay, labCoPay, pharmacyCoPay, startDate, endingDate)

DiagnosisMenu(diagCode, diagName)

ProcedureMenu(procCode, procName, cost)

Room(roomNo, roomType, condition)

PrescriptionScript(scriptNo, visitNo, dateWritten, itemPrescribed, quantityPrescribed, directions, numberRefills)

LabTest(testNo, prescriptionNo, testype, testDate, testTime, cost, result)

Diagnosis(visitNo, diagCode, dateOnset, symptons, severity, prognosis)

Referral(refNo, visitNo, refTo, reason)

Bill(invoiceNo, billDate, totalAmount, dueDate, patientNo, amountPaid)

Charge(invoiceNo, serviceType, serviceDate, amountCharged)

Payment(invoiceNo, date, amountPaid, patientPayer, insuranceCoPayer, insurancePolNoPayer)

Task 1:

Begin with the list of the tables that the entities and relationships from the E-R diagram mapped to naturally. For each table on the list, identify the functional dependencies. List the functional dependencies in a Microsoft Word document.

Task 2:

Normalize the relations to BCNF, placing the normalized relations in your Word document.

Task 3:

Then decide whether the resulting tables should be implemented in that form. If not, explain why in your Word document.

Task 4:

For each table, write the table name and write out the names, data types, and sizes of all the data items, Identify any constraints, using the conventions of the DBMS you will use for implementation. Add this information to your Word document.

Task 5:

Write and execute SQL statements to create all the tables needed to implement the design. Note that you will need to name your database something different then the name you previously used.

Task 6:

Create indexes for foreign keys and any other columns that will be used most often for queries.

Task 7:

Insert about five records in each table, preserving all constraints. Put in enough data to demonstrate how the database will function.

Task 8:

Write SQL statements that will process five non-routine requests for information from the database just created. For each, write the request in English, followed by the corresponding SQL command.

Task 9:

Create at least one trigger and write the code for it.

Solutions

Expert Solution

Functional Dependencies

Patient (patientNo, name, address, phone, dateOfBirth, sex, insuranceCo, policyNo, relationshipToInsured)

Fd:   patientNo -> name,address,phone, dateOfBirth,sex ,insuranceCo, policyNo, relationshipToInsured

Appointment(patientNo, apptdate, appttime, reason, staffNo, visitNo)

Fd : patientNo -> apptdate ,appttime ,reason ,staffNo ,visitNo

Visit(visitNo, patientNo, visitdate, visittime, duration, reason, visitType, visitCost, staffNo, roomNo)

Ed :visitNo-> patientNo,visitdate,visittime, duration, reason, visitType, visitCost, staffNo, roomNo

Staff(staffNo, name, title, specialty, address, phone)

Fd: staffNo-> name, title, specialty, address, phone

Availability(staffNo, availDate, startTime, endTime)

staffNo-> availDate, startTime, endTime

InsurancePolicy (company, policyNo, insuredName, policytype, medicalCoPay, labCoPay, pharmacyCoPay, startDate, endingDate)

policyNo-> company, insuredName, policytype, medicalCoPay, labCoPay, pharmacyCoPay, startDate, endingDate

DiagnosisMenu(diagCode, diagName)

diagCode-> diagName

ProcedureMenu(procCode, procName, cost)

procCode-> procName, cost

Room(roomNo, roomType, condition)

roomNo-> roomType, condition

PrescriptionScript(scriptNo, visitNo, dateWritten, itemPrescribed, quantityPrescribed, directions, numberRefills)

scriptNo-> visitNo, dateWritten, itemPrescribed, quantityPrescribed, directions, numberRefills

LabTest(testNo, prescriptionNo, testype, testDate, testTime, cost, result)

testNo-> prescriptionNo, testype, testDate, testTime, cost, result

Diagnosis(visitNo, diagCode, dateOnset, symptons, severity, prognosis)

diagCode-> visitNo, dateOnset, symptons, severity, prognosis

Referral(refNo, visitNo, refTo, reason)

refNo->visitNo, refTo, reason

Bill(invoiceNo, billDate, totalAmount, dueDate, patientNo, amountPaid)

invoiceNo->billDate, totalAmount, dueDate, patientNo, amountPaid

Charge(invoiceNo, serviceType, serviceDate, amountCharged)

invoiceNo->serviceType, serviceDate, amountCharged

Payment(invoiceNo, date, amountPaid, patientPayer, insuranceCoPayer, insurancePolNoPayer)

invoiceNo-> date, amountPaid, patientPayer, insuranceCoPayer, insurancePolNoPayer


Related Solutions

One of the characteristics of good relational database design is normalized tables. Discuss two ways in...
One of the characteristics of good relational database design is normalized tables. Discuss two ways in which normalization helps minimize data redundancy and anomalies such as insertion, deletion, and update anomalies. What are some other characteristics of good database design?
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...
The database design process for noSQL databases is different from one for relational (SQL) databases. As...
The database design process for noSQL databases is different from one for relational (SQL) databases. As we learned noSQL database does not require to have a predefined structure, except of creating a list of databases and the list of collections. Some of the noSQL databases (like MongoDB) allow to define certain rules that will define what should be the structure of the acceptable documents for each collection. As you may recall, when you need to store multiple data points in...
Data Modeling and Database Design (Database Concepts, Eighth Edition) The relational model is the most important...
Data Modeling and Database Design (Database Concepts, Eighth Edition) The relational model is the most important standard in database processing today. Why do you feel that this model has continued to be successful in the world of IT? What would happen if large corporations decided to reject this theory, and store their data using a non-relational model? Are there any success stories where this has happened?
Need answers for Normalization, Physical Design, Sql, And Security exam. 1. The database you're creating will...
Need answers for Normalization, Physical Design, Sql, And Security exam. 1. The database you're creating will be installed on a group of three servers. What feature of an enterprise RDBMS will allow one server to pick up the processing work if the main server becomes nonoperational? A. Failover B. Business intelligence C. Data warehouse D. Load balancing 2. What type of clause must you always use with DELETE or UPDATE to avoid inadvertently changing data elsewhere in the database? A....
Metal Holdings Inc. You have been assigned the task of creating a simple relational database using...
Metal Holdings Inc. You have been assigned the task of creating a simple relational database using SQLite database by the owner of “Metal Holdings” who is in the business of selling industrial metals to customers (mostly wholesale suppliers) who buy from the company. Your goal is to design and build a database that would be responsible for: Managing a product table containing all metals which at a minimum should provide information such as name, description and price of each metal...
Project: Building a Relational Database Management System  This project is where you show off your...
Project: Building a Relational Database Management System  This project is where you show off your ability to (1) translate a business requirement into a database design, (2) design a database using one-to-many and many-to-many relationships, and (3) know when to use LEFT and/or RIGHT JOINs to build result sets for reporting. An organization grants key-card access to rooms based on groups that key-card holders belong to. You may assume that users below to only one group. Your job is...
Listed below is the relational database schema for an online store(SQL/Java): MEMBER(last_name, first_name, email, password, user,street,...
Listed below is the relational database schema for an online store(SQL/Java): MEMBER(last_name, first_name, email, password, user,street, city, state, zip, card_type, card_no, expiration, name_on_card) book_SALE(listing_no, seller, isbn, condition, price) ORDERS(order_no, buyer, order_date, tot) ITEM(order_no, listing_no) BOOK(isbn, title, author, edition, publisher, keywords) The bold attribute(s) in a relation is the primary key of that relation. The italized attributes in some relations denote foreign keys. The seller attribute in the book_SALE relation is a foreign key to the user attribute in the MEMBER...
Listed below is the relational database schema for an online store(SQL/Java): MEMBER(last_name, first_name, email, password, user,street,...
Listed below is the relational database schema for an online store(SQL/Java): MEMBER(last_name, first_name, email, password, user,street, city, state, zip, card_type, card_no, expiration, name_on_card) book_SALE(listing_no, seller, isbn, condition, price) ORDERS(order_no, buyer, order_date, tot) ITEMS(order_no, listing_no) BOOK(isbn, title, author, edition, publisher, keywords) The bold attribute(s) in a relation is the primary key of that relation. The italized attributes in some relations denote foreign keys. Create/Define the table.
SQL query exercises: Consider the following database schema:                Product(maker, model, type)              &
SQL query exercises: Consider the following database schema:                Product(maker, model, type)                PC(model, speed, ram, hd, rd, price)                Laptop(model, speed, ram, hd, screen, price)                Printer(model, color, type, price) Consider the Drivers-Cars-Reserves DB for a small rental car company:                Drivers(id, name, rating, age)                Cars(vin, maker, model, year, color)                Reserves(did, vin, date) Give SQL statement each of the following operations: Find the colors of cars reserved by Smith. Find all id’s of drivers who have a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT