A Guide to SQL
A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
Expert Solution & Answer
Book Icon
Chapter 8, Problem 6SCG

Explanation of Solution

a.

Deleting query in the table “OWNER”:

Public Function Owner_Delete(I_OWNER_NUM)

    Dim strSQL As String

    strSQL = "DELETE FROM OWNER WHERE OWNER_NUM = '"

    strSQL = strSQL & I_OWNER_NUM

    strSQL = strSQL & "'"

    DoCmd.RunSQL strSQL

End Function

 Explanation:

  • Create a function named as “Owner_Delete” and pass an argument “I_OWNER_NUM”.
  • Set the strSQL string variable to “DELETE FROM OWNER WHERE OWNER_NUM = '” and make everything necessary in the command including the single quotation mark preceding the order number...

Explanation of Solution

b.

Updating query:

Public Function Owner_Update(I_OWNER_NUM, I_LAST_NAME)

    Dim strSQL As String

    strSQL = "UPDATE OWNER SET LAST_NAME = '"

    strSQL = strSQL & I_LAST_NAME

    strSQL = strSQL & "' WHERE OWNER_NUM = '"

    strSQL = strSQL & I_OWNER_NUM

    strSQL = strSQL & "'"

    DoCmd.RunSQL strSQL

End Function

 Explanation:

  • Create a function named as “Owner_Update” and pass the arguments “I_OWNER_NUM” and “I_LAST_NAME”.
  • Set the strSQL string variable to “UPDATE OWNER SET LAST_NAME = '” and make everything necessary in the command including the single quotation mark preceding the order number...

Explanation of Solution

c.

Retrieving the list in the table “CONDO_UNIT”:

Public Function Find_Condos(I_SQR_FT)

    Dim rs As New ADODB.Recordset

    Dim cnn As ADODB.Connection

    Dim strSQL As String

    Set cnn = CurrentProject.Connection

    strSQL = "SELECT LOCATION_NUM, UNIT_NUM, CONDO_FEE, OWNER_NUM FROM CONDO_UNIT WHERE SQR_FT = "

    strSQL = strSQL & I_SQR_FT

       rs.Open strSQL, cnn, adOpenStatic, , adCmdText

    Do Until rs.EOF

        Debug.Print (rs!LOCATION_NUM)

        Debug.Print (rs!UNIT_NUM)

        Debug.Print (rs!CONDO_FEE)

        Debug.Print (rs!OWNER_NUM)

        rs.MoveNext

    Loop

End Function

 Explanation:

  • Create a function named as “Find_Condos” and pass an argument “I_SQR_FT”...

Blurred answer
Students have asked these similar questions
Task 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.
5: 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…
Task 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)
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
Oracle 12c: SQL
Computer Science
ISBN:9781305251038
Author:Joan Casteel
Publisher:Cengage Learning