1.A user need to know which customer was referred by 1006. List the last name wi
ID: 3624590 • Letter: 1
Question
1.A user need to know which customer was referred by 1006. List the last name with the first character capitalized and the rest of the last name lower case. List the first name in all lower case and the state in all upper case. The column headings should be Last, First and ST.
2.The company is going to raise the cost of the books by 23%. U user need a list of book titles, authors first and last name, and the new cost of the books that have a new cost greater than $50.00. The new cost should be displayed with a dollar sign and carried out to 3 decimal positions. The list should be in ascending order on the author's last name.
3. A user needs to know how many characters are in the longest city name in the orders table. The column headings should be City and # Characters. List each city only once. Sort the list in descending order on # characters.
4. Management is proposing to give each publisher a bonus on the prfit generated for each book based on the following info: Publisher ID 1, Percent 5%; Publisher ID 2, Percent 10%; Publisher Id 3, Percent 15%; Publisher Id 4, Percent 20%; Publisher Id 5, Percent 20%; column headings should be Pub Id, Profit, and Bonus.
5.Determine the calendar date of the next occurrence of Friday, based on todays date. Column heading should be DAY.
6.An employee has worked for the company since December 03, 1968. How many months has the employee worked for the comany? Column headings should be Months Worked Round to 0 decimals positions.
7.A user is developing a code for Customers that live in NJ and NY. The code consists of the first 2 characters of the customers first name the last 3 character of the customers last name and the third and fourth character of of the zip code. List the customers firstname, lastname, zipcode and the code. Columns should be First Name, Last Name , Zip and Code.
Explanation / Answer
1)
SELECT INITCAP(Lastname) “Last”, LOWER(Firstname) “First”, UPPER(State) “ST” FROM customers WHERE referred = 1006;
3)
SELECT DISTINCT(Shipcity) “City”, LENGTH(GREATEST(Cityname) “#Characters” FROM orders ORDERBY #characters DESC;
5)
SELECT NEXT-DAY (CURENT DATE, Friday) “DAY” from Dual;
6)
SELECT MONTHS_BETWEEN(To_DATE(“11-03-1968, MM-DD-YYYY), CURRENT DATE) “Months Worked” FROM Dual;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.