Question

Consider the following database schema used to track blood donations. The database has been in use...

Consider the following database schema used to track blood donations. The database has
been in use for several years and contains thousands of entries. Primary keys are Bolded
and foreign keys carry the same names as the primary keys they reference

Receptionist(RID, Name, Address, Phone#)

Donor (Name, Address, Phone#, SSN, Gender, DOB)

Blood(BID, Blood_type, Cost, Name, Phone#, NID)

Nurses(NID, Name, Address, Phone#)

Transfusions(PatientID, Date, Trans#, BID)

Question: Since donors may donate every 60 days, a collection date needs to be added to the
blood relation. How do we achieve this?

Homework Answers

Answer #1

All we need to do is to add a new column to the table blood using a simple alter table query.

The name of the column is collection_date. Since it defines the day on which the blood was collected, we need to have a datatype of date.Blood table already has a foreign key relation with the Donor table.

So, to achieve this, we need to fire a query like:

ALTER TABLE Blood ADD Collection_date date NOT NULL

and this will do the job.

Some check constraints might be needed to apply on this collection_date so as to check the donors can donate only once every 60 days.

To add the data for the collection-date for the past donations(if available) one can fire the update query to set the date or can have a default date for the past data.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Relational Algebra (50 pts): Consider the following database schema that keeps track of Sailors, Boats and...
Relational Algebra (50 pts): Consider the following database schema that keeps track of Sailors, Boats and the boats reserved by sailors. Sailors(sid, sname, rating, age) Boatsbid, bname, color) Reserves(sid, bid, date) Keys are underlined in each relation. Specify the following queries in Relational Algebra using above database schema. (f) find the name of sailors with the highest rating (g) find the name and age of oldest sailors (h) find the age of youngest sailor for each rating level (i) find...
Consider the following set of requirements for a UNIVERSITY database that is used to keep track...
Consider the following set of requirements for a UNIVERSITY database that is used to keep track of students’ transcripts. This is similar but not identical to the database shown in Figure 1.2: a. The university keeps track of each student’s name, student number, Social Security number, current address and phone number, permanent address and phone number, birth date, sex, class (freshman, sophomore, ..., graduate), major department, minor department (if any), and degree program (B.A., B.S., ..., Ph.D.). Some user applications...
14.19. Suppose that we have the following requirements for a university database that is used to...
14.19. Suppose that we have the following requirements for a university database that is used to keep track of students’ transcripts: a. The university keeps track of each student’s name (Sname), student number (Snum), Social Security number (Ssn), current address (Sc_addr) and phone (Sc_phone), permanent address (Sp_addr) and phone (Sp_phone), birth date (Bdate), sex (Sex), class (Class) (‘freshman’, ‘sophomore’, … , ‘graduate’), major department (Major_code), minor department (Minor_code) (if any), and degree program (Prog) (‘b.a.’, ‘b.s.’, … , ‘ph.d.’). Both...
The county animal shelter has hired you to design a database to track the animals at...
The county animal shelter has hired you to design a database to track the animals at the shelter along with the people who adopt them. You have worked with the staff at the shelter, analyzed how they perform the work now, performed user requirements gathering and you have created a DFD. Below you will find the description of the entities and attributes defined during this process. Animal: animal_id, species, breed, age, gender, size, spay/neuter, intake_date, location, cost Adopter: name, phone,...
The county animal shelter has hired you to design a database to track the animals at...
The county animal shelter has hired you to design a database to track the animals at the shelter along with the people who adopt them. You have worked with the staff at the shelter, analyzed how they perform the work now, performed user requirements gathering and you have to create an ERD. Below you will find the description of the entities and attributes defined during this process. Animal: animal_id, species, breed, age, gender, size, spay/neuter, intake_date, location, cost Adopter: name,...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary to answer the queries that follow. Primary keys are underlined and foreign key fields have an asterisk at the end of the field. CUSTOMERS (CUST-NO, C-NAME, C-ADDRESS, BALANCE) SALESPERSONS (SP-NO, S-NAME, DATE-EMPLOYED, SALARY) SALES (INVOICE-NO, DATE, CUST-NO*, SP-NO*) a) List the salesperson name and salary for all sales to customers whose balance outstanding is greater than 20000. b) List the names and addresses of...
using mysql lyrics.database. i will provide the lyrics schema database info below 1. List the first...
using mysql lyrics.database. i will provide the lyrics schema database info below 1. List the first name, last name, and region of members who do not have an email. 2. List the first name, last name, and region of members who do not have an email and they either have a homephone ending with a 2 or a 3. 3. List the number of track titles that begin with the letter 's' and the average length of these tracks in...