SQL full form is Structured Query Language. SQL is a domain-specific language. It is used in application development language to enable a programmer to work with the data. The data is stored in a relational database. To manage this data, we have relational database management systems like SQL Server, MySQL, MS Access, etc. that use SQL as a standard database language.
This introduction to SQL tutorial will give you a quick overview on:
Data is distinct pieces of information, which can be facts, figures, or details that are stored in or used by a computer.
A database is a well-organized collection of data that is stored in an electronic format. To be more specific, a SQL database is an electronic system that allows to easily access, manipulate, and update the data.
Consider a School SQL Database which has a record of the present students and the previously studied students in the Student Details table. Similarly, it may contain Faculty Details, Management Details, Staff Details, and many more depending on the school’s requirement. As the data is in huge amount, to manage it we need a database management system.
Almost all modern databases are managed by a Database Management System (DBMS). Basically, it is a system software used for creating data in a systematic way and managing databases.
DBMS provides, for both users and programmers, a fundamental way to create, retrieve, update, and manage data.
Consider a scenario where a student XYZ wants to change his address. The DBMS searches the details of XYZ in the table ‘Student Details’ from the database ‘School Database’ and displays it for the user, and then the user edits it.
Now, we have a clear picture of a database and its managing system. Let’s move on.
We have two types of database architecture:
In the file server architecture, files are located on the local system. It is useful for sharing information across a network. The client sends a request for a file over the network, and the file server forwards the file to the client. This is considered to be the most primitive type of data service used for exchanging information over a network. The file server provides access to remote server processors too.
Here is an example to understand the implementation of the file server.
Suppose, you have an Excel file and one of your friends requests you to send that file for some information. So, you send a copy to your friend. Now when you make any changes in your original Excel file, those changes would not be reflected in the file which is with your friend.
In this example, you are a file server and your friend is the device requesting for the information. We can conclude on the file server architecture by quoting that the server acts as a sorting device and only one person at a time can have access to it.
In the client server architecture, the database is the server and any application that uses the data is a client.
Here is an example to explain the working of this server. Consider, three OLE DB components or client systems accessing the database at the same time. The systems have logged into the IRCTC website to know the number of trains running from X destination to Y destination.
The client system sends the request to the network server. The network server sends the same request to the database and the final result is sent to the client system. This process is conducted when one system sends the request. But in real time, there will be n number of systems and there can be multiple requests that are sent at a time for the same data. Database server will have to process all the requests simultaneously and send back the requested data to the client systems.
Now we are good to go with SQL! As discussed before SQL full form is a structured query language, it helps you to communicate with the database by commands. Here are some of the features of SQL Database:
SQL commands are traditionally divided into four categories:
Data Query Language comprises only one command ‘select.’ This command can be accompanied by many other clauses to compose queries.
Data Definition Language is power for SQL, which allows a user to create and restructure database objects. The basic DDL commands in SQL are Create Tables, Alter Tables, and Drop Tables.
|CREATE TABLE||It creates a new table|
|DROP TABLE||It deletes the ENTIRE table.|
|ALTER TABLE||Modifies the existing table|
Data Manipulation Language is used to manipulate data within the tables. The basic DML commands in SQL are Insert, Update and Delete.
|SELECT||Retrieve information from database|
|INSERT||Add new information to a database|
|UPDATE||Modifies the information currently stored in a database|
|DELETE||Delete information from the database|
And finally, we have Data Control Access which allows the user to control access to data within the database. These DCA commands are generally used to control the distribution of privileges among users and create objects related to user access. The basic DCL commands in SQL are Grant and Revoke.
This bring us to the end of Introduction to SQL. Here we have learnt what is SQL, SQL full form, SQL Database, all basic SQL commands and its types – DDL, DCL, DML and DQL with examples.Previous Next
Download Interview Questions asked by top MNCs in 2019?