Pass1000 > Oracle > A Set-oriented Language :Summarize the SQL Language

A Set-oriented Language :Summarize the SQL Language

02.08.2010 by admin - 0 Comment
Posted in Oracle

A Set-oriented Language :Summarize the SQL Language
Most 3GLs are procedural languages. Programmers working in procedural languages specify what to do with data, one row at a time. Programmers working in a setoriented language say what they want to do to a group (a “set”) of rows and let the database work out how to do it to however many rows are in the set.
Procedural languages are usually less efficient than set-oriented languages at managing data, as regards both development and execution. A procedural routine for looping through a group of rows and updating them one by one will involve many lines of code, where SQL might do the whole operation with one command: programmers’ productivity increases. During program execution, procedural code gives the database no options; it must run the code as it has been written. With SQL, the programmer states what he or she wants to do but not how to do it: the database has the freedom to work out how best to carry out the operation. This will usually give better results.
Where SQL fails to provide a complete solution is that it is purely a data access language. Most applications will need procedural constructs, such as flow control: conditional branching and iteration. They will also usually need screen control, user interface facilities, and variables. SQL has none of these. SQL is a set-oriented language capable of nothing other than data access. For application development, one will therefore need a procedural language that can invoke SQL calls. It is therefore necessary for SQL to work with a procedural language.
Consider an application that prompts a user for a name, retrieves all the people with that name from a table, prompts the user to choose one of them, and then deletes the chosen person. The procedural language will draw a screen and generate a prompt for a name. The user will enter the name. The procedural language will construct a SQL SELECT statement using the name and submit the statement through a database session to the database server for execution. The server will return a set of rows (all the people with that name) to the procedural language, which will format the set for display to the user and prompt him to choose one (or more) of them. The identifier for the chosen person (or people) will then be used to construct a SQL DELETE statement for the server to execute. If the identifier is a unique identifier (the primary key) then the set of rows to be deleted will be a set of just one row; if the identifier is nonunique, then the set selected for deletion would be larger. The procedural code will knownothing about the likely size of the sets retrieved or deleted.

Random Posts

  • December 19, 2009 -- COG-135:Pass IBM Cognos 8 BI OLAP Developer COG-135 Exam (0)
    The leader among the providers of Cognos 8 BI OLAP Developer COG-135 preparatory materials is products such as (COG-135 Exam)IBM pdf Braindumps(Printable Version).Pass1000 successful Guide students to pass any IT certification. Provide latest certif...
  • November 2, 2009 -- About EXIN (0)
    About EXIN EXIN, the Examination Institute for Information Science, is a global, independent and not for profit IT examination provider. It's EXIN's mission to improve the quality of the IT sector, the IT professionals and the IT users, by means of indep...
  • October 20, 2009 -- Sun Certified Java CAPS Integrator (310-502 Exam) (0)
    The Sun Certified Java CAPS exam is for candidates who have attended foundation training in the Java CAPS 5.1 product. This exam presumes the test candidate has knowledge of Java CAPS which can be achieved through attendance on the SB-CAP-0501 and SB-CAP-...
  • January 18, 2010 -- LOT-735:Pass IBM-LOTUS LOT-735 Exam Administering IBM Lotus Sametime7.5 (0)
    The leader among the providers of "LOT-735" IBM Lotus Notes Domino 8.5 Sys Admin Operating Fundamentals LOT-735 preparatory materials is products such as latest (LOT-735 Exam)IBM pdf Braindumps(Printable Version).Pass1000 successful Guide students t...
  • December 30, 2009 -- LOT-847:Pass IBM Lotus Notes Domino 8 System Admin Operating Fundamentals LOT-847 Exam (0)
    The leader among the providers of "LOT-847" IBM Lotus Notes Domino 8 System Admin Operating Fundamentals LOT-847 preparatory materials is products such as (LOT-847 Exam)IBM pdf Braindumps(Printable Version).Pass1000 successful Guide students to pass...

Comments are closed.