SQL Query

Question

ORG             |    counts

whitman.edu    17
vt.edu               110
utoronto.ca     1
unicon.net      9
umich.edu     491
ufp.pt             28
uct.ac.za         96
ucdavis.edu   1
txstate.edu     17
stanford.edu   12
rsmart.com  8
media.berkeley.edu  56
loi.nl                        9
lancaster.ac.uk    14
iupui.edu     536
indiana.edu    178
gmail.com      25
fhda.edu            1
et.gatech.edu       17
caret.cam.ac.uk         157
bu.edu              14

 

 

 

retrieve the data from the table company with the top-level domain(.edu) in ascending order.

solved 0
Hemant Singh 4 years 1 Answer 522 views Member 0

Answer ( 1 )

  1. SELECT*
    FROM Counts
    where org like ‘%.edu’
    ORDER by org ASC;

    explanation: first we have to sort data from the table with wildcards in us i.e LIKE ‘%.edu’ this will allow sorting data having top-level domain name as .edu, after this, we just need to order in ascending order of the org name.

    Best answer

Leave an answer

Browse
Browse