90 likes | 114 Views
Obtain IDs of records meeting specific criteria from the database file. Find matches for query conditions regarding name, birth year, and hair color.
E N D
Given the database file above, provide the IDs of the records that match the following queries (write “none” if no records match): • Name is “Bob” • Birth Year is less than 1980 • Hair Color is “Brunette” • Birth Year is less than 1980 or Hair Color is “Brunette” • Birth Year is less than 1980 or Name is “Bob” • Birth Year is less than 1980 and Name is “Bob”
Given the database file above, provide the IDs of the records that match the following queries (write “none” if no records match): • Name is “Bob” • 2 • Birth Year is less than 1980 • 3,4 • Hair Color is “Brunette” • 1,2 • Birth Year is less than 1980 or Hair Color is “Brunette” • 1,2,3,4 • Birth Year is less than 1980 or Name is “Bob” • 2,3,4 • Birth Year is less than 1980 and Name is “Bob” • none
Given the database file above, provide the IDs of the records that match the following queries (write “none” if no records match): • Hair Color is not “Black” • Birth Year is less than 1980 and Hair Color is not “Black” • Birth Year is less than 1980 or Hair Color is not “Black” • Birth Year is less than 1980 or Birth Year is greater than or equal to 1980 • Birth Year is less than 1980 and Birth Year is greater than or equal to 1980 • Birth Year is greater than or equal to 1980 and Name is “Bob”, • or Name is not “Daniella” and Hair Color is “White”
Given the database file above, provide the IDs of the records that match the following queries (write “none” if no records match): • Hair Color is not “Black” • 1,2,3,5 • Birth Year is less than 1980 and Hair Color is not “Black” • 3 • Birth Year is less than 1980 or Hair Color is not “Black” • 1,2,3,4,5 • Birth Year is less than 1980 or Birth Year is greater than or equal to 1980 • 1,2,3,4,5 • Birth Year is less than 1980 and Birth Year is greater than or equal to 1980 • none • Birth Year is greater than or equal to 1980 and Name is “Bob”, • or Name is not “Daniella” and Hair Color is “White” • 2,5
Given the database file above, provide the IDs of the records that match the following queries (write “none” if no records match): • People with brunette hair or called Alice • Brunettes named Carl or Edward • People with a birth year before 1980 and born in August or September • People who are not named Carl, Daniella or Edward, but are brunette or blonde • People born before 2000 in March or May with brunette or white hair • Brunettes born in January or December plus Blondes born in May or August
Given the database file above, provide the IDs of the records that match the following queries (write “none” if no records match): • People with brunette hair or called Alice • 1, 2 • Brunettes named Carl or Edward • none • People with a birth year before 1980 and born in August or September • 3 • People who are not named Carl, Daniella or Edward, but are brunette or blonde • 1,2 • People born before 2000 in March or May with brunette or white hair • 1 • Brunettes born in January or December plus Blondes born in May or August • 2,3
What will be the ID in the second row (excluding headers) under the following sorts? • Primary: Name Descending • Primary: Birth Year Ascending • Primary: Birth Year Ascending, Secondary: Name Descending • Primary: Hair Color Ascending, Secondary: Name Ascending • Primary: Hair Color Descending, Secondary: Name Ascending • Primary: Hair Color Descending, Secondary: Birth Year Ascending
What will be the ID in the second row (excluding headers) under the following sorts? • Primary: Name Descending • 4 • Primary: Birth Year Ascending • 3 • Primary: Birth Year Ascending, Secondary: Name Descending • 3 (note secondary key does nothing here) • Primary: Hair Color Ascending, Secondary: Name Ascending • 3 • Primary: Hair Color Descending, Secondary: Name Ascending • 1 • Primary: Hair Color Descending, Secondary: Birth Year Ascending • 2