In each part you are given the consequence of a SQL inquiry along with a potentially wrong
Question:
In each part you are given the consequence of a SQL inquiry along with a potentially
wrong end drawn from this outcome.
For each situation your errand is to contend possibly in support of the end. You should obviously
legitimize your thinking. On the off chance that the SQL inquiry can be remedied, do as such.
(a) The accompanying question returns 1422.
End: Our data set contains data on 1422 chiefs.
select count(*)
from has_position
where position = 'chief';
[6 marks]
(b) The accompanying question returns these records:
nm0498278 Stan Lee essayist 15
End: Stan Lee didn't deliver any of the motion pictures in our information base.
select person_id, name, position, count(*) as aggregate
from has_position as hp
join individuals as p on p.person_id = hp.person_id
where position <> 'entertainer'
what's more, name = 'Stan Lee'
bunch by person_id, name, position
[6 marks]
[proceeded . . . ]
Compose Java program to peruse a document content line by line.
1 b) Write java program to peruse a record line by line and store it into a variable.
(c) The accompanying inquiry endeavors to return records (job, year, absolute) where
Jennifer Lawrence assumes a similar part during the year an all out number of
times in various motion pictures. The question returns these records:
Job YEAR TOTAL
---------------- ---- -----
Tiffany 2012 1
Persona 2011 1
Raven 2011 1
Aurora Lane 2016 1
Katniss Everdeen 2012 2
Ree 2010 1
Rosalyn Rosenfeld 2013 1
Katniss Everdeen 2013 2
End: Jennifer Lawrence played Katniss Everdeen in two motion pictures in 2012.
select r1.role, m1.year, count(*) as aggregate
from plays_role as r1
join plays_role as r2 on r2.person_id = r1.person_id
join motion pictures as m1 on m1.movie_id = r1.movie_id
join motion pictures as m2 on m2.movie_id = r2.movie_id
join individuals as p on p.person_id = r1.person_id
where p.name = 'Jennifer Lawrence'
furthermore, r1.role = r2.role
bunch by r1.role, m1.year;
You are furnished with a 2D triangle network characterized by a bunch of vertices V [k] =
(xk, yk, ak) for k = 1, . . . , N, and a triangle list table T of aspect M×3, where
M is the quantity of triangles. xk and yk are the directions of vertex k and ak is its
scalar characteristic. An illustration of such a triangle network is displayed underneath.
(a) Write down the triangle record table of the cross section displayed in the figure above.
Guarantee that all triangles are front aligned. [4 marks]
(b) Write pseudocode for a capacity a = query a(x, y, V, T), which returns the
worth of the directly inserted trait at the point (x, y) when the point
lies on the lattice and −1 in any case. Utilize square sections to file vertex (V [i])
also, triangle (T[i, j]) tables. The pseudocode ought to incorporate the recipes required
to figure the added quality worth and to check whether the fact is
inside the triangles. [10 marks]
(c) Suppose that now vertices additionally incorporate a profundity, so V [k] = (xk, yk, zk, ak),
what's more, triangles cross-over and impede each other. How would you want to adjust
the pseudocode to return the property of the noticeable triangle that has the most reduced
z-esteem at a given point? Because of memory limits, you can't utilize the Z-cradle
calculation.