Question

Assignment Chapter 6 Part - Assignment Chapter 6 Part 2 - Write Queries that: 1. List all Staff first and last names that hav
2 Chapter 4 The Relational Model gure 4-3 ance of the om Home tal database 4.3 Ini Branch branchNo street city postcode BOOS
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. List all Staff first and last names that have a branch number listed the Branch Table:

\rightarrow SELECT s.fName, s.lName FROM Staff s INNER JOIN Branch b ON s.branchNo = b.branchNo;

\rightarrow (Alternative Query) SELECT fName, lName FROM Staff WHERE branchNo IN (SELECT branchNo FROM Branch);

2. Sort the query results from the query above in descending order:

\rightarrowSELECT s.fName, s.lName FROM Staff s INNER JOIN Branch b ON s.branchNo = b.branchNo ORDER BY fName DESC;

3. Join Branch and Staff tables where branchNo are equal:

\rightarrowSELECT * FROM Branch b INNER JOIN Staff s ON b.branchNo = s.branchNo;

4. Execute Left Outer Join for query 3:

\rightarrowSELECT * FROM Branch b LEFT JOIN Staff s ON b.branchNo = s.branchNo;

5. Execute Right Outer Join for query 3:

\rightarrowSELECT * FROM Branch b RIGHT JOIN Staff s ON b.branchNo = s.branchNo;

6. Insert record - 'CR76', 'PL94', '2018-02-28', 'To Big' into the viewing table:

\rightarrow INSERT INTO Viewing (clientNo, propertyNo, ViewDate, comment) VALUES ('CR76', 'PL94', '2018-02-28', 'To Big');

7. Delete the record insert in Item 6:

\rightarrowDELETE FROM Viewing WHERE clientNo = 'CR76' AND propertyNo = 'PL94' AND viewDate = '2018-02-28' AND comment = 'To Big';

*** I hope the answer is sufficient for the given question. Thank you !

Add a comment
Know the answer?
Add Answer to:
Assignment Chapter 6 Part - Assignment Chapter 6 Part 2 - Write Queries that: 1. List...
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
  • [Relational Algebra] Using the above information, please write relational algebra expressions and display tables to answer...

    [Relational Algebra] Using the above information, please write relational algebra expressions and display tables to answer the following. Do NOT write in SQL code. 1. Select all staff that happen to be female with a salary more than $20,000 2. List all staff that happen to have a salary between $20,000 and $30,000 Branch branch No street city postcode BOOS BOO7 воод 3004 BOOZ 22 Deer Rd London SWI4EH 16 Argyll St Aberdeen A235U 163 Main St Glasgow GII YOX...

  • For the tables given above, write a relational algebra statement to show the names of the...

    For the tables given above, write a relational algebra statement to show the names of the female staffs whose salaries are more than 10000. Use S for selection, P for projection, |X| for join, X for cross product, T for aggregation and grouping, U for union, ^ for interaction, / for division, - for intersection. TT T Arial 3 (12pt) T5 - E S @a's For the tables given above, write one relational algebra statement to show the Branch No...

  • Saved Question 1 (20 points) List the names of responsible parties along with the artist name...

    Saved Question 1 (20 points) List the names of responsible parties along with the artist name of the artist they are responsible for. select artists.artistname, mem Question 2 (20 points) List each artist name and a count of the number of members assigned to that artist AV Question 3 (20 points) List each title from the Title table along with the name of the studio where it was recorded, the name of the artist, and the number of tracks on...

  • The Language Is SQL The language is SQL 13- List full details of agents with first...

    The Language Is SQL The language is SQL 13- List full details of agents with first names having exactly three or four letters sorted by the state attribute. 14- List the first name, the last name, the address, the city, the state, the branch number, and the email of agents working in the branch 8005 and having email addresses from yahoo.com. 15-List the first name, the last name, the address, the city, the state, the branch number, and the email...

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