Question

0. Modify or create the table(file) named Staff first used in assignment 5. There is no change to the structure, and if you n
5a. Query Staff for name and name length. Determine the length with the LENGTH(string) function. Order by descending length v
0 0
Add a comment Improve this question Transcribed image text
Answer #1

CREATING TABLE:

create table Staff (id int(3) , name varchar(15) NOT NULL, office char(7), fee float(7,2) DEFAULT 0.00, reviewDate date, PRIMARY KEY(id));

INSERTING VALUES INTO TABLE:

INSERT INTO Staff VALUES (428,'Suh,S','JO 207',4567.80,'2019-12-20'),(533,'Brown,T','JO 238',3838.38,'2019-12-23'),(803,'Creider,D','JO 216',7272.72,'2019-12-19'),(864,'Harter,D','JO 212',4343.43,NULL),(876,'Saffer,S','JO 235',5775.33,'2019-12-19');

1)One of the many MySQL string functions is the SOUNDEX() function. This function returns a Soundex string from a given string. If two words sound the same, they should have the same Soundex string. If two words sound similar, but not exactly the same, their Soundex string might look similar but not exactly the same.An alternative query could have been constructed using SOUNDS LIKE instead of the SOUNDEX() function.


SELECT * FROM Staff WHERE name SOUNDS LIKE 'Sue';

2) SQL Server (Transact-SQL), the LOWER function converts all letters in the specified string to lowercase. If there are characters in the string that are not letters, they are unaffected by this function.


SELECT name,LOWER(office) FROM Staff;

3)CONCAT takes a variable number of string arguments and concatenates (or joins) them into a single string. It requires a minimum of two input values; otherwise, CONCAT will raise an error. CONCAT implicitly converts all arguments to string types before concatenation. CONCAT implicitly converts null values to empty strings.

SELECT CONCAT(name," ",reviewDate) AS FacultyReviews FROM Staff;

4)

The Oracle RPAD() function returns a string right-padded with specified characters to a certain length.The following illustrates the syntax of the Oracle RPAD() function:

RPAD(source_string, target_length [,pad_string]);

SELECT CONCAT(RPAD(name,20,"."),office) AS RPADcallname FROM Staff;

Add a comment
Know the answer?
Add Answer to:
0. Modify or create the table(file) named Staff first used in assignment 5. There is no...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In this assignment you will combine HTML, PHP, and SQL in order to create a web...

    In this assignment you will combine HTML, PHP, and SQL in order to create a web form that allows a manager to add films to the sakila database. You will also create a method to allow the manager to view a list of all films along with their related information, and a list of actors in the movies. Task 1 Create an initial HTML page titled manager.html with 2 buttons. The first button will be labeled “View Films”, and the...

  • Use the csv file on spotify from any date Code from lab2 import java.io.File; import java.io.FileNotFoundException;...

    Use the csv file on spotify from any date Code from lab2 import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; public class SongsReport {    public static void main(String[] args) {               //loading name of file        File file = new File("songs.csv"); //reading data from this file        //scanner to read java file        Scanner reader;        //line to get current line from the file        String line="";       ...

  • internal project 1 anything helps! thank you!! Instructions: Study the case that starts on page 3...

    internal project 1 anything helps! thank you!! Instructions: Study the case that starts on page 3 carefully. Then write concise answers to the following questions regarding the internal control system of Duarf, Inc. Clearly label your responses with proper headings and subheadings. Be very specific and precise. Answers that appear to be beating around the bush will not get any credit. 1. What are the controls in place that under normal conditions should function well to prevent embezzlements or frauds?...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT