Question

Create Function in (PL/SQL) called lookup_user (v_email) Return the user number of the given user or...

Create Function in (PL/SQL)

called lookup_user (v_email)

Return the user number of the given user or -1 if the user is not found.

Table Account (this is the table I need to add data using Function)

Account_no (PK)

Email (VARCHAR2)

first (VARCHAR2)

last (VARCHAR2)

Homework Answers

Answer #1

Table has been created and data inserted

PL SQL Function code

Return the user number of the given user if user is found   (Code and output as screenshot)

Return -1 if the user is not found (Code and output as screenshot)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Create a user-defined function in SQL to return a valid query author and date. This will...
Create a user-defined function in SQL to return a valid query author and date. This will be used for all views later on in future queries.
3. How many people have the last name King Use PL/SQL? Code: Output: 4. Change the...
3. How many people have the last name King Use PL/SQL? Code: Output: 4. Change the first name to Stephen for the person with the last name King Use PL/SQL. Code: Output: Copy the record showing name change: Code: Output: 5. Delete all employees in Department 20. Use %TYPE for the variable. Use SQL%ROWCOUNT to see how many records were deleted. Code: Copy output showing ROWCOUNT: 6. Use a merge to merge the original employees table into emp_test. Do UPDATE...
A Guide to SQL Questions 1. How do you create a table using SQL? 2. How...
A Guide to SQL Questions 1. How do you create a table using SQL? 2. How do you delete a table using SQL? 3. What are the common data types used to define columns using SQL? 4. Identify the best data type to use to store the following data in Oracle, in SQL Server, and in Access:    a. The month, day, and year that an employee was hired    b. An employee’s Social Security number    c. The department...
• First, create a function called addNumber, which has a formal parameter for an array of...
• First, create a function called addNumber, which has a formal parameter for an array of integers and increase the value of each array element by a random integer number between 1 to 10. o Add any other formal parameters that are needed. • Second, create another function called printReverse that prints this array in reverse order. • Then, you need to write a C++ program to test the use of these two functions.
C++ Create an empty vector in main called theVect. Ask the user for a number. Fill...
C++ Create an empty vector in main called theVect. Ask the user for a number. Fill the vector with 10 random numbers that are multiples of that number. So, for instance, if the user says 7, then you need to use a while loop and fill in the vector with any randomly generated number that is num % 7.
Using C programming Create a function called printMenu( ) with the following properties: Has no function...
Using C programming Create a function called printMenu( ) with the following properties: Has no function inputs or output. Prints the following menu to the screen: 1. Enter user name. 2. Enter scores. 3. Display average score. 4. Display summary. 5. Quit Create a function called printLine( ) with the following properties: Takes as input a char Takes as input an integer corresponding to the number of times to print the character Has no function output. For example, if we...
Write a function called char_counter that counts the number of a certain character in a text...
Write a function called char_counter that counts the number of a certain character in a text file. The function takes two input arguments, fname, a char vector of the filename and character, the char it counts in the file. The function returns charnum, the number of characters found. If the file is not found or character is not a valid char, the function return -1. As an example, consider the following run. The file "simple.txt" contains a single line: "This...
1. Create a linked list using the Node class that contains the first million prime numbers...
1. Create a linked list using the Node class that contains the first million prime numbers (primes4.txt). It should have a menu with these options: 1 = Search for a Number (let the user enter a number to search for) 2 = Add a new Number (let the user enter a number and add it to the head of the list) 3 = Delete a Number (let the user enter a number and delete it if found) 4 = Exit...
Create a file called artists.js (or a node project) that will scrape the provided url:"url" and...
Create a file called artists.js (or a node project) that will scrape the provided url:"url" and send an email of all artists & songs that are sung by the specified artists given via the command line. Requirements: • The specified artists must be read in via the command line • If no artist(s) are specified do not send an email • If the specified artist(s) are not found on the website, do not send an email • If the specified...
Create a program that allows the user to input a list of first names into one...
Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input should be terminated when the user enters a sentinel character. The output should be a list of emial addresses where the address is of the following form: [email protected] Declare FirstName[100] as String Declare LastName[100] as String Declare email as String Declare K as Integer Declare index as Integer Write "Enter first and last name." Write...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT