Question

Working with SQL Below is the solution to a previous problem I now have to change...

Working with SQL Below is the solution to a previous problem I now have to change it to do the following

Display firstName and lastName from the student table in ascending order by lastName. Include

only if lastName begins with

J – M

(SUBSTRING).

___CURRENT SQL BELOW_____

USE `univdb`;
Select firstName, lastName

From
student
Where lastName Not Like '%y'
Order By lastName ASC;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

USE `univdb`;
Select firstName, lastName
From
student
Where lastName Like '[j-mJ-M]%'
Order By lastName ASC;

[j-mJ-M]% specifies the first character should be in the range J-M or j-m and the rest of characters can be anything

and order by specifies that the result should be sorted in ascending order of lastName.

Add a comment
Know the answer?
Add Answer to:
Working with SQL Below is the solution to a previous problem I now have to change...
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
  • WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the...

    WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns. --       Format this column 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 a letter from M to Z. --  ...

  • Question 9 (1 point) Which choice below describes the function of the following SQL statement? SELECT...

    Question 9 (1 point) Which choice below describes the function of the following SQL statement? SELECT ID, Last Name, First Name, Address FROM Members WHERE Last Name Last Name a simple query a parameterized query a compound query a wildcard query Question 10 (1 point) The correct SQL syntax to sort a table by Last Name in order of A-Z is SORT BY Last Name ASCENDING ORDER BY Last Name Down ORDER BY Last Name ASC ORDER BY Last Name...

  • 1 pts Based on the following ER Diagram from the database called "Student Financial." What SQL...

    1 pts Based on the following ER Diagram from the database called "Student Financial." What SQL statement would you use to answer the following question? Student Tuition PKPSUID PK tutionID FirstName Pays (1.1-FX Student LastName SemesterCost Email Scholarships Department DueDate What are the names of all departments that contain the word "art" in them? (Provide a list of departments, no repeats) SELECT [Select] FROM Student WHERE [Select) Based on the following ER Diagram from the databa "Student Financial." What SQL...

  • How could I separate the following code to where I have a gradebook.cpp and gradebook.h file?...

    How could I separate the following code to where I have a gradebook.cpp and gradebook.h file? #include <iostream> #include <stdio.h> #include <string> using namespace std; class Gradebook { public : int homework[5] = {-1, -1, -1, -1, -1}; int quiz[5] = {-1, -1, -1, -1, -1}; int exam[3] = {-1, -1, -1}; string name; int printMenu() { int selection; cout << "-=| MAIN MENU |=-" << endl; cout << "1. Add a student" << endl; cout << "2. Remove a...

  • Copy the entire program 9A and paste it into this one. Be sure to change the...

    Copy the entire program 9A and paste it into this one. Be sure to change the class name to 9B. Use descriptive variable names in camel-case with the first letter in lowercase. In the Student class, change the public attributes firstName and lastName to private ones. In the Student class, add getters and setters called getFirstName, getLastName, setFirstName, setLastName for the two attributes. In the Student class, add a constructor for the Student class that accepts two Strings, one parameter...

  • SQL help I am using livesql.oracle This is CTE I created for problem 4 SELECT CUST_LAST_NAME,...

    SQL help I am using livesql.oracle This is CTE I created for problem 4 SELECT CUST_LAST_NAME, CUST_EMAIL, ORDER_ID, SUM(QUANTITY) AS QTY FROM (SELECT CUST_LAST_NAME, CUST_EMAIL, ORDERS.ORDER_ID, PRODUCT_ID, QUANTITY FROM OE.CUSTOMERS INNER JOIN OE.ORDERS ON OE.CUSTOMERS.CUSTOMER_ID = OE.ORDERS.CUSTOMER_ID INNER JOIN OE.ORDER_ITEMS ON OE.ORDERS.ORDER_ID = OE.ORDER_ITEMS.ORDER_ID ORDER BY ORDER_ID ASC) CTE GROUP BY CUST_LAST_NAME, CUST_EMAIL, ORDER_ID; 5. Using the CTE named customer_information that you created for the previous problem (problem 4). Add a correlated subquery that also shows the total value of...

  • I have a little problem about my code. when i'm working on "toString method" in "Course"...

    I have a little problem about my code. when i'm working on "toString method" in "Course" class, it always say there is a mistake, but i can not fix it: Student class: public class Student {    private String firstName;    private String lastName;    private String id;    private boolean tuitionPaid;       public Student(String firstName, String lastName, String id, boolean tuitionPaid)    {        this.firstName=firstName;        this.lastName=lastName;        this.id=id;        this.tuitionPaid=tuitionPaid;    }   ...

  • need help Create or edit the SQL statements required to accomplish the following tasks. All columns...

    need help Create or edit the SQL statements required to accomplish the following tasks. All columns should have a column name, feel free to create appropriate aliases Use screen shots to ca evidence that each task is completed; include the SQL records before and after statements are executed, as appropriate. Include all work, even if you get errors. Paste your screen shots into a single PowerPoint file pture statements output from the statements, and views of the object explorer when...

  • QUESTION 21 Complete the table below by matching each definition with the appropriate SQL clause. -A.B.C.D.E.F.G.H.I.J.K.L.M.N....

    QUESTION 21 Complete the table below by matching each definition with the appropriate SQL clause. -A.B.C.D.E.F.G.H.I.J.K.L.M.N. A mandatory clause that is at the start of all SQL retrieval queries -A.B.C.D.E.F.G.H.I.J.K.L.M.N. A clause used to return only the values in a result table that are unique -A.B.C.D.E.F.G.H.I.J.K.L.M.N. A clause used to filter tuples according to some condition or predicate, like selection in relational algebra -A.B.C.D.E.F.G.H.I.J.K.L.M.N. A clause that is used to list the tables and any joins required in a query...

  • Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName,...

    Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName, City ON Employees; O FIND EmployeeName, City ON Employees; SELECT EmployeeName, City FROM Employees; O RETRIEVE EmployeeName, City FROM Employees; Which SQL statement finds the different cities in which national parks reside with no duplicate rows listed? SELECT DISTINCT city FROM natlpark ORDER BY city; O ORDER BY natlpark DISTINCT city; O ORDER BY city FROM natlpark; O SELECT city FROM natlpark ORDER BY...

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