Question

In: Computer Science

schema: Student( studID, name, major )   // dimension table, studID is key Instructor( instID, dept );  ...

schema:
Student( studID, name, major )   // dimension table, studID is key
Instructor( instID, dept );   // dimension table, instID is key
Class( classID, univ, region, country );   // dimension table, classID is key
Took( studID, instID, classID, score );   // fact table, foreign key references to dimension tables

Write a SQL query to find all students who took a class from an instructor not in the student's major department and got a score over 80.

Return the student name, instructor name, and score. ,

Please describe in sentences what you need to do to find this information

Solutions

Expert Solution

Note:name is missing in Instructor table,so we will add name column to Instructor table.

For this query You have to follow the steps as:

step-1.First of all you need the information from more than one table.Because student name is in student table,Instructor name is in Instructor table and score is in took table.so,You have to join 3 tables.

step-2.For joining tables you have to find same columns in two tables.Here.Student and Took table has same column StudID .Instructor and Took has same column InstID.

step-3.Now,as given in the question,Your conditions will be

1).Major of student and department of instructor should not be equal &

2).Score should be above 80

step-4.From this result you have to SELECT studID from Student table,instID from Intructor table and score from Took table.   

If you want SQL query for the same,Here it is:

SELECT Student.name,Instructor.name,Took.score

FROM ((Student INNER JOIN Took ON Student.studID=Took.studID)INNER JOIN Instructor ON Took.instID=Instructor.InstID)

WHERE Student.major != Instructor.dept

AND Took.score > 80;


Related Solutions

Which of the following best describes a dimension table in a star schema: Most attributes will...
Which of the following best describes a dimension table in a star schema: Most attributes will likely be text Most attributes will likely be numeric The primary key should be a single integer surrogate key Both a. and c. Which of the following best describes a fact table in a star schema: Most attributes will likely be text Most attributes will likely be numeric The primary key should be a single integer surrogate key Both a. and c. Which of...
Consider the following schema: Student(id, name) Registration(id, code) Course(code, instructor) A) Explain how we can violate...
Consider the following schema: Student(id, name) Registration(id, code) Course(code, instructor) A) Explain how we can violate the foreign key constraint from the id attribute of Registration to the Student relation.   Ans. B)Give the following queries in the relational algebra. 1)What are the names of students registered in IT244?    Ans. 2 )What are the names of students registered in both IT244 and CS141? Ans.                                 3)What are the names of students who are...
ENCORE HYDRAULICS DEPARTMENT STAFFING REPORT DEPT NO: 100                          DEPT NAME:    Administ
ENCORE HYDRAULICS DEPARTMENT STAFFING REPORT DEPT NO: 100                          DEPT NAME:    Administration               MANAGER: Simon Semple        EMP NO: 48                             LOCATION: 1991 Leslie, Toronto EMP NAME                              EMP NO                       POSITION CODE     POSITION Nadia Betz                                22                                            C                      Clerk Raoul Radniski                         12                                            A                      Accountant John Smith                               14                                            S                      Supervisor Raj Singh                                 31                                            C                      Clerk DEPT NO: 200                          DEPT NAME:    Hydraulics                    MANAGER: A. Martinez            EMP NO: 16                             LOCATION:      1241 Main St, Ajax EMP NAME                              EMP NO                       POSITION CODE          POSITION Lee Goldman                            25                                            E                      Engineer Paul Prentiss                            15                                            E                      Engineer Leah Zeltserman                       36                                            EA                    Engineering Assistant Mark Wong                               8                                              S                      Supervisor … Normalize above user view. Document all steps including UNF, 1NF, Dependencies, 2NF, and 3NF.
The following table contains the measurements of the key length dimension from a fuel injector. These...
The following table contains the measurements of the key length dimension from a fuel injector. These samples were taken at one-hour intervals. Construct a three-sigma X ̅-chart and R-chart for the length of the fuel injector. What can you say about this process? Sample Number Observations 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 0.57 0.70 0.61 0.67 0.20 0.51 0.95 0.23 0.24 0.59 0.70 0.04 0.05...
The following table contains the measurements of the key length dimension from a fuel injector. These...
The following table contains the measurements of the key length dimension from a fuel injector. These samples of size five were taken at one-hour intervals. Use three-sigma control limits. Use Exhibit 10.13. OBSERVATIONS SAMPLE NUMBER 1 2 3 4 5 1 0.488 0.485 0.482 0.508 0.485 2 0.501 0.504 0.518 0.491 0.526 3 0.498 0.481 0.513 0.483 0.515 4 0.497 0.504 0.482 0.485 0.486 5 0.474 0.498 0.524 0.460 0.486 6 0.475 0.485 0.505 0.482 0.497 7 0.497 0.512 0.485...
The following table contains the measurements of the key length dimension from a fuel injector. These...
The following table contains the measurements of the key length dimension from a fuel injector. These samples of size five were taken at one-hour intervals. Use three-sigma control limits. Use Exhibit 10.13. OBSERVATIONS SAMPLE NUMBER 1 2 3 4 5 1 0.465 0.494 0.493 0.511 0.472 2 0.471 0.501 0.505 0.484 0.515 3 0.472 0.493 0.516 0.493 0.528 4 0.475 0.501 0.495 0.494 0.492 5 0.481 0.498 0.523 0.457 0.485 6 0.472 0.496 0.502 0.495 0.505 7 0.494 0.502 0.494...
The following table contains the measurements of the key length dimension from a fuel injector. These...
The following table contains the measurements of the key length dimension from a fuel injector. These samples of size five were taken at one-hour intervals. Use three-sigma control limits. Use Exhibit 10.13. OBSERVATIONS SAMPLE NUMBER 1 2 3 4 5 1 0.486 0.499 0.493 0.511 0.481 2 0.499 0.506 0.516 0.494 0.529 3 0.496 0.500 0.515 0.488 0.521 4 0.495 0.506 0.483 0.487 0.489 5 0.472 0.502 0.526 0.469 0.481 6 0.473 0.495 0.507 0.493 0.506 7 0.495 0.512 0.490...
The following relations are part of a school database: STUDENT(STUD#, STUD_NAME, MAJOR, YEAR, GPA) TEACHER(FACULTY#, DEPT,...
The following relations are part of a school database: STUDENT(STUD#, STUD_NAME, MAJOR, YEAR, GPA) TEACHER(FACULTY#, DEPT, TEACHERNAME) ENROLLMENT(STUD#, COURSE#, GRADE) RESPONSIBILITY(FACULTY#, COURSE#) Using PROJECT, SELECT and JOIN, write the sequence of operations to answer each of the following questions: What are the names of teachers who are responsible for courses in which students whose name is 'JONES' are enrolled? Use relational Algebra and relational calculus for this question.
You are to construct a star schema for Simplified Automobile Insurance Company. The relevant dimensions, dimension attributes, and dimension sizes are as follows:
Modern Database Management, 13th EditionJeff Hoffer9-39. You are to construct a star schema for Simplified Automobile Insurance Company. The relevant dimensions, dimension attributes, and dimension sizes are as follows:InsuredPartyAttributes: InsuredPartyID and Name. There is an average of two insured parties for each policy and covered item.CoverageItemAttributes: CoverageKey and Description. There is an average of 10 covered items per policy.AgentAttributes: AgentID and AgentName. There is one agent for each policy and covered item.PolicyAttributes: PolicyID and Type. The company has approximately 1...
Problem 10-29 (Algo) The following table contains the measurements of the key length dimension from a...
Problem 10-29 (Algo) The following table contains the measurements of the key length dimension from a fuel injector. These samples of size five were taken at one-hour intervals. Use three-sigma control limits. Use Exhibit 10.13. OBSERVATIONS SAMPLE NUMBER 1 2 3 4 5 1 0.481 0.486 0.492 0.517 0.475 2 0.485 0.505 0.527 0.491 0.528 3 0.486 0.487 0.513 0.487 0.524 4 0.481 0.505 0.468 0.486 0.486 5 0.467 0.503 0.512 0.468 0.479 6 0.468 0.493 0.502 0.491 0.508 7...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT