A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 3, Problem 4TD
Explanation of Solution
Running the script file for TAL Distributors:
The script file consists of create query for five tables and add values to be added in the created five table.
Steps to run the script file in oracle:
- Open the “SQL Workshop” in the menu bar.
- Then select “SQL Scripts” in the “LABEL”
- Click “Upload” option. The “Upload Script” window will appear on the screen.
- Click the “Choose File” option. Then specify the file path containing the script file and then click “Open” button.
- Click the “Upload” button.
Screenshot of “Upload Script”
- Once the “Upload” button is clicked, the below table is displayed on the screen...
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
You are assigned as the database administrator to collect and manage transactional data of the InstantRide operations. Your main task is to create SQL scripts to help other teams to retrieve the requested data. In the following activities, you will create the scripts, run against the database and send the result to the corresponding teams.
Car Maintenance team wants to add new maintenance tasks to the MAINTENANCES table which was created in Chapter 8, Activity 1. However, the team also wants to insert the tasks in a batch into the database. In other words, they want to insert the rows all together without inserting one-by-one. Therefore, you will need to create a script to add the following tasks and ensure that they are added together:
Car ID: 1001, Maintenance Type: 2, Due: 2020-06-01
Car ID: 1003, Maintenance Type: 2, Due: 2020-06-01
Use SQL to make the following changes to the Colonial Adventure Tours database (Figures 1-4 through 1-6 in Chapter 1). After each change, execute an appropriate query to show that the change was made correctly. If directed to do so by your instructor, use the information provided with the Chapter 3 Exercises to print your output or save it to a document. For any exercises that use commands not supported by your version of SQL, write the command to accomplish the task
Create a view named MAINE_TRIPS. It consists of the trip ID, trip name, start location, distance, maximum group size, type, and season for every trip located in Maine (ME)
a. Write and execute the CREATE VIEW command to create the MAINE_TRIPS view.b. Write and execute the command to retrieve the trip ID, trip name, and distancefor every Biking trip.c. Write and execute the query that the DBMS actually executes.d. Does updating the database through this view create any problems? If so, whatare they? If not, why not?
Use SQL to make the following changes to the Colonial Adventure Tours database (Figures 1-4 through 1-6 in Chapter 1). After each change, execute an appropriate query to show that the change was made correctly. If directed to do so by your instructor, use the information provided with the Chapter 3 Exercises to print your output or save it to a document. For any exercises that use commands not supported by your version of SQL, write the command to accomplish the task.
Create a view named MAINE_TRIPS. It consists of the trip ID, trip name, start location,distance, maximum group size, type, and season for every trip located in Maine (ME).
a. Write and execute the CREATE VIEW command to create the MAINE_TRIPS view.b. Write and execute the command to retrieve the trip ID, trip name, and distancefor every Biking trip.c. Write and execute the query that the DBMS actually executes.d. Does updating the database through this view create any problems? If so, whatare they? If not, why not
Chapter 3 Solutions
A Guide to SQL
Ch. 3 - Prob. 1RQCh. 3 - How do you delete a table using SQL?Ch. 3 - Prob. 3RQCh. 3 - Prob. 4RQCh. 3 - Prob. 5RQCh. 3 - Prob. 6RQCh. 3 - Prob. 7RQCh. 3 - Prob. 8RQCh. 3 - Prob. 9RQCh. 3 - Prob. 10RQ
Ch. 3 - Prob. 11RQCh. 3 - Prob. 12RQCh. 3 - Prob. 13RQCh. 3 - Use SQL to complete the following exercises....Ch. 3 - Prob. 2TDCh. 3 - Prob. 3TDCh. 3 - Prob. 4TDCh. 3 - Prob. 5TDCh. 3 - Prob. 6TDCh. 3 - Prob. 7TDCh. 3 - Prob. 1CATCh. 3 - Add the following row to the ADVENTURE_TRIP table:...Ch. 3 - Prob. 3CATCh. 3 - Prob. 4CATCh. 3 - Prob. 5CATCh. 3 - Prob. 6CATCh. 3 - Review the data for the TRIP table in Figure 1-5...Ch. 3 - Colonial Adventure Tours would like to increase...Ch. 3 - Prob. 1SCGCh. 3 - Add the following record to the VACATION_UNIT...Ch. 3 - Delete the VACATION_UNIT table.Ch. 3 - Prob. 4SCGCh. 3 - Prob. 5SCGCh. 3 - Prob. 6SCGCh. 3 - The SERVICE_REQUEST table uses the CHAR data type...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- An EMPLOYEES table was added to the JustLee Books database to track employee information. Display a list of each employee’s name, job title, and manager’s name. Use column aliases to clearly identify employee and manager name values. Include all employees in the list and sort by manager name.arrow_forwarduse the sql to answer the floowing two question (data base code had been given below) To perform below tasks, refer to tables in the City Jail database. List all criminals along with the crime charges files. The report needs to include Criminal ID, name, Crime Code, and fine amount List all criminals along with crime status and appeal status (if applicable – sounds like an Outer join). The reports needs to include the Criminal ID, name, crime classification ,date charges , appeal filing date and appeal status. Show all criminals, regardless of whether they have filed an appeal or not.arrow_forwardUse FOR loop for your cursor. Write a PL/SQL block to read and display the job_id and number of employees per job_id. Accept input from the user to get the number of employees he wants to see in the output. Display also the number of records returned by your PL/SQL block.arrow_forward
- Write the SQL statements necessary to remove the PET_OWNER table from the database. Assume that the PET table also needs to be removed. Do not run these commands in an actual database!arrow_forwardNote: Use MYSQL Create a database named book-collection-db and table named: bookcollect. Your tableshould contain the following columns: Title, Author, Genre (Children’s, Romance,Thriller, Fantasy, etc.), Publisher, Copyright Date, ISBN Number, Category (Fiction/Nonfiction), Overview, Link Where to Buy, and Price. Create 30 rows containing list of bookwith varied genre.arrow_forwardUseing SQL Scenario: You are working in “ABC” company as Database administrator. a new user “Udev” is joined to the company as developer. “Udev” need to create tables and procedures to be used on the database. Task 1: Required: Create “Udev” user. You need to be sure that “Udev” can connect by using Oracle Sql Developer tool. You need to be sure that “Udev” can create tables and procedures. You need to be sure that “Udev” can’t delete any created table. You need to be sure that create procedures are revoked.arrow_forward
- 4. This question continues from Q3. (a) Write the insert SQL to populate the Zoom, BB, and the QR tables with the values given below. For each table, use only one insert to complete the insert task. The Duration column is initially empty. (b) Can you insert the ZOOM table first? Provide a reason according to the relational database theory if it is not possible. (c) Write a Delete SQL to remove student ‘M M’ from the BB table. If it is not possible to remove the row, provide a reason according to the relational database theory. You must not use SID in the SQL because only the name is given. (d) Write an Update DML that will compute and update the duration in minutesin the Zoom table. Show the updated table and the DML.arrow_forwardCreate both the tables Branch and Supervisor with appropriate attribute names, primary key, foreign key and data type. Insert the above records into Branch and Supervisor tables. Display all the records from Branch and Supervisor (Separately) Display all the details of Name, City and Salary. Display the total salary for every city in the supervisor table. Write a PL/SQL program to display BName from the Branch table for D5. Write a PL/SQL program to display all the details of Supervisor who is getting more than 1250 salary using cursor. Update city as ‘Suhar’ for Supervisor named Jack. Write a Procedure to receive a Supervisor SId as Input and display all the related values of that Supervisor. (Also write the calling program.) Delete all the branch details of operations.arrow_forward. Write the following inserts, deletes, updates, and select in SQL.a. Increase the salary of each instructor in the Comp. Sci. department by 10%.b. Delete all courses that have never been offered (i.e., do not occur in the section relation).c. Insert every student whose tot cred attribute is greater than 100 as an instructor in the same department, with a salary of $10,000.d. Find the ID and name of each student who has not taken any course offered before 2017.arrow_forward
- Please written by computer source 1. For this project, you need to create the company database and populate it with the data given in the Oracle SQL PLUS environment (if you have not done so) 2. Your SQL commands should be placed in file(s) and run from the file(s). 3. Implement Triggers on all the tables to change character data to uppercase in the character data type columns. 4. Implement a Function that returns Dname from Department for any give employee. The parameter to the function would be the SSN. 5. Implement a Function that returns manager’s full name for any given department. The parameter to the function would be the department name. 6. Implement another Function that returns manager’s full name for any given department. The parameter to the function would be the department number. 7. Implement a Procedure that increases an employee salary by x%. Employee is identified by SSN and the percentage of increase is given as an input. 8. Implement a Package that contains the…arrow_forwardCreate a Trigger in SQL that updates an existing View when a new entire is made to the Doctors table.arrow_forwardusing Oracle write and run a PL/SQL block that populates the table Malasiya_Suppliers --- from the Suppliers table. Using a loop, retrieve the supplier's records and add all the suppliers from Malasiya to the Malasiya_Suppliers table.The structure of the tables is as follows:Supplier(Sup id, companyName, ContactName, Country, HomePage)Malasiya Supplier(Sup id, companyName, ContactName, HomePage) - note: please provide a screenshot of the code and with results, if it possiblearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr