Question:
How are C, Cobol and PL/SQL all different from SQL?
willsi_1989
2009-01-12 16:41:34 UTC
I am new to programming.
Been looking into SQL for a week now.
I was wanting to know how some of the other 3rd generation languages like C, Cobol and PL/SQL are different from SQL.
Also how are they used with SQL.

Any help would be grateful, thanks.
Five answers:
Martin T
2009-01-12 20:37:33 UTC
SQL is a special purpose programming language, it does the job it was designed for very well, but cannot be used for anything else. The other languages you mention are general purpose programming languages, they can be used to program any task that can be rigorously defined.



Having said that, PL/SQL is mainly used for database work. It is essentially an extension of SQL. It is not a bad language, but is not designed for large and complex programs. I would not like to write a program more than a few hundred lines long in it.



Cobol was designed in the early 60s as a language for business purposes. Legend has it that one of the ideas behind it was to make a language that management could easily read -that idea did not work but it was for many years one of the most popular programming languages. I have never used it and never want to - it has some very awkward features, largely because it was designed when understanding of what made for a good programming language was in its infancy. Today people using have all sorts of sophisticated tools to help them write it and I'm told that as a result it is effectively a far better language than it used to be. I don't know how it is used with SQL.



C was originally designed to generate code which was as efficient as possible. It is possible to use it to delve into the depths of the computer - to access specific memory locations and easily manipulate individual bits. It proved very popular on microcomputers back when such machines were several thousand times slower than they are today and efficiency was vitally important. On the minus side, it has an awkward syntax that takes a lot of getting used to. There are 2 ways I know of to access SQL from C. One way is to use C's text handling features to construct SQL statements. This is clumsy, but C's text handling is very powerful. Another, easier, way is to use a tool that turns SQL statements into C code. It is then easy to embed SQL in the C program.



C has proven so popular that is has grown up and had children. C++ is a more powerful version of C. It is one of the most complex languages ever designed. It has many features which make it suitable for large projects.



Java is a kind of simplified C++ with the difficult bits left out. A lot easier to learn and easier to use.



Python, my favourite language, is one of the easiest programming languages to use. It sits on top of a program written in C - but can be used by people who cannot be bothered learning C. It runs 2 or 3 times slower than C, but modern machines are so fast that this often does not matter. And it is easy to mix in C code to speed it up if necessary.
Ysocreus
2009-01-12 17:09:16 UTC
you must be new all of the languages are unique and different in their own way, C is nothing like cobol you'd be surprised how many apps are actually written in C++ (maybe even cobol) which by the way is the Common Business Orientated Language, the government adopted it years ago and if you had a contract with the gov you had to use cobol so that gov auditors could examine how your program operates to make sure your up to par and no cheating, don't have much experience or knowledge of sql programming though, the major difference is learning the syntax of the language, it's kinda like learning french, spanish, or latin, spanish relates to a lot of languages like italian
alvin f
2009-01-12 18:12:17 UTC
SQL is computer language that does not require writing traditional programming logic. It is a "non-procedural language", also known as a "declarative language". Users concentrate on defining the input and output rather than the program steps required in a procedural language such as C and COBOL.



There is a clue in the name PL/SQL "Procedural Language/Structured Query Language"



SQL statements are usually embedded in C or COBOL by using Macros.

See - http://en.wikipedia.org/wiki/C_preprocessor
TheMadProfessor
2009-01-13 05:32:56 UTC
C and Cobol are two types of programming languages - these are used to create programs which can be compiled into machine language and subsequently executed by the computer to perform a specific task.



PL/SQL is a scripting language (specifically, one used by Oracle) - while similar to a programming language, it is interpreted line-by-line at execution time instead of compiled and is used to perform a high-level sequence of tasks of an application, including executing various compiled programs.



SQL is a database maintenance and retrieval language specifically intended for interacting with relational databases. SQL code can be executed in 'stand-alone' form for table query and updating or 'embedded' in various other languages (including all the above three examples) for performing database operations.
2016-04-10 06:30:29 UTC
I'd agree that Cobol and Java is the best combo - Java is cross-platform and similar enough to C# that learning both is overkill anyway. Cobol is still widely used in the mainframe world, plus is starting to spread into the desktop area as well (MicroFocus Cobol, Visual Cobol, etc.) The 2002 implementation of it added a number of features such as object-oriented support that brought it in line with newer technologies.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...