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...
This is t a relational database please write SQL queries to solve the listed questions. The...
This is t a relational database please write SQL queries to solve the listed questions. The database is a variation of the “Movie Database” . There are several differences in it, so look it over carefully before writing your SQL queries Notes: TheaterNum, MovieNum, and ActorNum are numeric primary key fields in their respective tables. Movie and actor names are not assumed to be unique unless specified otherwise in a question. In the THEATER table, Capacity is the number of...
Use MYSQL to create the set of database tables of the relational database model and complete...
Use MYSQL to create the set of database tables of the relational database model and complete the associated queries given. Procedure: 1) Write all the SQL statements, necessary to create all tables and relationships, with Primary & Foreign keys. 2) Execute each statement in the correct order to create the relational database in MYSQL. 3)Insert some data into each table. 4) Use all your SQL create and Insert statements (from MS Word) to execute in the MYSQL WorkBench 5) Write...
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...
SQL This assignment aligns with the following objectives: Create a relational database containing at least three...
SQL This assignment aligns with the following objectives: Create a relational database containing at least three tables Populate the database using the INSERT command Create integrity constraints on the tables created Deli has hired you as a consultant to design a database for the deli. They have provided you with the following information: Every employee has a social security number, name, salary, and date of hire. The deli is organized into several departments. Each department has a unique name. Each...
in reference to SQL Database, what are some benefits of creating sequences, indexes, and synonyms?
in reference to SQL Database, what are some benefits of creating sequences, indexes, and synonyms?
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT