Question

2. (12) What is the result of running the following query designs and SQL statements? A view of the property sheet for each q

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The query will return all the Pname from PROJECT table for which there is no corressponding Essn in WORKS_ON table.

In WORKS_ON , Essn is a foreign key of table which would be storing Employee details. Pno is foreign key of PROJECT table. PROJECT and WORKS_ON are joined using the key Pnumber in PROJECT and Pno in WORKS_ON. In the join result all those rows which has null value in Essn column is filtered out.

Add a comment
Know the answer?
Add Answer to:
2. (12) What is the result of running the following query designs and SQL statements? A...
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
  • can you answer part e of the question Q.31 Answer the following questions (a) Explain difference between lossy decomposition and lossless decomposition (b) If you write a SQL statement to inner jo...

    can you answer part e of the question Q.31 Answer the following questions (a) Explain difference between lossy decomposition and lossless decomposition (b) If you write a SQL statement to inner join the following two tables based on Plocation value as inner join condition, is the result table lossy or lossless? (Explain why?) EMP LOCS P.K EMP PROJ1 Hours Pname Plocation Р.К. (c) Given a relation schema R ={SSN, Ename, Pnumber, Pname, Plocation, Hours) R is decomposed to R1, R2,...

  • 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...

  • Consider the relation Proj as defined in the worksheets. What is the result of running the...

    Consider the relation Proj as defined in the worksheets. What is the result of running the following query? SELECT p1.projname, COUNT(p2.projname) as count FROM Proj p1 LEFT JOIN Proj p2 on p1.projno = p2.majproj GROUP BY p1.projname ORDER BY count DESC; 1. The query returns the number of sub-projects that each project has. 2. The query returns all of the projects that have sub-projects, and the number of sub-projects that they have. 3. The query shows each main project and...

  • - 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...

  • How come my query isn't running correctly? It is meant to contain fields: PONumber, Account, orderDate, itemNumber,...

    How come my query isn't running correctly? It is meant to contain fields: PONumber, Account, orderDate, itemNumber, and numberOrdered. Those come from the table OrderInfo. It is meant to show all the information for orderDate 2/16/2012. Query Tools Project 4 Part2 File Home CreateExternal Data Database Tools Help Design Tell me wh Insert Ro ① Union Pass-Through Show X Delete R View Run Select Make Append Update Crosstab Delete Table ビData Definition : e-Bul Table Results Query Type All Access...

  • Using SQL*Plus on OMEGA, access the tables you created in Project 2 and complete the following...

    Using SQL*Plus on OMEGA, access the tables you created in Project 2 and complete the following SQL transactions. Log your statements and results by spooling your file (with echo on). Directions for creating and running SQL files are available in the Assignments and Exams page in Blackboard (in the Project 2 group of files). All column headings must show in their entirety. Be sure to include a cover sheet with your full name, section, and date submitted. 19. 4 points...

  • Create the database and tables for the database. Show all SQL statements. Include primary and foreign...

    Create the database and tables for the database. Show all SQL statements. Include primary and foreign keys. Insert data into each table. Show select statements and display the output of each table. Note:Student’s name must be inserted into table as part of the data! Perform the SQL below: Query one table and use WHERE to filter the results. The SELECT clause should have a column list, not an asterisk (*). State the purpose of the query; show the query and...

  • QUERY EXAMPLE2 SELECTfrom Employee em (Refer to query example 2 to answer questions 12- 13) 12....

    QUERY EXAMPLE2 SELECTfrom Employee em (Refer to query example 2 to answer questions 12- 13) 12. You plan to join the Location table and fear there may be some employees with no location. You want to make sure that the query returns a list of all employee What join clause would you add to the query above? records. A. LEFT JOIN Location lo ON em.LocationlD lo LocationID B. RIGHT JOIN Location lo ON em.LocationID lo.LocationlD C. INNER JOIN Location lo...

  • I need help with the following SQL query for a company database (script given below). The...

    I need help with the following SQL query for a company database (script given below). The name of the Department. The number of employees working in that department. The number of different projects controlled by this department. The name of the project controlled by this department that has the maximum number of employees of the company working on it. The number of the above project. The cumulative sum of the number of employees of the company working on the projects...

  • What happens when you try to compile and run the following code? String query = "INSERT...

    What happens when you try to compile and run the following code? String query = "INSERT INTO Invoices (InvoiceDate InvoiceTotal) "              + "VALUES ('2/10/01', '443.55')"; Statement statement = connection.createStatement(); statement.executeUpdate(query); a. A SQLException is thrown at runtime because the executeUpdate method can’t accept a String object. b. A SQLException is thrown at runtime because the SQL statement is coded incorrectly. c. An error occurs at compile time because the SQL statement is coded incorrectly. d. This code compiles and...

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