Saturday, May 25, 2019

Sql Programming Language

SQL is an abbreviation which stands for Structured Query Language. Some read and phrased it as catastrophe while others pronounce it by reading the letters separately. SQL is a standardized query wording apply to retrieve information from entropybases. It was origin tout ensembley designed by International line of merchandise Machine (IBM) way back in the 70s and called its original version as SEQUEL (Structured English Query Language). Since then it has become the favorite query voice communication for Database Management Systems running on minicomputers, mainframes, and Personal Computers up to the present.Query languages argon computer languages utilize to make queries to infobase and information dodging taken from wikipedia. com. It supports databases that be spread place over several computers in a computer networks allowing transaction to take place between Server and Client computers. It is capable of handling simultaneous pick up from several drug users to bo ther to database on a computer networks. One example of SQLs application is on websites that allows users to register information and then do updates and bet later on. SQL is the working on the background to handle everything that the user does though we can non see it.In the year 1979 Oracle Corporation introduced SQL as the first commercial database charge system. Taken from Webopedia. com http//www. webopedia. com/TERM/S/SQL. htm at that place argon many versions of SQL forthwith for the fact that the language itself is still going and evolving. In 1986, SQL version complied with American National stock Institute (ANSI), and in the following year 1987 with the International Standard Organization (ISO). Further development was made in the following years containing expansions and revisions of the relevant parts.Present versions of SQL comp bed to its obsolescent versions can already allow access to external data sources or Non-SQL data sources.IS SQL A PROGRAMMING LANGUAGE?S ome people underrated SQL to be considered as a programming language. These people have forgotten to accept the definition itself which states that it is a language. When they talk of programming languages the first things that come to their minds atomic number 18 Assembly Language, Cobol, Fortran, Java, and C++. They insist that it is not compiled and contains less(prenominal)er functions compared to the above mentioned languages.Yes, SQL is a programming language. The languages mentioned above are 3rd generation and High-Level Languages which were invented to ease the problem of using knotty controls which are hard to memorize and incomprehensible in forms. They are all designed for their own purpose. For instance Cobol is designed for business oriented applications, C is for system programming applications. SQL on the other hand is designed for data access. Data is the most valuable element in business systems and the need to be kept, retrieve, and manipulate. And SQL is in that respect to help.Aside from beingness different in purpose, one feature of a programming language is the convertment of words to Numeric commands. These are both features of the 3rd Generation and the 4th Generation languages. For instance, the machine code represented by a combination of bits 0s and 1s to look for file directories is replaced by using the English word Dir. But if we will look at the syntax and forms that it takes it will still sound awkward English. If you are not long-familiar with Dir you could still get confused with how you are going to use it. 3rd Generation and High-Level Languages are still far closer to the real gentlemans gentleman language.SQL on the other hand is a 4th Generation Language that is very close to the human language. For instance the SQL command UPDATE Employees SET lastname = Sequel WHERE fldidnumber = 2000-c-0001. The command resembles closely to an English sentence structure. It is much closer to human language to manipulate data so it eliminates the threat of using the wrong command since the command itself is much easier to understand. What would happen if you see command that takes that form in future versions of C++, in Java and in other high take aim languages? Will you no longer consider them as a programming language?Another thing to remember is that these languages are now being used in combination in order to support the lacking capability of the other in completing a certain task. A programming language designed mainly for numeric calculations may find it hard to perform data access. What if a completion of task needs both data access and numeric calculations? The only solution is to consider using any assertable combination between the two separately designed languages. That is why SQL commands are being embedded in some Non SQL Products. Do not underestimate the application of SQL for fast data access.We should remember that the main pinnacle of developing computer programming languages is to make data manipulation possible through the use of computer. In order for data manipulation to be successful, computers must be instructed with particular sets of commands. These commands are coded or programmed by computer programmers that when once completed will enable data manipulation. These programmers works are often disrupted when they fail to recognize decently some of the machine based commands or partially human like words even though when given in full listings.If there is a programming language that offers much more readability then that would be best suited in situations like this, and the best example is the SQL. Maybe its less functionality comes from the fact that conversion of all machine based codes do not only took days, but perhaps decades. And that SQL is designed primarily for data access not for creation of another complex application. But it is the easiest one to use when dealing with data access and that is undeniable. That is why up to the present SQL is still being revise and expanded with other functionalities.In the end it is still a language and is considered 4th Generation languages.SQL COMMANDSTypes of SQL Commands Like other programming languages, SQL commands are categorized according to its functions. These functions acknowledge building database objects like tables and queries, manipulating objects, inserting data to existing tables, updating existing data in tables, deleting existing data from tables, performing database queries, controlling database access, and overall database administration. The main categories are1. DDL (Data Definition Language)Data Definition Language, DDL, is consists of SQL commands that allows a user to create and restructure database objects, such as the creation or the deletion of a table. Examples of DDL Commands are pee-pee delay CommandTables in databases are the most basic structure where all information pertaining to particular records are stored in columns called handle. A table is co mposed of at to the lowest degree two or more columns or fields. Records expand in rows.Syntax CREATE TABLE table_name (column 1 data_type_for_column_1, column 2 data_type_for_column_2, )All you have to do is replace the portion table_name with the name of the table you will create, replace column1 with the name of the first field followed by space and followed by data type of the first field.Example CREATE TABLE Employee (FirstName char(40), LastName char(40), Address char(40), City char(50), Country char(25), Birth_Date date) ALTER TABLE Command This command is used to change a table structure.Syntax ALTER TABLE table_name alter specification alter specification are listed belowFor Adding new column ADD NewColumn data type for NewColumn 1.For Deleting or overleapping an existing column DROP ColumnName.For Changing a column name CHANGE OldColumnName NewColumnName data type for NewColumnName.For Changing the data type for a column MODIFY ColumnName newdatatype.Examples If we want to add a column for Employee perspective with data type Char ALTER table Employee add Employee_Status char(1) To rename Employee_Status to EmpStat ALTER table Employee change Employee_Status EmpStat char(50)DROP TABLE CommandUsed to delete an existing table. Syntax Drop tablename.Example Drop Employee.CREATE INDEX CommandIndexes are created to make searches much faster. Most index are defined on fields which is mostly used for clear-cut like the id number, or lastname fields.Syntax CREATE INDEX index_name ON table_name (column_name).Example CREATE INDEX idxFirstname ON Employee (Firstname)CREATE VIEW CommandViews are like tables, but they do not physically stores data which table does. Views only stores data temporarily.Syntax CREATE VIEW VIEW_NAME AS SQL Statement.Example CREATE VIEW VwEmployee AS SELECT FirstName, LastName, Country FROM Employee.Other commands included in DDL are Drop View and Drop Index.2. DML (Data Manipulation Language)Data Manipulation Language, DML, is con sists of SQL commands used to manipulate data indoors objects of a relational database. There are third basic DML commands listed belowINSERT CommandInsert command is used to add record to a database table.Syntax INSERT INTO tablename (column1, column2, ) VALUES (value1, value2, ).Example INSERT INTO Employee (Firstname, Lastname, ) VALUES (John,Mayer).UPDATE CommandThis command is used to modify a certain record.Syntax UPDATE tablename SET ColumnName = new value WHERE condition.Example UPDATE Employee SET Lastname = Eckert WHERE IdNumber = 2000-c-0001. erase CommandThis command is used to delete records from a table.Syntax DELETE FROM tablenameWHERE condition.Example DELETE FROM Employee WHERE IdNumber = 2000-c-0001.3. DQL (Data Query Language)This command is used to retrieve from one or more tables in a database or from other databases.SELECT CommandSyntax SELECT columnname FROM tablename.Example To select only the firstname and the lastname fields of all records from table e mployee SELECT Firstname, Lastname FROM Employee.4. DCL (Data Control Language)These commands allows user to configure how user can access the database. These DCL commands are normally used to create objects related to go through limitations to user access and also control the distribution of privileges among users.Example of these commands are listed belowALTER PASSWORD GRANT REVOKE CREATE SYNONYMYou will find that these commands are often grouped with other commands and may appear in a number of different lessons throughout this book.5. Data administration commandsData administration commands allow the user to perform audits and perform analyses on operations within the database. They can also be used to help analyze system performance. Two general data administration commands are as follows START AUDIT STOP AUDIT6. Transactional Control CommandsThese commands allows user to manage all database transactions that are taking place within a certain period of time.COMMIT this comman d confirms saving of all database transactions that were made by the userROLLBACK this command is used to scratch or undo all database transactions that were made by the userSAVEPOINT Used to create points within groups of transactions in which to be undone or ROLLBACKSET TRANSACTION Places a name on a transactionTHE IMPORTANCE OF SQL IN TODAYS BUSINESS APPLICATIONSTodays business organizations practice is far more different from the by. It is mostly characterized by the computerization of manual data processing, allowing online inquiries, buying, selling, payment, money transfers, social networking, and information sharing.Because data is the most important value for any organization, the demand in the use of SQL which is widely used in the past up to the present is expected to grow. With the expansion of SQLs use from minicomputers, mainframes, PCs, Local Area Network, it is now working behind sophisticated internet based applications. There is a huge demand in the development o f these types of applications nowadays and the demand is predicted to grow in the years to come. There are recent effort to expand SQL for multimedia purposes. We will start checking the importance of SQL versions in todays business applications.Perhaps one of the most powerful features of SQL is its ability to support Server-Client transactions. This is made possible by using SQL Servers which allows database creation. This is what is being implemented in internet based application, in database systems in local area networks which allow several users to access data simultaneously. A Database is created on an SQL Server placed on Large Server Computers and the server is the one that will process the request from several clients. Several Versions of SQL Servers nowadays already have Graphical user Interfaces which allows point and click operation.Another feature of these servers are the capability to generate SQL commands which corresponds to a certain operation. This is very advanta geous for users who are using only point and click option and then later on check what commands are actually done by that whole process. The point and click view is often called as innovation View, while the SQL generated is called the SQL View. For example the creation by clicking a Create View Button in Design View will generate the Create View command that will be shown on SQL View.So it offers much more advantage for beginning SQL users to master SQL Commands, and for practiced users to check their manually created SQL commands by comparing to the ones generated when using point and click option in Design View.REFERENCESPatrick ONeil, Database Principles, Programming, Performance, Morgan Kaufmann 1994Elmasri & Navathe, Fundamentals of Database Systems, Benjamin/Cummings, 1994.Ramakrishnan, Database Management Systems, McGraw Hill, 1996.Date & Darwin, A Guide to the SQL Standard, Fourth Edition, Addison-Wesley, 1993.Ullman & Widom, A First Course in Database Systems, Prentice H all, 1997.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.