Programming techniques Flashcards

1
Q

What would the SQL statement look like if the Name, Surname, School and Gender fields were required from the StudentInformation table, with a search requirement for only students with M

A

SELECT StudentInformation.Name, StudentInformation.Surname, StudentInformation.School, StudentInformation.Gender

FROM StudentInformation

WHERE StudentInformation.Gender = ‘M’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What would the SQL statement look like if the Name, HouseName, StreetNumber and Gender fields were required from the InformationOfStudents table, with a search requirement for only students with F and a street number of 1 to 10

A

SELECT InformationOfStudents.Name, InformationOfStudents.HouseName, InformationOfStudents.StreetNumber, InformationOfStudents.Gender

FROM InformationOfStudents

WHERE InformationOfStudents.Gender = ‘F’ AND InformationOfStudents.StreetNumber >= 1 OR InformationOfStudents.StreetNumber <= 10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What would the SQL statement look like if the Name, Surname, HouseName and Gender fields were required from the StudentInformation table, with a search requirement for only students without M or F, and a house name containing ‘ant’

A

SELECT StudentInformation.Name, StudentInformation.Surname, StudentInformation.HouseName, StudentInformation.Gender

FROM StudentInformation

WHERE NOT StudentInformation.Gender = ‘M’ AND NOT StudentInformation.Gender = ‘F’ AND StudentInformation.HouseName LIKE ‘ant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What would the SQL statement look like if all the fields were required from the InformationOfStudents table, with a search requirement for only students with a house number of 8 or a house number of 2

A

SELECT *

FROM InformationOfStudents

WHERE InformationOfStudents.HouseNumber = 2 OR InformationOfStudents.HouseNumber = 8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly