All instructions are in the zipfile.

2 answer below »
All instructions are in the zipfile.
Answered 9 days AfterOct 28, 2022

Answer To: All instructions are in the zipfile.

Aditi answered on Nov 05 2022
45 Votes
From project step 4, you must create and submit a SQL script containing your data manipulation language (DML) statements to insert your sample data into your database and your twenty queries (12 basic, 8 advanced). Within the consolidated technical report, you must include the complete textual output from running your DDL, DML, and queries successfully. You will also include a literature review of similar systems in your report. Your final score will include the evaluation of the collection of output as well as a live, error-free expected run of your script in the environment. Within your DML and query scripts, the following minimum requirements must be met:
Data Manipulation Language (DML) SQL Script Minimum Requirements:
1. All Tables Populated with Minimum of 10 Rows 
Unless a valid and approved exception exists within your requirements definition document, all tables must have at least 10 rows of sample data.
2. All Surrogate Keys Populated Automatically 
All of your project sequences and triggers must be used to automatically populate your surrogate keys.
3. Separate DML for Different Tables with Comments 
For readability, each block or grouping of DML statements for each table must be separated with an appropriate comment header with a blank line after the last statement in the group. Note: the last group does not require a blank line afterwards.
4. Executable, Error-Free Script 
The script you submit must fully execute and be error-free. 
20 SQL Queries (12 Basic, 8 Advanced) Minimum Requirements:
1. Query 1: Select all columns and all rows from one table 
SELECT * FROM `system library`.patron;
2. Query 2: Select five columns and all rows from one table 
SELECT PatronID, PatronFirstName, PatronLastName, ZipCode, StreetAddress from Patron;
3. Query 3: Select all columns from all rows from one view 
SELECT * FROM vw_books;
4. Query 4: Using a join on 2 tables, select all columns and all rows from the tables without the use of a Cartesian product 
Select p.*, b.* FROM patron p cross join borrows b;
5. Query 5: Select and order data retrieved from one table 
SELECT * FROM books ORDER BY title ASC;
6. Query 6: Using a join on 3 tables, select 5 columns from the 3 tables. Use syntax that would limit the output to 10 rows
Select bo.ISBN, bo.GenreID, p.PatronFirstName, p.PatronLastName, b.BorrowID from
Books as bo inner join Borrows as b on bo.ISBN = b.ISBN
inner join Patron as p on p.BorrowID = b.BorrowID LIMIT 10;
7. Query 7: Select distinct rows using joins on 3 tables 
Select distinct l.LibrarianID, l.LibrarianLastName, s.GenreID, g.Created_By
from Librarian as l
inner join Sections as s on l.LibrarianID = s.LibrarianID
inner join Genre as g on g.GenreID = s.GenreID
8. Query 8: Use GROUP BY and HAVING in a select statement using one or more tables 
SELECT * from librarian group by LibrarianID having LibrarianID = 4;
9. Query 9: Use IN clause to select data from one or more tables
SELECT * FROM books where title in ('Apple Cart','Anna Karenina','A Revenue Stamp');
 
10. Query 10: Select length of one column from one table (use LENGTH function) 
SELECT title,LENGTH(title) FROM books;
11. Query 11: Delete one record from one table. Use select statements to demonstrate the table contents before and after the DELETE statement. Make sure you use ROLLBACK afterwards so that the data will not be physically removed
Before Delete:
SELECT * FROM `system library`.patron;
After Delete:
Delete from Patron where PatronID =110;
12. Query 12: Update one record from one table. Use select statements to demonstrate the table contents before and after the UPDATE statement. Make sure you use ROLLBACK afterwards so that the data will not be physically removed 
Before Updating:
SELECT * FROM `system library`.librarian;
After Updating:
Update librarian set LibrarianFirstName = "Kelly" where LibrarianID = 9;
13. Perform 8 Additional Advanced Queries 
i.
SELECT bo.AuthorFirstName
,bo.AuthorLastName
FROM Patron p
JOIN Borrows b
ON p.BorrowID = b.BorrowID
JOIN Books bo
ON bo.ISBN = b.ISBN
GROUP BY bo.Available;
ii. Select distinct l.LibrarianID, l.LibrarianLastName, s.GenreID
from Librarian as l
inner join Sections as s on l.LibrarianID = s.LibrarianID
iii.
Select p.patronid, p.patronfirstname, p.patronlastname
from patron...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here