Fill in Order Details

  • Submit paper details for free using our simple order form

Make Payment Securely

  • Add funds to your account. There are no upfront payments. The writer will only be paid once you have approved your paper

Writing Process

  • The best qualified expert writer is assigned to work on your order
  • Your paper is written to standard and delivered as per your instructions

Download your paper

  • Download the completed paper from your online account or your email
  • You can request a plagiarism and quality report along with your paper

SQL

Project description
A basic database is in place. Look at the business rules and test them with some SQL. Look at the previous business rules developed and design some SQL queries to test

them. Set up a test plan. List the rule, the SQL that was written, and the results. The business rules are: Tenants arrange maintenance requests online and tenants can

pay rent online. Attached is an example of what the results should look like.

USE [Master]
GO
CREATE DATABASE [LEASE] ON PRIMARY
(NAME = N’Lease’, FILENAME = N’FSASQLDBlease.mdf’,
SIZE = 4GB, MAXSIZE = 10GB, FILEGROWTH = 2GB)
LOG ON
(NAME = N’Lease_log’, FILENAME = N’FSASQLDBlease_log.ldf’,
SIZE = 2GB, MAXSIZE = 3GB, FILEGROWTH = 10%)
GO
CREATE TABLE dbo.Tenant Lease Agreement (
TenantLeaseKey        CHAR(10),           Primary Key,
LeaseStartDate    DATE,            Not Null,
LeaseEnIDate    DATE,            Not Null,
Deposit    DECIMAL(15, 2),
RentAmount    DECIMAL(15, 2),
LateFees    DECIMAL(15, 2),
ApartmentKey             CHAR(15),        Foreign Key,
TenantKey            CHAR(20),        Foreign Key,
);

CREATE TABLE dbo. Building(
BuildingKey    CHAR(10),        Primary Key,
BuildingName    CHAR(30),    Not Null
BuldingAIDress          CHAR(30),     Not Null

);

CREATE TABLE dbo. Manager(

ManagerKey            CHAR(10),Primary Key
ManagerLastName                  CHAR(50),        Not Null
ManagerFirstName        CHAR(50),         Not Null
BuildingKey            CHAR(10),         Foreign Key

);

CREATE TABLE dbo.Tenant(

TenantKey            CHAR(20),        Primary Key
TenantLastName    CHAR(50),
TenantFirstName    CHAR(50),
TenantEmail_AIDress    CHAR(30),
TenantPhoneNumber             NUMERIC (20),
);

CREATE TABLE dbo.Rent Revenue(

RentRevenueKey        CHAR10),        Primary Key
RentAmount    DECIMAL(15, 2),
RentDueDate        DATE,
LateFeeAmount                       DECIMAL (15, 2),
TenantLeaseKey    CHAR(30),        Foreign Key
);

CREATE TABLE dbo.  Apartment Maintenance(
ApartmentMaintenanceKey    CHAR(10),        Primary Key
RequestDate            DATE,
MaintenanceType    CHAR(30),
Resolution            CHAR(30),
Resolution Date        DATE,
ApartmentKey    CHAR(30),        Foreign Key
);

CREATE TABLE dbo. Expense Type(
ExpenseTypeKey        CHAR(30),        Primary Key
Repair    CHAR(50),
Maintenance            CHAR(50),
Utilities                 CHAR(50),
Apartment Cleaning        CHAR(50),
Insurance                CHAR(50),
);
CREATE TABLE dbo. Expenses(
ExpenseCostKey        CHAR(30),    Primary Key
CostAmount    DECIMAL(15, 2),
ApartmentMaintenanceKey    CHAR(30),                 Foreign Key
ExpenseTypeKey    CHAR(30),        Foreign Key
);

ITC 4150, Database Design and Implementation

Unit VII €“ Westlake Research Hospital
Sample Answers to Scenario Questions
1. Two or three simple SELECTs with various WHERE criteria Rule to Test List all the patients of a given doctor List all the PatientKeys of patients whose depression

level is severe Means of Testing
SELECT * FROM Patient WHERE DoctorKey=’j303€² SELECT PatientKey FROM PatientMedicalHistory WHERE DepressionLevel=’Severe’

Expected Result 4 records 3 records

Result 4 3

2. Two or three queries using aggregate functions Rule to Test Count the number of patients in each drug group Count the number of patients per doctor Means of Testing
SELECT DrugKey, COUNT(PatientKey) FROM PatientGroup GROUP BY DrugKey SELECT DoctorKey, COUNT(PatientKey) FROM Patient GROUP BY DoctorKey

Expected Result 7 in group 12, 6 in group 2 2 or 3 per doctor

Result Success

Success

3. At least two queries that use joins Rule to Test Get the names of all patients that have diabetes Means of Testing
SELECT PatientLastName, Diabetes FROM Patient p INNER JOIN PatientMedicalHistory pmh ON p.PatientKey=pmh.PatientKey WHERE Diabetes = 1 SELECT PatientLastName,

AppointmentDate, BloodPressure, Pulse, DepressionStatus FROM Patient p INNER JOIN Appointment a ON p.PatientKey=a.PatientKey INNER JOIN AppointmentDetail

Expected Result 2

Result 2

Get patient name, appointment date, blood pressure , pulse and depression status for a particular patient

Johnson, 10/12/2010,110/70,7 7,Same

Success

ad ON a.AppointmentKey=ad.Appointme ntKey WHERE p.PatientKey=’JL200€²

4. Two or three INSERT statements Rule to Test AID a new appointment and appointment details Means of Testing
INSERT INTO Appointment(AppointmentKey, AppointmentDate, AppointmentTime,PatientKey, DoctorKey) VALUES(‘10101€²,’10/23/2010€²,’ 2:30 PM’, JL200€²,’PD33€²) INSERT INTO

AppointmentDetail(Appointment DetailKey, AppointmentKey, Bloodpressure, Pulse, PatientWeight, DepressionLevel, DoctorsNotes) VALUES(‘22020€²,’10101€²,’114/7

5€²,77,187,’Moderate’,’the patient seems to be making some progess’)

Expected Result Two new records

Result success

5. One or two UPDATEs and/or a DELETE Rule to Test Change a patient’s doctor Change a patient’s phone number Means of Testing
UPDATE Patient SET DoctorKey=’jj01€² WHERE PatientKey=’JL200€² UPDATE Patient SET PatientPhone=’2065551245€² WHERE PatientKey=’JL200€²

Expected Result 1 record changed 1 record changed

Result 1 record changed 1 record changed

General Guidelines for this Assignment
The queries should be a part of a testing scenario. Each query should validate that the database fulfills a requirement or business rule. The testing, however, is not

expected to be complete or comprehensive in any way. The following rubric for this unit assignment should also guide you on the level of detail and the content

expected. Contact your instructor if you have questions.

Poor Incomplete or malformed SQL. Queries don’t aIDress requirements or business rules. No testing format

OK Uses testing format. Queries mostly correct. Queries mostly aIDress requirements and business rules

Good Uses testing format. All queries well-formed and directed at requirements and business rules

WHAT OUR CURRENT CUSTOMERS SAY

  • Google
  • Sitejabber
  • Trustpilot
Zahraa S
Zahraa S
Absolutely spot on. I have had the best experience with Elite Academic Research and all my work have scored highly. Thank you for your professionalism and using expert writers with vast and outstanding knowledge in their fields. I highly recommend any day and time.
Stuart L
Stuart L
Thanks for keeping me sane for getting everything out of the way, I’ve been stuck working more than full time and balancing the rest but I’m glad you’ve been ensuring my school work is taken care of. I'll recommend Elite Academic Research to anyone who seeks quality academic help, thank you so much!
Mindi D
Mindi D
Brilliant writers and awesome support team. You can tell by the depth of research and the quality of work delivered that the writers care deeply about delivering that perfect grade.
Samuel Y
Samuel Y
I really appreciate the work all your amazing writers do to ensure that my papers are always delivered on time and always of the highest quality. I was at a crossroads last semester and I almost dropped out of school because of the many issues that were bombarding but I am glad a friend referred me to you guys. You came up big for me and continue to do so. I just wish I knew about your services earlier.
Cindy L
Cindy L
You can't fault the paper quality and speed of delivery. I have been using these guys for the past 3 years and I not even once have they ever failed me. They deliver properly researched papers way ahead of time. Each time I think I have had the best their professional writers surprise me with even better quality work. Elite Academic Research is a true Gem among essay writing companies.
Got an A and plagiarism percent was less than 10%! Thanks!

ORDER NOW

CategoriesUncategorized

Consider Your Assignments Done

“All my friends and I are getting help from eliteacademicresearch. It’s every college student’s best kept secret!”

Jermaine Byrant
BSN

“I was apprehensive at first. But I must say it was a great experience and well worth the price. I got an A!”

Nicole Johnson
Finance & Economics

Our Top Experts

See Why Our Clients Hire Us Again And Again!


OVER

10.3k
Reviews

RATING
4.89/5
Average

YEARS
13
Mastery

Success Guarantee

When you order form the best, some of your greatest problems as a student are solved!

Reliable

Professional

Affordable

Quick

Using this writing service is legal and is not prohibited by any law, university or college policies. Services of Elite Academic Research are provided for research and study purposes only with the intent to help students improve their writing and academic experience. We do not condone or encourage cheating, academic dishonesty, or any form of plagiarism. Our original, plagiarism-free, zero-AI expert samples should only be used as references. It is your responsibility to cite any outside sources appropriately. This service will be useful for students looking for quick, reliable, and efficient online class-help on a variety of topics.