EBK CONCEPTS OF DATABASE MANAGEMENT
8th Edition
ISBN: 8220100706004
Author: Last
Publisher: Cengage Learning US
expand_more
expand_more
format_list_bulleted
Question
Chapter 3, Problem 14CATC
To determine
To write SQL query to obtain the reservation ID, trip name, customer last name, customer first name, and the total cost for all the reservations where the number of persons is greater than four. Calculating the total cost of trip by adding the trip price plus other fees and multiplying the result by the number of persons included in the reservations and name it as Total Cost.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
HR wants to send the completed budget reports to the various department managers. To do so, they need a current listing of the department managers to contact. For this query, the HR department needs the department name, manager first name, manager last name, and job title. The results must be sorted by department name and include the elements in the order listed.
This needs to be done in SQL
Instructions
Write SQL queries to solve the following problems. We will be using the “university” database. All queries should involve only the instructor table. After you are done, save your work as .sql file and turn in the .sql file into Moodle for grading.
Write a SQL statement to display all columns using the SQL asterisk (*) wild-card character.
Write a SQL statement to display ID and name of the instructors (ID appears first).
Write a SQL statement to display department names.
Write a SQL statement to display unique department names. (expect 7 rows returned)
Write a SQL statement to display all info about instructors having a salary greater than 75000. (expect 6 rows returned)
Write a SQL statement to display department name, instructor name, and salary for instructors that have a salary less than 70000. Sort the results in ascending order by department name. (expect 4 rows returned)
Write a SQL statement to display name, department name, and salary for instructors that have a…
Using the Online SQL Editor, answer the following questions with screenshots.
Link: https://www.programiz.com/sql/online-compiler/
Question 1: Show (in one table) customer id and first name from Customers table together with shipping id and status from Shippings table while assigning them, within the SQL code, the aliases CT and ST, respectively.
*CT for Customers table and corresponding columns*ST for Shippings table and corresponding columns
Question 2: Show customer id, item, and amount from Orders table together with the last name and age from Customers table whose age is 25 and above.
Question 3: Create a new table named Suppliers, with the following columns: Supplier id, first name, last name, age, and country. Limit first name and last name to 40 characters, country to 15 characters, and age to 3 characters.
Chapter 3 Solutions
EBK CONCEPTS OF DATABASE MANAGEMENT
Ch. 3 - Prob. 1RQCh. 3 - Prob. 2RQCh. 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 - Prob. 14RQCh. 3 - Prob. 15RQCh. 3 - Prob. 16RQCh. 3 - Prob. 1TDECh. 3 - Prob. 2TDECh. 3 - Prob. 3TDECh. 3 - Prob. 4TDECh. 3 - Prob. 5TDECh. 3 - Prob. 6TDECh. 3 - Prob. 7TDECh. 3 - Prob. 8TDECh. 3 - Prob. 9TDECh. 3 - Prob. 10TDECh. 3 - Prob. 11TDECh. 3 - Prob. 12TDECh. 3 - Prob. 13TDECh. 3 - Prob. 14TDECh. 3 - Prob. 15TDECh. 3 - Prob. 16TDECh. 3 - Prob. 17TDECh. 3 - Prob. 18TDECh. 3 - Prob. 1CATCCh. 3 - Prob. 2CATCCh. 3 - Prob. 3CATCCh. 3 - Prob. 4CATCCh. 3 - Prob. 5CATCCh. 3 - Prob. 6CATCCh. 3 - Prob. 7CATCCh. 3 - Prob. 8CATCCh. 3 - Prob. 9CATCCh. 3 - Prob. 10CATCCh. 3 - Prob. 11CATCCh. 3 - Prob. 12CATCCh. 3 - Prob. 13CATCCh. 3 - Prob. 14CATCCh. 3 - Prob. 15CATCCh. 3 - Prob. 16CATCCh. 3 - Prob. 17CATCCh. 3 - Prob. 18CATCCh. 3 - Prob. 19CATCCh. 3 - Prob. 1SCGCCh. 3 - Prob. 2SCGCCh. 3 - Prob. 3SCGCCh. 3 - Prob. 4SCGCCh. 3 - Prob. 5SCGCCh. 3 - Prob. 6SCGCCh. 3 - Prob. 7SCGCCh. 3 - Prob. 8SCGCCh. 3 - Prob. 9SCGCCh. 3 - Prob. 10SCGCCh. 3 - Prob. 11SCGCCh. 3 - Prob. 12SCGCCh. 3 - Prob. 13SCGCCh. 3 - Prob. 14SCGCCh. 3 - Prob. 15SCGCCh. 3 - Prob. 16SCGCCh. 3 - Prob. 17SCGCCh. 3 - Prob. 18SCGCCh. 3 - Prob. 19SCGCCh. 3 - Prob. 20SCGCCh. 3 - Prob. 21SCGCCh. 3 - Prob. 22SCGC
Knowledge Booster
Similar questions
- The course I'm taking is database management. I need help with part A and B please. I am using APEX Oracle compiler. I have attached the employee table. Part A - Implement a procedure in PL/SQL to check if employee is eligible to a salaryincrement depending on his period of service. If he had served for 6 months ormore he is eligible for an increment. Use an if-else statement and print if he iseligible for increment or not . Hint: add_months(hiredate, 6) function will give you the date after 6 months ofhiredate.sysdate is used in oracle instead of the curdate() function in SQL to get the currentdate. Part B - Write a procedure to add 2 numbers and display the resultarrow_forwardUsing the relational database given in lab work no. 2, write the following queries in SQL: 1) How many different courses are there in each department? Sort the list. 2) How many students do have an advisor in the computer engineering faculty? 3) For each department, find out the highest CGPA of a student. Sort the list. (Add a new column to the student table!) 4) How many instructors are advising more than three students? 5) Which department has the highest number of students? 6) Which courses have multiple prerequisites? Sort the list. 7) How many different instructors taught the “Computer Programming” course at least two times? 8) Which instructor taught the “Object-Oriented Programming” course the most time? You should also present the output of each query in the lab report. _________________________________________________________________ The relational database schemas are as follows: department(dept-name, building, budget) instructor(ID, name, dept-name, salary) student(ID, name,…arrow_forwardAnswer these question by using these tables. Please. Create in PL/SQL a stored procedure called 'StudentsActivities' to display the list of students and the activities in which they participated. Create in PL/SQL a stored Function called 'Checkavailability' to check whether 'Salalah Hall' is busy or not in a given date. Create in PL/SQL a stored Procedure called 'CheckavailabilityProc' to call the function 'Checkavailability' and display the appropriate message according to the value returned by the function (If function returns true, the procedure will display 'Salalah Hall is free on date ######' otherwise'Salalah Hall is busy on date ###### '). CREATE TABLE Student (studid Char(9) Primary Key,FirstName Varchar2(50) NOT NULL,LastName Varchar2(50) NOT NULL,Email Varchar2(50) NOT NULL UNIQUE,PhoneNumber Number(8) NOT NULL UNIQUE,GPA Number(1,2) NOT NULL); Insert into Student(studid, FirstName, LastName, Email, PhoneNumber, DateOfBirth, GPA) values…arrow_forward
- What is a PL/SQL function? Write the general syntax of it.arrow_forwardUse FOR loop for your cursor. Write a PL/SQL block to read and display the department name and number of employees per department. 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_forwardUsing the relational database given in lab work no. 2, write the following queries in SQL:1) Which course titles were given by at least two different instructors during the past?2) Which departments have at least two instructors and at least ten students?3) Which students took COMP117 from Cem Kalyoncu and COMP124 from Zafer Erenel?4) Which students are advised by Soydan Redif and took at least one course from Ezgi Ulker?5) Which students took multiple courses from Zafer Erenel but not a single course from Vesile Evrim?6) For each department, find out the highest salaried instructor name and the highest total credited student name.You should also present the output of each query. ////the database of Lab 2 is on attached file)arrow_forward
- PL/SQL please use oracle sql developer. I know it would be hard to slove without the data but please help Given a start and end date, print out names, phone number, status, and flight ID of people who were on the same flight with someone whose status is 1 (tested positive) and the flight date is between the start and end date.arrow_forwardI keep getting errors for this code in SQL but i cant seem to fix it, assuming the names for the files are correct is there any obvious errors?arrow_forwardWhat are the potential issues with over-relying on the COALESCE function in SQL?arrow_forward
- Use 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_forwardUsing the sample "Solmaris Condo" "database" (just a bunch of tables with a theme) I had you create before this test, write a SQL statement to do the following: List the condo ID, square footage, owner number, service ID, number of estimated hours, and number of spent hours for each service request on which the category number is 4.arrow_forwardIn Sql These are some database from a set of tables insert into AccountHolder(AccountID, CustomerID, AccountType)values (55003, 115, 'Savings'),(44001, 101, 'Chequing'),(55006, 109, 'Savings'),(44002, 102, 'Chequing'),(44003, 113, 'Chequing'),(55007, 108, 'Savings'),(44004, 103, 'Chequing'),(44005, 110, 'Chequing'),(55005, 112, 'Savings'),(44006, 114, 'Chequing'),(55001, 111, 'Savings'),(44007, 107, 'Chequing'),(44008, 104, 'Chequing'),(55004, 106, 'Savings'),(44009, 105, 'Chequing'),(44010, 113, 'Chequing'),(55002, 107, 'Savings'),(44011, 110, 'Chequing'),(44012, 104, 'Chequing') select * from AccountHolder insert into Branch(LocationID, BranchName, Address, Type, DepositSum, LoanSum)values (1, 'Boulevard Branch', '3268 Wade Boulevard', 'Rural', 171848.88, 37681.72),(2, 'Avenue Branch', '4814 Dare Avenue', 'Rural', 232707.42, 68324.56),(3, 'Street Branch', '208 Ferry Street', 'Commercial', 375010.75, 44665.08),(4, 'Road Branch', '468 Zulauf Road', 'Commercial', 496001.41,…arrow_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