90 likes | 208 Views
This database was created specifically for my mother's nursing home business, aimed at managing clients and employees effectively. It is a small, easily updateable system designed with user-friendliness in mind, ensuring that most necessary codes are pre-written for convenience. It provides a functional and straightforward interface, though it does have some incorrect data relationships and naming convention issues. Key lessons learned include the importance of adhering to data modeling conventions and maintaining detailed notes on SQL code for future revisions.
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;