This is MYSQL DATABASE code only. I just need assistance with being able to write the code without trying it out, so creating the database is optional. I just need the code.
1. Write the code to display a list of available beds (bed_number, room_id) that have a room description indicating a double room.
Write the code to display a list of all patients (concatenated first and last name with a space), their bed, and the room description for all patients that have a bed assignment.
2. LEFT OUTER JOINS Write the code to display a list of all patients (concatenated first and last name with a space), their bed, and the room description for all patients, even those without a bed assignment.
3. WRITE THE CODE TO DETERMINE THE FOLLOWING ANSWERS:
Are there any rooms that do not have a bed?
Are there any bed types that do not have a bed?
Are there any patients who do not have a bed?
4. DO YOU SEE ANY PROBLEMS WITH THE RELATIONSHIP BETWEEN THE PATIENTS AND BEDS TABLES?
bed_type Column Name bed_type_id bed_description
pq
Data Type (zjunup varchar(50)
Allow Nulls 0
Column Name bed_number room_id bed_availability
Data Type smallint char(6) char(2) char(1)
Allow Nulls 0
patient: Column Name patient_id patient_ssn patient_last_name patient_first_name admitted patient_street_address patient_city patient_state patient_zip patient_date_of_birth
Data Type char(6) char(6) varchar(50) varchar(50) varchar(50) varchar(50) varchar(50) char(6) datetime
Allow Nulls
room Column Name room_id
Data Type char(6) varchar(25)
Allow Nulls
bed_number