SQL
SQL stands for structured query language. SQL is used basically to manage the data of the
Explanation of Solution
b. List of employees from personnel department who have worked or are working:
NEW1 <- JOIN EMPLOYEE and ASSIGNMENT where EMPLOYEE.EmplId = ASSIGNMENT.EmplId
NEW2 <- JOIN NEW1 and JOB where ASSIGNMENT.JobId = JOB.JobId
NEW3 <- SELECT from NEW2 where JOB.Dept = “Personnel”
NEW4 <- PROJECT EMPLOYEE.Name, EMPLOYEE.Address from NEW3
Explanation:
- The relation “NEW1” contains all the records from the relation “EMPLOYEE” and “ASSIGNMENT” which satisfy the indicated condition...
Explanation of Solution
c. List of employees from personnel department:
NEW1 <- JOIN EMPLOYEE and ASSIGNMENT where EMPLOYEE.EmplId = ASSIGNMENT.EmplId
NEW2 <- JOIN NEW1 and JOB where ASSIGNMENT.JobId = JOB.JobId
NEW3 <- SELECT from NEW2 where JOB.Dept = “Personnel” and ASSIGNMENT.TermDate = “*”
NEW4 <- PROJECT EMPLOYEE.Name, EMPLOYEE.Address from NEW3
Explanation:
- The relation “NEW1” contains all the records from the relation “EMPLOYEE” and “ASSIGNMENT” which satisfy the indicated condition...
Want to see the full answer?
Check out a sample textbook solutionChapter 9 Solutions
EBK COMPUTER SCIENCE: AN OVERVIEW
- Table: Team Member Primary key: Team MemberID Team MemberID 1 2 3 Team MemberName Joe Bloggs Samantha Smith Pete Ngwenya Table: Task Primary key: TaskID Foreign key: Team MemberID TaskID 1 2 3 Description Build login screen Implement inventory management Add logo to splahs 1 screen TeamMemberEmail joe@theoffice.com sam@theoffice.com pete@theoffice.com Duration StartDate Team MemberID 2022-05-06 1 2022-05-15 1 4 10 2022-05-06 2arrow_forwardTask 1:The StayWell Property Management team wants a list of all property addresses combined with the name of the owners. You will need to return three columns: the first name as FIRST_NAME, the last name as LAST_NAME, and the property address as ADDRESS of the owners. Task 4:The StayWell maintenance team wants to minimize the number of planned visits to properties. The team wants to learn all the properties that have different planned service dates. You need to return all available data in the SERVICE_REQUEST table, where requests are made for the same property with a different NEXT_SERVICE_DATE. Task 5:The marketing team wants to celebrate the success of StayWell with a party. The team wants a table with the names of all residents and owners combined into single column named PARTICIPANT. You need to combine this information from the tables and send it back to the team. You do not need to create a new table in the database schema. Task 6:The StayWell marketing team wants to send mail…arrow_forwardAnswer the given question with a proper explanation and step-by-step solution. c. Create a relastionship: You need to add a new column called DeptID in the Employee table, it will be the foreign key in this table, it should be text data type and 5 characters in length. Make sure you enter one of the corresponding departmentID's values (i.e., ECON, MIS, and BUS) for this column in the Employee table for this newly created DeptId column that you have entered in the Department table previously. Then, use the Relationships tool under Database Tools to create a relationship between the Department Table and the Employee table, i.e., connecting the two tables together via the primary key (DepartmentID in Department Table) and foreign key pair (DeptID in the Employee Table and choose Enforce Referential Integrity to set the integrity contraint between the foreign key and primary keyarrow_forward
- 2. Code three calls to the procedure created in exercise 1: (a) passed by position with @VendorVar='M%' and no balance range (b) passed by name with @VendorVar omitted and a balance range from $200 to $1000 (c) passed by position with a balance due that’s less than $200 filtering for vendors whose names begin with C or Farrow_forwardThe file ClassificationData.xlsx (Screenshot attached below) contains the following information about the top 25 MBA programs: percentage of applicants accepted, percentage of accepted applicants who enroll, mean GMAT score of enrollees, mean undergraduate GPA of enrollees, annual cost of school (for state schools, this is the cost for out-of-state students), percentage of students who are minorities, percentage of students who are non-U.S. residents, and mean starting salary of graduates (in thousands of dollars).Use these data to divide the top 25 schools into 4 clusters, usingfor example the K-Means clustering algorithm, and interpret your clusters. The method is explained in our textbook: Section 8.8 in the Fourth and Fifth Edition or Section 14.3 in the Sixth Edition. More precisely, use Evolutionary Solver to find 4 schools to be used as cluster centers and to assign all other schools to one of these cluster centers. Each school is then assigned to the nearest cluster center,…arrow_forwardTask 4- Normalisation I. Which normal form is the following table in? II. Transfer the table to 3rd Normalised form and show the conversion to the third form. In each normal form, show the tables, Primary Keys and Foreign keys. II. AgreementID Duration(months) |UnitID UnitAddres NoOfRooms Building!D BuildingName BuildingAddress Signingdate 2 BO01 2 BO02 2 BO02 1 BO04 2 BO03 AGO01 AGO02 AGO03 12 U001 6 U002 12 U002 6 U003 Marsfiled Chatswood Chatswood Burwood Marsfiled White Palace Ryde Martin Place 20/04/2021 13/05/2019 13/02/2020 20/04/2021 13/07/2018 12/02/2021 Parramatta Martin Place Parramatta AGO02 AGO01 Saunders Close Wagga Wagga Twin Tower Wollongong Saunders Close Wagga Wagga 12 U001 AGO04 18 U003 Burwood 1 BO04arrow_forward
- The following are the basic processes of Boarding School Outing System. Student may enter the outing request such as date, reason, check-out time (check-in time is auto-set at 6.00 PM) to request for outing. The outing request details are stored in 'Outing Request' record. Warden can view the outing request and he/she may approve or disapprove the request. The status of the request is updated in the Outing Request' record. Once the status is updated, a short message service (SMS) notification will be sent by the system to the student and parents. The hand-phone numbers are retrieved from the Student' record. Student will check-out and check-in via this system whenever he/she is about to leave from the school and reports back to the school. The data (date and time) is kept in the existing outing record. Note: **Definition of outing (in boarding school context): A day out from the hostel/school, normally during the weekend. Based on the scenario above: a) Draw a Context Diagram for…arrow_forwardWhen building your clauses which of the following is recommended to address first: a. FROM b. WHERE c. SELECT d. ORDER BYarrow_forwardPlease I want the EER or E-R Digram for this question: A patient is identified by patient id, and admission date. • A patient must be either an Emergency patient or a resident patient. • We must record the checkback date for Emergency patient. • Only resident patient is assigned to one room. Room has a unique number, degree, and floor number. • For each room there are a number of beds each of which has a bed number, specification. If a room is deleted, you need not keep track of its beds any longer. • Both emergency patient and resident are cared for by a responsible Doctor. Doctor is identified by Doctor number. For each Doctor, the name, several specialty, and years of experience must be recorded. • Doctors prescribe medicine for patients. Medicine is identified by trade name that has scientific name and formula. The medicine depends on another medicine to be taking before. • A doctor could prescribe one or more drugs for several patients, and a patient could obtain prescriptions…arrow_forward
- Write SQL statements for the five queries: (a) Show the id and name of the feedback activity, and the id, short name, and full name of the course the feedback activity belongs to (across all feedback activities for your site). (b) Show the id, name, presentation, and type (numeric, textarea, textfield, etc.) for the feedback items for two of your feedback activities (specify these feedback activities in your query). (c) Show how many feedback activities are provided for your site. In the same query also show the number of courses that have feedback activities (e.g., there could be 5 activities across 2 courses for your site; The query is asking for two numbers.). (d) Present which of the users has provided feedback on which feedback activity. Show the name of the feedback activity and the first and last name of the user. Arrange the query results in the order of the feedback activity name, and then the user's last name. (e) Show the information about feedback items and the…arrow_forwardQuestion 8 The ERD below is the initial design to track events and the dates on which they are scheduled. Using the ERD, what can you determine about the statement "There were 5 events on July 4, 2012." EVENT DATE Has Scheduled on O This statement could NOT be true based on the ERD. O This statement could be true based on the ERD.arrow_forward3- Write the business rules that are reflected in the ERD shown below (Note that the ERD reflects some simplifying assumptions. For example, each book is written by only one author. Also, remember that the ERD is always read from the "1" to the "M" side, regardless of the orientation of the ERD components.) PUBLISHER BOOK publishes submits wrtes CONTRACT AUTHOR signs %23arrow_forward
- COMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE LNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr