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
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
- 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 same description as Problem I. You are asked to display order's item list and meal cost to customer. Each meal must have at least one main item, but side item and drink are optional. Also, a 10% coupon code is available to use. So the main items can be decorated by the side items, drink and coupon. This gives a customer flexibility to order any number of sides or drinks for a meal. Please note that each side item and drink can be multiple or partial. The cost of multiple or partial side and drink is adjusted proportionally, for example, cost of 2 orders of Coke is 2x$1.00, 40% order of Fries is 0.4x$1.5. However, coupon can be used only once per order. We would like to use the Decorator pattern and Singleton pattern to create the receipt to show order's item name, quantity, item unit price, item cost, any coupon applied and final cost. The singleton is to ensure that the coupon can be applied only once in an order. Here is price for each item Main items, Hamburger: $6.5;…arrow_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_forwardWhat exactly is Independent Sub Procedure?arrow_forwardWrite the SQL statements to perform the following operations: a. Create a new course “CS-001”, titled “Weekly Seminar”, with 0 credits. b. Create a section of this course in Fall 2017, with sec id of 1, and with theclocation of this section not yet specified. c. Enroll every student in the Comp. Sci. department in the above section. d. Delete enrollments in the above section where the student’s ID is 12345. e. Delete the course CS-001. What will happen if you run this delete statement without first deleting offerings (sections) of this course? f. Delete all takes tuples (i.e., rows) corresponding to any section of any course with the word “advanced” as a part of the title; ignore case when matching the word with the title.arrow_forward
- Write a query to display the first name, last name, and email address of employees hired from January 1, 2005, to December 31, 2014. Sort the output by last name and then by first name. Write the answer to each query and the result of the query (screen capture). You should submit all design work, program documentation, and relevant sample screen shots of your implementation. A script file with all database creation and table populating is required.arrow_forwardI need the answer as soon as possiblearrow_forwardCreate a list of ENAME, COMM from EMPLOYEE and DEPTNO, DNAME from DEPT for all employees in DEPTNO 30 and 40. How many records were printed to the screen?arrow_forward
- Consider the System Description of question no 2. All the student are advising to reply the following queries, keeping in view the above mention system description title as "Dream Home branch offices case study". (a) List the details of branches in a given city. (b) Identify the total number of branches in each city. (c) List the name, position, and salary of staff at a given branch, ordered by staff name. (d) Identify the total number of staff and the sum of their salaries. (e) Identify the total number of staff in each position at branches in Glasgow. (f) List the names of staff supervised by a named Supervisor. (g) List the property number, address, type, and rent of all properties in Glasgow, ordered by rental amount. (h) Create a branch and staff relationship in view of joint perspective. (1) List the details of properties for rent managed by a named member of staff. G) Identify the total number of properties assigned to each member of staff at a given branch. (k) List the details…arrow_forwardCreate an ERD based on the Crow's Foot notation, using the following requirements:- Scenic Tours LLC (STLLC) provides guided tours to groups of visitors to the Washington D.C. area. In recent years, STLLC has grown quickly and is having difficulty keeping up with all of the various information needs of the company. The company's operations are as follows. STLLC offers many different tours. For each tour, the tour name, approximate length (in hours), and fee charged is needed. Guides are identified by an employee ID, but the system should also record a guide's name, home address, and date of hire. Guides take a test to be qualified to lead specific tours. It is important to know which guides are qualified to lead which tours and the date that they completed the qualification test for each tour. A guide may be qualified to lead many different tours. A tour can have many different qualified guides. New guides may or may not be qualified to lead any tours, just as a new tour may or may not…arrow_forward8. The head of the hospital’s accounting department is concerned about the prescribed charge for services versus the actual charges for services in the surgery category of services (service_cat_id = ‘SUR’). Produce a listing of surgery services listed in the treatment table by service_id where the prescribed service_charge differs from the actual_charge recorded in the treatment table. The result table should also include the service_charge and actual-charge. Use a subquery approach to produce a listing of service_id values from the service table that belong to the ‘SUR’ category of services. Display the SQL code writtenarrow_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