Write a query to list all Torontonian (Place name contains ‘Toronto’) students (name,
number, Hall-name) enrolled in the B.S. in Computer Science (program code ‘BSC2’)
Student table containing L/FName(s), Number, Hall-name, program_number and postal code (used to identify place_name which is toronto)
Address table containing postal code, place name and province.
program table containing program_number and program_name.
1
Expert's answer
2017-04-14T09:18:05-0400
select * from STUDENT s inner join ADDRESS a using(POSTAL_CODE) where a.PLACE_NAME like '%Toronto%' and s.PROGRAM_NUMBER = 'BSC2'
Of course, but * looks more general in format of our
questions/answers.
Iain fraser
26.10.17, 12:24
instead of select * it is better practice to suggest fields like
FirstName, LastName to maintaine data integrity in the future (mainly
used in the industry when databases are constantly changing)
Leave a comment
Thank you! Your comments have been successfully added. However, they need to be checked by the moderator before being published.
Comments
Of course, but * looks more general in format of our questions/answers.
instead of select * it is better practice to suggest fields like FirstName, LastName to maintaine data integrity in the future (mainly used in the industry when databases are constantly changing)
Leave a comment