Providing results of queries, PL-SQL Programming

Providing Results of Queries

Expressing queries in SQL is the (big) subject. Here I present just a simple example to give you the flavour of things to come in those chapters. Example is a query expressing the question, who is enrolled on course C1?

Example: A query in SQL

SELECT DISTINCT StudentId, Name

 FROM ENROLMENT

WHERE CourseId = CID ('C1')

Note carefully that Example not a command (hence the absence of a semicolon). It is just an expression, denoting a value -in this case, a table. In SQL the result of a query is always another table. Figure shows the result of Example in the usual tabular form.

1718_Providing Results of Queries.png

                                                                   Figure: Result of query in Example

Explanation:

  1. SELECT DISTINCT StudentId, Name specifies that the result of the WHERE invocation is to be projected over StudentId and Name.
  2. FROM ENROLMENT specifies the table operand for the invocation of WHERE
  3. WHERE CourseId = CID ('C1') specifies that just the rows for course C1 are required.
Posted Date: 1/18/2013 1:32:44 AM | Location : United States







Related Discussions:- Providing results of queries, Assignment Help, Ask Question on Providing results of queries, Get Answer, Expert's Help, Providing results of queries Discussions

Write discussion on Providing results of queries
Your posts are moderated
Related Questions
Using FOR UPDATE If you declare a cursor which will be referenced in the CURRENT OF clause of an UPDATE or DELETE statement, you should use the FOR UPDATE clause to obtain an

Keys in SQL SQL support for keys in the following respects: SQL does not require at least one key for every base table. If no key is explicitly declared, then KEY {ALL B

Majority of Differences among 9i, 10G, 11G :- These are some combine feature which has differences among others. Automatic Workload Repository (AWR) Drop database' s

Equivalences & Rewrite Rules: If notice that as well as allowing us to prove trivial theorems, and tautologies enable us to establish that certain sentences are saying the sam

Advantages of Packages The benefits of the Packages are as shown below: Modularity The Packages encapsulate logically associated items, types, and subprograms in the

heap sort program in pl/sql

Manipulating Individual Elements Faraway you have manipulated an entire collection. Within the SQL, to manipulate the individual elements of the collection, and then use the ope

Negation (NOT, ¬) - SQL There are three rows instead of just two. As you can see, ¬ p is defined as in two-valued logic (2VL) when p is either true or false, but ¬ (unknown) i

Using LIMIT For nested tables, that have no maximum size, the LIMIT returns NULL. For varrays, the LIMIT returns the maximum number of elements that a varray can have (that yo

Use Object Types and Collections The Collection types and object types increase your efficiency by allowing for the realistic data modeling. The Complex real-world entities an