The first value in the output of a SQL query (given below) when run on a table having name “Table-1” is?
SQL Query: SELECT LastName FROM Table-1 WHERE State = "IN" ORDER BY FirstName
LastName | FirstName | StreetNumber | StreetName | City | State |
---|---|---|---|---|---|
Squires | Edwin | 4589 | Shamar Rd. | Upland | IN |
Rothrock | Paul | 91657 | Carex Ave. | Upland | IN |
Ramirez | Douglas | 123 | Fake St. | Springfield | IN |
Peterson | Chris | 4687 | Windthrow Way | Kane | PA |
Gibson | David | 354 | Bluestem St. | Carbondale | IL |
We are given the query:
SELECT LastName FROM Table-1 WHERE State = "IN" ORDER BY FirstName
Let's filter the table rows where State is "IN":
- Squires, Edwin — IN
- Rothrock, Paul — IN
- Ramirez, Douglas — IN
Now, order these by the FirstName column:
1. Douglas (Ramirez)
2. Edwin (Squires)
3. Paul (Rothrock)
So, the first entry by alphabetical order of FirstName is Douglas, and the corresponding LastName is Ramirez.
Answer: Ramirez
The table below is an attribute table about employee records. Which attribute can be used as a primary key?
Employee | Name | Designation | Department |
---|---|---|---|
(Emp_ID) | (Emp_Name) | (Emp_Desig) | (Emp_Dept) |
100260 | Prashant | Software Developer | Information Technology |
100265 | Dinesh | Junior Engineer | Embedded System |
100252 | Somya | HR Manager | Management |
100271 | Dinesh | Junior Engineer | Information Technology |
Consider the following database tables of a sports league. player (\( pid \), \( pname \), \( age \)) coach (\( cid \), \( cname \)) team (\( tid \), \( tname \), \( city \), \( cid \)) members (\( pid \), \( tid \)) An instance of the table and an SQL query are given.
Player table
coach table:
team table:
members table:
SQL query: \[ {SELECT MIN(P.age)} \] \[ {FROM player P} \] \[ {WHERE P.pid IN (} \] \[ { SELECT M.pid} \] \[ { FROM team T, coach C, members M} \] \[ { WHERE C.cname = 'Mark'} \] \[ { AND T.cid = C.cid} \] \[ { AND M.tid = T.tid)} \] The value returned by the given SQL query is _________. (Answer in integer)
A schedule of three database transactions \(T_1\), \(T_2\), and \(T_3\) is shown. \(R_i(A)\) and \(W_i(A)\) denote read and write of data item A by transaction \(T_i\), \(i = 1, 2, 3\). The transaction \(T_1\) aborts at the end. Which other transaction(s) will be required to be rolled back?
The error matrix resulting from randomly selected test pixels for a classified image is given below.
The Producer’s accuracy of class 1 is % (rounded off to 1 decimal place).
Reference Data | |||||
---|---|---|---|---|---|
Class 1 | Class 2 | Class 3 | Class 4 | ||
Classified Data | Class 1 | 320 | 8 | 7 | 3 |
Class 2 | 12 | 270 | 6 | 2 | |
Class 3 | 9 | 6 | 410 | 5 | |
Class 4 | 14 | 2 | 3 | 350 |
The brightness values of four pixels in the input image are shown in the table below. The image is rectified using nearest neighbor intensity interpolation, and the pixel at location (5, 4) in the output image is to be filled with the value from coordinate (5.3, 3.7) in the input image. The brightness value of the pixel at location (5, 4) in the rectified output image is 11. (Answer in integer)
Location of pixels in input image (Row, Column) | Brightness Value |
---|---|
(5, 3) | 9 |
(5, 4) | 11 |
(6, 3) | 14 |
(6, 4) | 12 |
The hue, intensity and saturation values for a pixel are \( H = 0.5 \, {rad} \), \( S = 0.5 \), and \( I = 0.3 \), respectively. If the pixel is converted to RGB color model, then the value of the green pixel would be __________ (rounded off to 2 decimal places).