Latest Lists

how do i write an SQL query for alphabetical ordered list?

Given relational schema: Lecturer(Name, position, Address, Age) Course_Unit(Code.......) etc how could i write an alphabetical ordered list of all professors using SQL. Given relational schema: Lecturer(Name, position, Address, Age) Course_Unit(Code.......) etc how could i write an alphabetical ordered list of all professors who are over 55years old using SQL.

Public Comments

  1. SELECT Name FROM Lecturer SORT BY Name ASC
  2. select Name from Lecturer order by Name
  3. SELECT Name, position, Address, Age FROM Lecturer WHERE Age > 55 ORDER BY Name;
  4. select name,address from lecturer where position='professor' and age >=55 order by name
  5. Vasanthi almost had it right - just need '> 55' instead of '>= 55' (Also assumes that position is stored as 'professor' with a lower-case 'p' instead of 'Professor' or some sort of code value). Could also have specified 'ORDER BY name ASC', but ascending sequence is usually the default.
Powered by Yahoo! Answers