subject
Computers and Technology, 02.03.2020 21:45 whitbol

Consider a database schema with three relations:
emp (eid(underline):integer, ename:string, age:integer, salary:decimal(10,2))
works (eid(underline):integer, did(underline):integer, pct_time:integer)
dept(did(underline):integer, dname:string, budget:decimal(10,2), managerid:integer)

The keys are underlined in each relation. Relation emp stores employee information such as unique identifier eid, employee name ename, age and salary. Relation dept stores the department unique identifier did, unique department name dname, the department budget and managerid which is the eid of the employee who is managing the department. The managerid value must always be found in the eid field of a record of the emp relation. The works relation tracks which employee works in which department, and what percentage of the time s/he allocates to that department. Each eid and each did in works appears in emp or dept respectively. Note that, an employee can work in several departments. Note that this setup is almost exactly what we have specified in createdb. sql, where "string" is translated to char or varchar.
(a) Explain how to change the create tables in createdb. sql to match these specifications. Put this answer in the paper submission.
(b) Create a view ManagerSummary that lists for every department the department name, manager ID and manager name, manager salary and the number of employees in that department. The view will have five columns with headings: DeptName, MgrID, MgrName, MgrSalary, and EmpCount. Put this SQL in createview. sql and drop-view in dropview. sql.
(c) Query the view above to retrieve the set of distinct salaries of managers who manage a department called "Sales".
(d) Query the view above to find the name of the manager who manages most employees. If the same employee works in several departments, that employee is counted once in each of the departments. The manager is included in the count the same as all other employees, i. e., based on his or her records in the Works table.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
Eye injuries usually occur as a result of all of the following things, except: a) proper machine operation b) battery explosion c) falling or flying debris d) electric welding arc
Answers: 2
question
Computers and Technology, 24.06.2019 06:30
Me and category do i put them in because this is science
Answers: 1
question
Computers and Technology, 24.06.2019 09:30
What is the definition of digital literacy?
Answers: 1
question
Computers and Technology, 24.06.2019 17:40
Write a program to analyze student’s scores. each student’s id and 4 original test scores are saved in the attached file “student_id_scores.txt”. assume there are exactly 15 students in the class.• the program first opens the file, reads student’s ids and scores from the file and saves them in two arrays: o create a one-dimensional string array “ids” to store the student’s ids.o create a (parallel) two-dimensional int array “scores” to store student’s original test scores. this array has 5 columns, the original 4 test scores should be saved in the first 4 columns, and the last column will be used to save the average score after the calculation in next step.• the program then retrieves test scores from the array “scores”, calculates average score and determines the final letter grade based on the rules in the table below for each student. assume average score is integer value.average score = (score1 + score2 + score3 + score4) / 4average score letter grade90 ~ 100 a80 ~ 89 b70 ~ 79 c60 ~ 70 d0 ~ 60 f• the average score should be saved back in the 5th column of “scores” array.• create a new parallel one-dimensional char array “grades” to save each student’s letter grade.• program also needs to find the number of a, number of b, number of c, number of d and number of f grade. as well as the highest, lowest and average score of the class.• finally, program will display all of the original scores and all results on the computer screen using the format shown as the sample output below.• the program must contain at least the following functions: (1) a function “getscores” to read and store data into “ids” and “scores” arrays.(2) a function “analyzescores” to calculate student’s average score, determine letter grade, get the number of a, b, c, d and f, find the highest, lowest and average score of the class.(3) a function “displayresults” to display all of the results
Answers: 3
You know the right answer?
Consider a database schema with three relations:
emp (eid(underline):integer, ename:string, a...
Questions
question
Business, 15.05.2021 01:00
question
Mathematics, 15.05.2021 01:00
question
Mathematics, 15.05.2021 01:00
question
Health, 15.05.2021 01:00
question
Mathematics, 15.05.2021 01:00
Questions on the website: 13722360