.

Wednesday, January 23, 2019

Sql Programming Language

SQL is an abridgment which stands for Structured Query Language. Some read and pronounced it as denouement while early(a)s pronounce it by reading the letters separately. SQL is a regularize query style used to retrieve learning from infobases. It was origin buty k directing by internationalistic Business Machine (IBM) way back in the 70s and c onlyed its original version as SEQUEL (Structured English Query Language). Since whence it has become the favorite query language for informationbase Management Systems running on minicomputers, mainframes, and Personal Computers up to the present.Query languages argon computer languages used to nonplus queries to informationbase and information brass taken from wikipedia. com. It projects entropybases that ar spread out over some(prenominal)(prenominal) computers in a computer nedeucerks allowing transaction to take place between host and Client computers. It is capable of handling simultaneous request from several users to memory access to database on a computer networks. One ex deoxyadenosine monophosphatele of SQLs application is on websites that allows users to register information and then do updates and hunt later on. SQL is the working on the background to handle e rattlingthing that the user does though we can non see it.In the year 1979 Oracle Corporation introduced SQL as the first commercial-grade database dispensement system. Taken from Webopedia. com http//www. webopedia. com/TERM/S/SQL. htm There ar more than versions of SQL nowadays for the fact that the language itself is still galloping and evolving. In 1986, SQL version complied with American National Standard Institute (ANSI), and in the avocation year 1987 with the International Standard Organization (ISO). Further development was make in the following days containing magnifications and revisions of the relevant parts.Present versions of SQL comp ared to its old versions can already allow access to external data source s or Non-SQL data sources.IS SQL A PROGRAMMING diction?Some lot underrated SQL to be considered as a programing 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 wholenessd 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 tangled postulates which are hard to memorize and incomprehensible in forms. They are all intentional for their own purpose. For instance Cobol is intentional for blood oriented applications, C is for system programming applications. SQL on the other(a) hand is designed for data access. entropy is the more or less valuable element in business systems and the need to be kept, retrieve, and manipulate. And SQL is there to foster.Aside from being different in purpose, one feature of a programming language is the replacement of words to Numeric control conditions. These are both features of the 3rd Generation and the 4th Generation languages. For instance, the instrument code delineate by a combination of bits 0s and 1s to look for file directories is replaced by using the English word Dir. save if we leave alone look at the syntax and forms that it takes it exit still ponderous awkward English. If you are not familiar with Dir you could still get mazed with how you are going to use it. 3rd Generation and High-Level Languages are still far stiffr to the real mankind 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 solidifying last note = Sequel WHERE fldidnumber = 2000-c-0001. The command resembles closely to an English sentenc e structure. It is oftentimes closer to human language to manipulate data so it eliminates the threat of using the wrong command since the command itself is more easier to understand. What would happen if you see command that takes that form in future versions of C++, in Java and in other spicy 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 consecrate to support the lacking capability of the other in completing a genuine designate. 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 only settlement is to consider using any possible combination between the two separately designed languages. That is wherefore 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 enable data manipulation. These programmers works are often disrupted when they fail to mark properly some of the machine based commands or partially human like words even though when given in abounding listings.If there is a programming language that offers much more legibility then that would be scoop up 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, save perhaps decades. And that SQL is designed primarily for data access not for creation of another complex application. But it is the easies t 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 resembling other programming languages, SQL commands are categorized according to its functions. These functions include constrain 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(prenominal) as the creation or the deletion of a table. Examples of DDL Commands are produce TABLE CommandTables in databases are the most ba sic structure where all information pertaining to particular records are stored in columns called fields. A table is be of at least two or more columns or fields. Records expand in rows.syntax stimulate TABLE table_ hold (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 ( starting timeName char(40), LastName char(40), Address char(40), urban center char(50), Country char(25), Birth_Date date) ALTER TABLE Command This command is used to sort a table structure.Syntax ALTER TABLE table_name alter specification alter specification are listed on a lower floorFor Adding impertinent column ADD NewColumn data type for NewColumn 1.For Deleting or move 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 experimental condition 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 in general 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 dupes 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 F ROM 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 in spite of appearance objects of a relational database. There are three basic DML commands listed below shut 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 convert a certain record.Syntax UPDATE tablename SET ColumnName = new value WHERE condition.Example UPDATE Employee SET Lastname = Eckert WHERE IdNumber = 2000-c-0001. invalidate 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 datab ase 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 put together 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 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 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 AUDIT STOP AUDIT6. Transactional Control CommandsThese commands allows user to manage all database minutes 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 unthrough 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 bring 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 piece of ass 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 Graphica l user Interfaces which allows point and get across operation.Another feature of these servers are the capability to consecrate SQL commands which corresponds to a certain operation. This is very advantageous for users who are using only point and click plectron 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 do 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.Ramak rishnan, 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 Hall, 1997.

No comments:

Post a Comment