Write a SELECT statement that returns "Representative full name" from sales_rep table.
Format "Representative full name" column with the rep_first_name column , a comma, a space and the rep_last name.
Return only the sales representatives whose last name starts with "Mar"
Write a SELECT statement that joins the sales_rep table to the sales_totals table using JOIN
clause and returns these columns :
"Representative Last name" : rep_last_name from sales_rep table
" Year of sales " : sales_year column of sales_totals table
"Total sales " : sales_total column of sales_totals table
SOLUTION-
(1) SELECT rep_first_name+','+' '+rep_last_name as Representative_full_name where Left(rep_last_name,3)='Mar'
OR
SELECT CONCAT(rep_first_name,',',' ',rep_last_name) as Representative_full_name where Left(rep_last_name,3)='Mar' (P.S - When you run in MYSQL,use CONCAT() function)
(2) SELECT sales_rep.rep_last_name as Representative_Last_name,sales_totals.sales_year as Year_of_sales,sales_totals.sales_total as Total_sales FROM sales_rep INNER JOIN sales_totals ON (JOIN condition to be mentioned)
IF YOU HAVE ANY DOUBT PLEASE COMMENT DOWN BELOW I
WILL SOLVE IT FOR YOU:)
----------------PLEASE RATE THE ANSWER-----------THANK
YOU!!!!!!!!----------
Get Answers For Free
Most questions answered within 1 hours.