Sign In
Not register? Register Now!
Pages:
3 pages/β‰ˆ825 words
Sources:
2 Sources
Style:
APA
Subject:
Health, Medicine, Nursing
Type:
Essay
Language:
English (U.S.)
Document:
MS Word
Date:
Total cost:
$ 12.96
Topic:

Database Schema - SQL Statements

Essay Instructions:

Based on the feedback received on your Topic 2 assignment Database Schema, provide SQL statements to create the (revised) database and populate it with sample data (at least four rows per table).
Modify the database by adding an additional column ("Deleted_Date") to those tables that represent entities that could contain data which can be deleted and justify your rationale in a short paragraph. In addition, explain what the tradeoffs are in using a marker-column for deletion, as opposed to actually deleting a row from a table?
For this assignment you will create SQL queries use the following database schema:
Patient—PatientID, Name, DOB
Doctor—DoctorID, Name, MedLicenseNumber, Phone
Medication—MedicationID, BrandName, GenericName
Prescription—PrescriptionID, Date, PatientID, PrescriberID, MedicationID
Specify the SQL queries to retrieve:
A list of all doctors.
The number of patients who were born before 01/01/1994.
The patient information along with the ID of any prescribing doctor for each patient.
The prescription information along with patient name, DOB, medication brand name, and prescribing doctor name sorted by most recent date.
The most prescribed generic medication name.
APA style is not required, but solid academic writing is expected.
You are not required to submit this assignment to LopesWrite.

Essay Sample Content Preview:

How SQL Queries Work?
Author’s Name
Institutional Affiliation
How SQL Queries Work?
* Background
The Relational Database Management Systems (RDMS) require a specified communication language to access the data on them. Structure Query Language (SQL) is a language specifically developed to access the data and information in the RDMS (Kumar, 2013). This language has been accepted as a standard mode of communications between the developers and the databases by ANSI (American National Standards Institute) (Kumar, 2013). Whenever a query is entered on a SQL server it tigers several processes which simultaneously perform the required operations. The first two operations commonly performed by the server are parsing and optimization. The server creates both physical and logical plans for the queries and the optimizer is responsible for generating an estimated execution plan (Kumar, 2013). The execution plan acts as an input for the SQL server and informs it about the most optimal execution regime for the submitted query. The execution plan is also used by the developer to highlight errors and troubleshooting processes. The logical execution plans divide the plan according to the logical structure of the query (Kumar, 2013). For instance, the activity ‘B’ cannot be carried out unless an activity “A” is completed. The physical logical plans are the characteristics, both hardware and software of the server responsible for carrying out the desired procedures.
The general execution plan, therefore, consists of three steps. The first step includes the logical analysis of the program. The servers are allowed to analyze the syntax and estimate the physical executions according to the syntax of the query. The second phase is the allocation of the physical resources on the SQL server (Kumar, 2013). Once the query’s logical structure has been analyzed it is necessary for the server to allocate necessary physical and software services to the queries. The optimization is the last and the most important part of the actual execution plan. As the name indicates, the main objective of this process is to optimize the entire operation. The optimization is achieved carrying out necessary operations to find the most efficient way to execute a query (Kumar, 2013). It can be a selection of the path which uses minimum computational and physical processing. The cost feature of the “optimizer’ generates an execution plan known as “cost-plan”. The important points to be noted are summarized below:
a. Each submitted query has two plans known as estimated execution plan and the actual execution plan.
b. There are situations in which ...
Updated on
Get the Whole Paper!
Not exactly what you need?
Do you need a custom essay? Order right now:

πŸ‘€ Other Visitors are Viewing These APA Essay Samples: