Explanation of Solution
a.
Deleting query in the table “ORDERS”:
Public Function Order_Delete(I_ORDER_NUM)
Dim strSQL As String
strSQL = "DELETE FROM ORDERS WHERE ORDER_NUM = '"
strSQL = strSQL & I_ORDER_NUM
strSQL = strSQL & "'"
DoCmd.RunSQL strSQL
End Function
Explanation:
- Create a function named as “Order_Delete” and pass an argument “I_ORDER_NUM”.
- Set the strSQL string variable to “DELETE FROM ORDERS WHERE ORDER_NUM = '” and makes everything necessary in the command up to and including the single quotation mark preceding the order number.
- The next command will concatenated previous value with the value in “I_ORDER_NUM”.
- The final command is used to set strSQL to the output of the value already created, concatenated with a single quotation mark...
Explanation of Solution
b.
Updating query:
Public Function Order_Update(I_ORDER_NUM, I_ORDER_DATE)
Dim strSQL As String
strSQL = "UPDATE ORDERS SET ORDER_DATE = '"
strSQL = strSQL & I_ORDER_DATE
strSQL = strSQL & "' WHERE ORDER_NUM = '"
strSQL = strSQL & I_ORDER_NUM
strSQL = strSQL & "'"
DoCmd.RunSQL strSQL
End Function
Explanation:
- Create a function named as “Order_Update” and pass the arguments “I_ORDER_NUM” and “I_ORDER_DATE”.
- Set the strSQL string variable to “UPDATE ORDERS SET ORDER_DATE = '” and makes everything necessary in the command up to and including the single quotation mark preceding the order number.
- Here, the user pass two arguments, so there are two portions of the construction of the SQL command that involve variables...
Explanation of Solution
c.
Retrieving the list in the table “ITEM”:
Public Function Find_Items(I_CATEGORY)
Dim rs As New ADODB.Recordset
Dim cnn As ADODB.Connection
Dim strSQL As String
Set cnn = CurrentProject.Connection
strSQL = "SELECT ITEM_NUM, DESCRIPTION, STOREHOUSE, PRICE FROM ITEM WHERE CATEGORY= '"
strSQL = strSQL & I_CATEGORY
strSQL = strSQL & "'"
rs.Open strSQL, cnn, adOpenStatic, , adCmdText
Do Until rs.EOF
Debug.Print (rs!ITEM_NUM)
Debug.Print (rs!Description)
Debug.Print (rs!STOREHOUSE)
Debug.Print (rs!PRICE)
rs.MoveNext
Loop
End Function
Explanation:
- Create a function named as “Find_Items” and pass an argument “I_CATEGORY”.
- The “rs” and “cnn” is used to processing the “Recordset” and “ADODB.Connection”...
Trending nowThis is a popular solution!
Chapter 8 Solutions
A Guide to SQL
- Hint: The top organizational count is 536. Submit You do not need to export or convert the database - simply upload the .sqlite file that your program creates. See the example code for the use of the connect() statement. Counting Organizations This application will read the mailbox data (mbox.txt) and count the number of email messages per organization (i.e. domain name of the email address) using a database with the following schema to maintain the counts. CREATE TABLE Counts (org TEXT, count INTEGER) When you have run the program on mbox.txt upload the resulting database file above for grading. If you run the program multiple times in testing or with dfferent files, make sure to empty out the data before each run. You can use this code as a starting point for your application: http://www.py4e.com/code3/emaildb.pyZ. The data file for this application is the same as in previous assignments: http://www.py4e.com/code3/mbox.txt Z. Because the sample code is using an UPDATE statement and…arrow_forwardTask 6: Create the GET_INVOICE_DATE procedure to obtain the customer ID, first and last names of the customer, and the invoice date for the invoice whose number currently is stored in I_INVOICE_NUM. Place these values in the variables I_CUST_ID, I_CUST_NAME, and I_INVOICE_DATE respectively. When the procedure is called it should output the contents of I_CUST_ID, I_CUST_NAME, and I_INVOICE_DATE.arrow_forwardTask 6: Create the GET_INVOICE_DATE procedure to obtain the customer ID, first and last names of the customer, and the invoice date for the invoice whose number currently is stored in I_INVOICE_NUM. Place these values in the variables I_CUST_ID, I_CUST_NAME, and I_INVOICE_DATE respectively. When the procedure is called it should output the contents of I_CUST_ID, I_CUST_NAME, and I_INVOICE_DATE. (mySQL)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_forwardGiven a database of bike share information write a SELECT statement to retrieve the bike_number, start_date, and end_date from trip_data and the station_id and name from bikeshare_stations where the start_station in trip_data is the same as the station_id in bikeshare_stations and where the member_type equals “Casual”. Limit the results to 5 rows. Please answer this python questionarrow_forwardcreate a table job_history including columns employee_id,start_date,end_date,jobname and department name and make sure that the employee_id column doesnot contain any duplicate value.write a Java program to insert atleast four records.by using prepared statement display job name and department name corresponding to a particular year.arrow_forward
- Create a function to insert a new product into an existing order, include the product id, unit price, quantity. The output of the function is the message to notify the calling program whether the update succeeded or not. note : Note: Sql code need not java don't waste my time by giving java codearrow_forwardIn cell C10, enter a database function to display the date of the apartment that had the oldest remodel date based on the filtered data. Format the result with Short Date format.arrow_forwardWhat is a NULL value?arrow_forward
- USE NORTHWIND DATABASE Write a SELECT statement using the CASE function. The statement returns two columns basedon how many orders the customer has in the database. The first column is the customer name andthe second column, Membership Type, is based on which case applies to the customer:If the customer has more than 25 orders they are a Diamond Customer.If the customer has more than 15 orders they are a Gold Customer.If the customer has more than 10 orders they are a Silver Customer.If the customer has more than 5 orders they are an Iron Customer.Otherwise the customer is a Valued Customer.arrow_forward5: Create the GET_CREDIT_LIMIT procedure to obtain the full name and credit limit of the customer whose ID currently is stored in I_CUST_ID. Place these values in the variables I_CUSTOMER_NAME and I_CREDIT_LIMIT, respectively. When the procedure is called it should output the contents of I_CUSTOMER_NAME and I_CREDIT_LIMIT. HERE'S MY QUERY -- create a procedure named GET_CREDIT_LIMIT -- use I_CUST_ID as a input parameter -- use I_CUSTOMER_NAME, I_CREDIT_LIMIT as output parameters -- select columns CONCAT(FIRST_NAME, ' ', LAST_NAME), CREDIT_LIMIT and store the values in I_CUSTOMER_NAME, I_CREDIT_LIMIT -- using where clause to match the CUST_ID to currently stored in I_CUST_ID(provided as a parameter) DELIMITER // CREATE PROCEDURE GET_CREDIT_LIMIT ( IN I_CUST_ID int, OUT I_CUSTOMER_NAME varchar(75), OUT I_CREDIT_LIMIT decimal(10,2) ) BEGIN SELECT CONCAT(FIRST_NAME, ' ', LAST_NAME), CREDIT_LIMIT INTO I_CUSTOMER_NAME, I_CREDIT_LIMIT FROM CUSTOMER WHERE CUST_ID = I_CUST_ID; END // DELIMITER…arrow_forwardfa table in a SQL database has a column of type `VARCHAR(100)", what does the "100" signify? a) The number of records that can be stored in the column. b) The number of unique characters that can be stored in the column. c) The maximum length of a string that can be stored in the column. d) The minimum length of a string that can be stored in the column.arrow_forward
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning