30 likes | 129 Views
1. A plain query. SELECT " LastName ", " FirstName " FROM "Students" WHERE "Department" = 'CS'; Query Plan: Query plan text: " Seq Scan on "Students" (cost=0.00..12.88 rows=1 width=236)" " Filter: (("Department")::text = 'CS'::text)". 2 A little complex query.
E N D
1. A plain query SELECT "LastName", "FirstName" FROM "Students" WHERE "Department" = 'CS'; Query Plan: Query plan text: "Seq Scan on "Students" (cost=0.00..12.88 rows=1 width=236)" " Filter: (("Department")::text = 'CS'::text)"
2 A little complex query select I."Cid",max("Grade") from "Inroll" as I, "Students" as S where S."Sid" = I."Sid" And S."Department" = 'CS' group by I."Cid"; Query Plan:
3. Nested Query select "LastName", "Firstname" from "Inroll" as I, "Students" as S where S."Sid" = I."Sid" and I."Cid" = 'CS2223' and I."Sid" in (select "Sid" from "Inroll" where "Cid" = 'CS4432'); Query Plan: