332x Filetype PDF File size 2.45 MB Source: www.hcoe.edu.np
SQL Tutorial
SQL TUTORIAL
Simply Easy Learning by tutorialspoint.com
tutorialspoint.com
i
ABOUT THE TUTORIAL
SQL Tutorial
SQL is a database computer language designed for the retrieval and management of data in relational
database. SQL stands for Structured Query Language.
This tutorial will give you quick start with SQL.
Audience
This reference has been prepared for the beginners to help them understand the basic to advanced
concepts related to SQL languages.
Prerequisites
Before you start doing practice with various types of examples given in this reference, I'm making an
assumption that you are already aware about what is database, especially RDBMS and what is a
computer programming language.
Copyright & Disclaimer Notice
All the content and graphics on this tutorial are the property of tutorialspoint.com. Any content from
tutorialspoint.com or this tutorial may not be redistributed or reproduced in any way, shape, or form
without the written permission of tutorialspoint.com. Failure to do so is a violation of copyright laws.
This tutorial may contain inaccuracies or errors and tutorialspoint provides no guarantee regarding the
accuracy of the site or its contents including this tutorial. If you discover that the tutorialspoint.com site
or this tutorial content contains some errors, please contact us at webmaster@tutorialspoint.com
TUTORIALS POINT
Simply Easy Learning
Table of Content
SQL Tutorial ............................................................................. 2
Audience .................................................................................. 2
Prerequisites ............................................................................ 2
Copyright & Disclaimer Notice .................................................. 2
SQL Overview ........................................................................ 15
What is SQL? ........................................................................................... 15
Why SQL? ................................................................................................ 15
History: ..................................................................................................... 16
SQL Process: ........................................................................................... 16
SQL Commands: ...................................................................................... 17
DDL - Data Definition Language: ............................................................. 17
DML - Data Manipulation Language: ........................................................ 17
DCL - Data Control Language: ................................................................. 17
DQL - Data Query Language: .................................................................. 17
SQL RDBMS Concepts .......................................................... 18
What is field? ............................................................................................ 19
What is record, or row? ............................................................................ 19
What is column? ....................................................................................... 19
What is NULL value?................................................................................ 19
SQL Constraints: ...................................................................................... 20
NOT NULL Constraint: ............................................................................. 20
DEFAULT Constraint:............................................................................... 21
Example: .................................................................................................. 21
Drop Default Constraint: ........................................................................... 21
UNIQUE Constraint: ................................................................................. 21
Example: .................................................................................................. 21
DROP a UNIQUE Constraint: ................................................................... 22
PRIMARY Key: ......................................................................................... 22
Create Primary Key: ................................................................................. 22
Delete Primary Key: ................................................................................. 23
FOREIGN Key: ......................................................................................... 24
Example: .................................................................................................. 24
DROP a FOREIGN KEY Constraint: ........................................................ 25
CHECK Constraint: .................................................................................. 25
Example: .................................................................................................. 25
DROP a CHECK Constraint: .................................................................... 25
INDEX: ..................................................................................................... 26
TUTORIALS POINT
Simply Easy Learning
no reviews yet
Please Login to review.