Question

SQL Queries 1) Use the following relations to answer the problems below. Person(SSN, Age, Name) Professor(SSN, Rank, SpecialtRetrieve the Name and Specialty of all Professors who do not supervise work projects. This solution must meet the following c

SQL Queries 1) Use the following relations to answer the problems below. Person(SSN, Age, Name) Professor(SSN, Rank, Specialty) GraduateStudent(SSN, DegreeProgram, AdvisorSSN, DepartmentNumber) Project Number, StartDate, EndDate, Budget, SponsorOrganizationName) DepartmentNumber, Name, Abbreviation, MainOffice, ChairmanSSN) WorksFor(ProfessorSSN, Department Number, TimePercentage) WorksOn(GraduateStudentSSN, ProjectNumber, SupervisingProfessorSSN)
Retrieve the Name and Specialty of all Professors who do not supervise work projects. This solution must meet the following conditions: D a. Uses at most one inner joirn b. Uses at most one outer join cNo subqueries al d. All other operators not mentioned in a through c are allowed ) Find the Name and Department Name of all Graduate Students who work on projects that do not employ any other graduate students from their department. For example, if a Biology Grad Student works on a project, they would be retrieved if and only if no other Grad Students from the Biology department work on that project.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)Select SSN,Speciality from Professor where SSN not in(Select Professor.ssn from Professor inner join Workson on Professor.Sj) Select WorksFor.DepartmentNumber from WorksFor inner join workson on worksFor.SSN=worksOn.SupervisitingProfessorssn FULL O

if you still have any Problem regarding this question please comment and if you like my code please appreciate me by thumbs up thank you.........

Add a comment
Know the answer?
Add Answer to:
SQL Queries 1) Use the following relations to answer the problems below. Person(SSN, Age, Name) P...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 10. For each employee in the department with code ACCNT, find the employee ID and number...

    10. For each employee in the department with code ACCNT, find the employee ID and number of assigned hours that the employee is currently working on projects for other departments. Only report an employee if she has some current project to which she is assigned more than 50% of the time and the project is for another department. Report the results in ascending order by hours. 11. Find all departments where all of their employees are assigned to all of...

  • create relational schema

    Create the relational schema.Professors have a Social Security Number, a name, an age, a rank, and a research specialty.Projects have a project number, a sponsor name, a starting date, an ending date, and a budget.Graduate students have Social Security Number, a name, an age, and a degree program (e.g., M.S. Or Ph.D.).Each project is managed by one professor (known as the project’s principal investigator).Each project is worked on by one or more professors (known as the project’s co-investigators).Professors can manage...

  • Write SQL Queries Given the following tables (7pts) Retrieve the names of employees and their project...

    Write SQL Queries Given the following tables (7pts) Retrieve the names of employees and their project name. If the employee never worked on a project, show the names only the name, not the project name. (7pts) Retrieve the names of employees who have worked on the same project at a different location. (7pts) Retrieve the names of employees who have worked on more than two different projects. (7pts) Retrieve the names of employees who manage more than two employees. CREATE...

  • Consider the relational database schema for a company below. EMPLOYEE/NAME, SSN, BDATE, ADDRESS, SEX, SALARY, SUPERSSN,...

    Consider the relational database schema for a company below. EMPLOYEE/NAME, SSN, BDATE, ADDRESS, SEX, SALARY, SUPERSSN, DNA) TA DEPARTMENT(DNAME, DNUMBER. MESSINS, MGRSTARTDATE) DEPT_LOCATIONS(DNUMBER. DLOCATION PROJECT(PNAME, PNUMBER. PLOCATION, DNLIM) WORKS_ONCESSN.PNG, HOURS) DEPENDENTESSN, DEPENDENT-NAME, SEX, BDATE, RELATIONSHIP) Write SQL statements for the following queries: a) List the names of those employees who work in the "Production" department (6 marks). b) Find the maximum salary, minimum salary, and the average salary among employees who work for the "Production department (6 marks). Count the...

  • Based on the schemas given below, give the appropriate “SQL” and “Relational algebra” statements for the...

    Based on the schemas given below, give the appropriate “SQL” and “Relational algebra” statements for the given queries Marking scheme: 1 mark for each correct syntax for SQL and Relational Algebra Employee (fname, Iname, ssn, sex, salary, dno) Department (dname, dno, managersn, dlocation) Project (pname, pno, plocation, dno) a) Find out which department “Evelyn" is working in. b) Retrieve the names of all the projects which are located in “Isa Town". c) Count the number of employees who receive a...

  • - Consider the following relational schema. - Write SQL statements for the following queries employee fname...

    - Consider the following relational schema. - Write SQL statements for the following queries employee fname CHARACTER VARYING (15) minit CHARACTER VARYING(1) InameCHARACTER VARYING(15) essn CHARACTERO) bdate DATE address CHARACTER VARYING(50) dependent works on CHARACTERO dependent name CHARACTER VARYING(15) essn CHARACTER(9) pno NUMERIC hours NUMERIC CHARACTER() DATE CHARACTER VARYING(B) bdate CHARACTER(1) dept locations elationship salary NUMERIC super ssn CHARACTERO) dno dno NUMERIC dlocation CHARACTER VARYING(15) NUMERIC department CHARACTER VARYING(25) NUMERIC CHARACTERO) project dno mgssn mgstartdate DATE pname CHARACTER VARYING(25) pno...

  • Q1: The following question are based on these database tables: EMPLOYEE FNAME MIDINT LNAME SSN BDATE ADDRESS SEX SALARY SUPER_SSN Dept_No James A Borg 123123123 Hous...

    Q1: The following question are based on these database tables: EMPLOYEE FNAME MIDINT LNAME SSN BDATE ADDRESS SEX SALARY SUPER_SSN Dept_No James A Borg 123123123 Houston, TX M 55000 Null 1 Franklin S Wong 234234234 Houston, TX M 40000 123123123 5 John Q Smith 345345345 Houston, TX M 30000 234234234 5 Jennifer L Wallace 456456456 Bellaire, TX F 43000 123123123 4 Alicia M Zalaya 567567567 Spring, TX F 25000 456456456 4 Ramesh R Narayan 678678678 Humble, TX M 38000 234234234...

  • database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED...

    database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED BELOW CREATE TABLE Department ( DECIMAL(5) VARCHAR(30) CHAR(5) DATE NOT NULL NOT NULL NOT NULL * Department number /*Department name * Department manager number */ /Manager start date DNumber DName Manager MSDate CONSTRAINT Department_PK PRIMARY KEY(DNumber) CONSTRAINT Department_CK UNIQUE(DName) CREATE TABLE DeptLocation DECIMAL(5) VARCHAR(50) NOT NULL NOT NULL DNumber * Department number */ * Department location */ Address CONSTRAINT DeptLocation_PK PRIMARY KEY(DNumber, Address) CONSTRAINT...

  • Please provide the relation algebra, the oracle SQL code and the output tuples for the following (Answer #6 only the BONUS question). I have the others actually I have the BONUS, but I want to compar...

    Please provide the relation algebra, the oracle SQL code and the output tuples for the following (Answer #6 only the BONUS question). I have the others actually I have the BONUS, but I want to compare with your solution to make sure I did it correctly. Thank you very much! LAB exercises 2 Write the Oracle DML query codes for the following questions and take the screen shot of the output. 1. Retrieve the name and address of all employees...

  • Problems and Exercises 1 through 5 are based on the class schedule 3NF relations along with some sample data in Figure 7-16. For Problems and Exercises 1 through 5, draw a Venn or ER diagram and mark it to show the data you expect your query to use to p

    Problems and Exercises 1 through 5 are based on the class schedule 3NF relations along with some sample data in Figure 7-16. For Problems and Exercises 1 through 5, draw a Venn or ER diagram and mark it to show the data you expect your query to use to produce the results.Figure 7-16: Class scheduling relations (for Problems and Exercises 1-5Figure 7-17 Adult literacy program (for Problems and Exercises 6-14)1. Write SQL retrieval commands for each of the following queries:a....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT