Sunday, March 10, 2019
Sql Programming Language
SQL is an contraction which stands for Structured Query Language. Some read and pronounced it as misfortune while separates pronounce it by reading the letters separately. SQL is a standardised query speech communication used to retrieve breeding from informationbases. It was origin completely(a)y k nowing by transnational Business Machine (IBM) way back in the 70s and called its original version as SEQUEL (Structured English Query Language). Since and then it has become the favorite query language for informationbase Management Systems running on minicomputers, mainframes, and Personal Computers up to the present.Query languages ar computer languages used to progress to queries to infobase and information arranging taken from wikipedia. com. It go fors databases that atomic number 18 spread out over some(prenominal) computers in a computer ne tworks allowing transaction to take place mingled with legion and Client computers. It is capable of handling simultaneo us request from several(prenominal) users to rag 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 depend later on. SQL is the working on the background to handle e rattlingthing that the user does though we cannot see it.In the year 1979 Oracle Corporation introduced SQL as the first mercantile database manipulatement system. Taken from Webopedia. com http//www. webopedia. com/TERM/S/SQL. htm There ar umpteen versions of SQL nowadays for the fact that the language itself is still going and evolving. In 1986, SQL version complied with American National Standard Institute (ANSI), and in the adjacent year 1987 with the International Standard Organization (ISO). Further development was do in the following long time containing involutions and revisions of the relevant parts.Present versions of SQL comp atomic number 18d to its old versions can already allow access to external da ta sources or Non-SQL data sources.IS SQL A PROGRAMMING vocabulary?Some the great unwashed underrated SQL to be considered as a program 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 are Assembly Language, Cobol, Fortran, Java, and C++. They insist that it is not compiled and contains lesser functions compared to the above menti id languages.Yes, SQL is a programming language. The languages mentioned above are third Generation and High-Level Languages which were invented to ease the problem of using make complex ascendencys which are hard to memorize and incomprehensible in forms. They are all intentional for their own purpose. For instance Cobol is intentional for assembly line oriented applications, C is for system programming applications. SQL on the former(a) hand is designed for data access. data is the more or less valuable eleme nt in business systems and the need to be kept, retrieve, and manipulate. And SQL is there to dish.Aside from being different in purpose, one feature of a programming language is the replacement of words to Numeric program lines. These are both(prenominal) features of the 3rd Generation and the 4th Generation languages. For instance, the form code delineated by a combination of bits 0s and 1s to look for file directories is replaced by using the English word Dir. scarcely if we depart look at the syntax and forms that it takes it willing still vowelise awkward English. If you are not familiar with Dir you could still get disunited with how you are going to use it. 3rd Generation and High-Level Languages are still far terminationr to the real 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 couch last come across = Sequel WHERE fldidnumber = 2000-c-0001. The comma nd resembles closely to an English sentence structure. It is a great deal 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 extravagantly level 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 assure to support the lacking capability of the other in completing a real chore. A programming language designed mainly for numeric calculations whitethorn find it hard to perform data access. What if a completion of task needs both data access and numeric calculations? The tho dissolver is to consider using any possible 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 point 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 alter data manipulation. These programmers works are often disrupted when they fail to recognise properly some of the machine based commands or partially human like words even though when given in extensive listings.If there is a programming language that offers much much readability then that would be better(p) 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, exactly perhaps decades. And that SQL is designed primarily for data access not for creation of anot her 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 revised and expanded with other functionalities.In the end it is still a language and is considered 4th Generation languages.SQL COMMANDSTypes of SQL Commands homogeneous other programming languages, SQL commands are categorized according to its functions. These functions include 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 build and restructure database objects, such as the creation or the deletion of a table. Examples of DDL Commands are give rise TABLE CommandT ables in databases are the most basic structure where all information pertaining to particular records are stored in columns called fields. A table is composed of at least two or more columns or fields. Records expand in rows. sentence structure earn TABLE table_ shit (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), metropolis char(50), Country char(25), Birth_Date date) ALTER TABLE Command This command is used to channelise a table structure.Syntax ALTER TABLE table_name alter specification alter specification are listed on a lower floorFor Adding raw column ADD NewColumn data type for NewColumn 1.For Deleting or falling an existing column DROP ColumnName.For Changin g 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 stance with data type Char ALTER table Employee add Employee_Status char(1) To call 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 for the most part used for searching 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 Command fancys 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 Fi rstName, 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 consists of SQL commands used to manipulate data at heart objects of a relational database. There are three basic DML commands listed below usher in 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 deepen a certain record.Syntax UPDATE tablename SET ColumnName = new value WHERE condition.Example UPDATE Employee SET Lastname = Eckert WHERE IdNumber = 2000-c-0001. cut 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 employee SELECT Firstname, Lastname FROM Employee.4. DCL (Data Control Language)These commands allows user to assemble how user can access the database. These DCL commands are normally used to create objects related to implement limitations to user access and also control the scattering 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 whitethorn 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 AUDI T STOP AUDIT6. Transactional Control CommandsThese commands allows user to manage all database legal proceeding that are taking place within a certain period of time.COMMIT this command 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 un do 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 past. It is mostly characterized by the cybernation 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 imply in the use of SQL which is astray used in the past up to the present is expected to grow. With the expansi on of SQLs use from minicomputers, mainframes, PCs, Local Area Network, it is now working bunghole sophisticated internet based applications. There is a huge demand in the development of 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(prenominal) Versions of SQL Servers nowadays already have Graphi cal user Interfaces which allows point and rupture operation.Another feature of these servers are the capability to puzzle SQL commands which corresponds to a certain operation. This is very advantageous for users who are using only point and click picking and then later on check what commands are actually done by that whole process. The point and click view is often called as Design View, while the SQL generated is called the SQL View. For example the creation by clicking a raise 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 expert 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.Ramakrishna n, Database Management Systems, McGraw Hill, 1996.Date & Darwin, A take aim to the SQL Standard, Fourth Edition, Addison-Wesley, 1993.Ullman & Widom, A First Course in Database Systems, assimilator Hall, 1997.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment