SQL basics

sqlThe full form of SQL is Structured Query Language. It is mainly used for creating databases, for retrieving and manipulating the data. It is a form of standard query language in the relational management systems.

The company that first put the product in the market using the SQL was the Oracle Corporation. The SQL got approved by the American National Standard Institute for the relational database in the year of 1980. After that it was also approved by the ISO (International Standard Organization).

The SQL is the actually a non procedural language, in contrast with the other languages like the C and COBOL that was created at that time. For most of the RDBMS, the commonly used database language is the SQL. The American standard institute and International Standard organization have currently propped up the SQL standard to exchange. Most of the systems make proprietary extension to the SQL that extends the language in to a perfect procedural language.

What is the SQL Database?

The SQL database is the relational database where the information gets organized in the tables. The information of every single table is related closely in one or more table of the database.
Creation of new databases can be done by these following commands:

CREATE DATABASE name of the database

Many applications of the database permit you to create the new database through the boundary.

Build and manipulate a table

Every relational database consists of tables provided with information that is arranged in series of rows or columns. The different commands found in data definition area of the SQL are mainly used for changing and creation of the tables. They are not limited, but include: CREATE, DROP and ALTER.

The CREATE TABLE creates new table where you can allocate specific property to each and every column.

Here’s an example:

CREATE TABLE Students
(
Student ID 120,
Year II year,
Last Name hardy,
Firstname brad,
)

The table is titled as STUDENTS. It has four columns with specific data types. The data types include the types of data like the numbers, characters or the date that are assigned that particular column.

DROP & ALTER

The DROP and the ALTER commands are used for manipulating the existing tables.

The DROP can be used for deleting a table from the database system by adding the DROP column to Alter Statement which will remove the column form the table by this command:

ALTER TABLE name of Table DROP COLUMN name of column

ALTER could be used for adding columns or changing the type of data in the existing column table. In the SQL the command for column adding with ALTER is given below:

ALTER TABLE table name

ADD column name datatype;

For changing the existing column, the syntax is as under:

ALTER TABLE table name

ALTER COLUMN column name data type;

INSERT & DELETE

The INSERT and the DELETE are the commands that manipulate, edit or change data in the SQL.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>