Basic SQL Query, I am newbie

Course Queries Syllabus Queries 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I just started my database and query class on Monday. We met on Monday and just went over the syllabus, and on Wednesday the network at school was down so we couldn't even do the power point lecture. Right now I am working on my first homework assignment and I am almost finished but I am having trouble on one question.

Here is is...

Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns.
Format the columns with the last name, a comma, a space, and the first name like this:
Doe, John
Sort the result set by last name in ascending sequence.
Return only the contacts whose last name begins with letters from M to Z.

Here is what I have so far...

USE md0577283
SELECT FirstName,LastName
FROM Customers
ORDER BY LastName,FirstName

My question is how do I format is Lastname, FirstName like the professor wants and how do I only select names M-Z?

If someone could point me in the right direction I would greatly appreciate it.

Thank you.

PS With all do respect, I didn't ask for the answer I asked for a nudge in the right direction so why the down vote guys?

profilepic.png
manpreet 2 years ago
USE md0577283
SELECT LastName + ', ' + FirstName FullName
FROM Customers
WHERE LastName LIKE '[M-Z]%'
ORDER BY LastName,FirstName

0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.