90 likes | 200 Views
Nursing Home Database. By Justin LeBourdais. Description. Designed for my mother’s business Small updateable database for her clients and employees Designed for ease of use, most code that needs to be run would already created. Outcomes. Database that works
E N D
Nursing Home Database By Justin LeBourdais
Description • Designed for my mother’s business • Small updateable database for her clients and employees • Designed for ease of use, most code that needs to be run would already created.
Outcomes • Database that works • Easy to use, database doesn’t seem overly complex • All SQL to create and to update is available in txt files
Problems • Data model and database has a few incorrect relationships • Didn’t follow naming convention correctly, used own method.
Lessons Learned • Follow conventions! • Data models are important. If it is wrong, you will have trouble later on • Keep notes and all SQL code that you use. It will save you lots of work later.
Example Code USE capstone; SELECT CAST(a.FirstName + ' ' + a.LastName AS CHAR(20)) "Employee Name", CAST(ahw.Week AS SMALLDATETIME) "Work Week", CAST(ahw.sunday + ahw.monday + ahw.tuesday + ahw.wednesday + ahw.thursday + ahw.friday + ahw.saturday AS CHAR(5)) "Hours worked", CAST (((ahw.sunday + ahw.monday + ahw.tuesday + ahw.wednesday + ahw.thursday + ahw.friday + ahw.saturday)* a.HourlyRate) AS DECIMAL(7,2)) "Pay" FROM attendant_hours_workedahw, attendants a WHERE ahw.week ='2009-04-05' AND ahw.AttendantID = a.AttendantID;