1. List all Staff first and last names that have a branch number listed the Branch Table:
SELECT s.fName, s.lName FROM Staff s INNER JOIN Branch b ON s.branchNo = b.branchNo;
(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:
SELECT 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:
SELECT * FROM Branch b INNER JOIN Staff s ON b.branchNo = s.branchNo;
4. Execute Left Outer Join for query 3:
SELECT * FROM Branch b LEFT JOIN Staff s ON b.branchNo = s.branchNo;
5. Execute Right Outer Join for query 3:
SELECT * 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:
INSERT INTO Viewing (clientNo, propertyNo, ViewDate, comment) VALUES ('CR76', 'PL94', '2018-02-28', 'To Big');
7. Delete the record insert in Item 6:
DELETE 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 !
Assignment Chapter 6 Part - Assignment Chapter 6 Part 2 - Write Queries that: 1. List...
[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 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 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 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...