Eric Milgram, PhD
ScientificProgrammer/PaylocityCodingChallenge |
Created: December 21, 2021 |
Last Updated: 2022-01-19 05:54:08 |
Figure 1, which is shown below, illustrates an entity relationship diagram (ERD) for a logical data model consisting of three tables named Company, Employee, and Position. The ERD represented in Figure 1 also contains the following informational elements, which are important for constructing a physical data model.
-
Field names for each table
-
Data types for each field
-
Field constraints, including primary keys and foreign keys
-
Foreign key relationships between tables, including directionality,
cardinality, and optionality
-
Write a SQL query to generate a result set for a report that contains the
average salary for all employees. -
Update the previous query to generate a result set showing the average
salary for all employees within each company. -
Let's assume your previous query was long running. Please describe the
process you would use to find the root causes of the query's sluggishness?