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
- SELECT Name FROM Lecturer SORT BY Name ASC
- select Name from Lecturer order by Name
- SELECT Name, position, Address, Age FROM Lecturer WHERE Age > 55 ORDER BY Name;
- select name,address from lecturer where position='professor' and age >=55 order by name
- 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