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 2CATC
To determine
To write SQL query to list the name and start location of trip that has the type biking.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
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…
Write PL/SQL or T-SQL procedures to accomplish the following tasks:
A: obtain the name and credit limit of the customer whose number currently is stored in I_CUSTOMER_NUM. Place these valuse in the variables I_CUSTOMER_NAME and I_CREDIT_LIMIT, respectively. Output the content of I_CUSTOMER_NAME and I_CREDIT_LIMIT.
B: obtain the order date, customer number and name for the order whose number currently is stored in I_ORDER_NUM. place these values in the variables I_ORDER_DATE, I_CUSTOMER_NUM and I_CUSTOMER_NAME , respectively. output the contents of I_ORDER_DATE, I_CUSTOMER_NUM , and I_CUSTOMER_NAME.
C: add a row to the ORDERS table.
D: change the date of the whole number is stored in I_ORDER_DATE to the date currently found in I_ORDER_DATE.
E: delete the order whose number is stored in I_ORDER_NUM.
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
- 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 SQLarrow_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_forwardWrite the SQL code that will produce the same information that was shown in Problem 2, but sorted by the employee’s last name. The results of running that query are shown in Figure P7.3.arrow_forward
- Using 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_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_forwardUse the following relational schema write functions, procedures and triggers in PL/SQL:Student (studid, FirstName, LastName, Email, phoneNumber, DateofBirth, GPA)Club (clubid, ClubName, # studid)MemberOf (#clubid, #studid, joiningDate )Activities (actid, actdt, place, durationNbHour)Organize (#actid , #clubid , fee)1. Write a function called 'Checkavailability' that accepts a date and check whether 'SalalahHall' is busy or not on that date. 2. Write a function called 'CheckStudentClub' that accepts a student id and returns thename of the club in which the student is participating. 3. Write a procedure called ‘MainProc' to call the functions 'Checkavailability' and'CheckStudentClub'. This procedure should display the appropriate messages accordingto the values returned by the each of the called functions (For example: If the firstfunction returns true, the procedure will display 'Salalah Hall is free on date ######'otherwise 'Salalah Hall is busy on date ######')4. Write a Trigger that…arrow_forward
- Answer 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_forwardThe 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_forwardWhat is a PL/SQL function? Write the general syntax of it.arrow_forward
- Using 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_forwardWhat are the potential issues with over-relying on the COALESCE function in SQL?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