Database such as MySQL and SQL server are an integral part of business, hospital, banks and universities. Immensely, Every person who have of access computer or technology eventually work on to store data.
1. CPD TECHNOLOGIESTM
-An ISO 9001: 2008 Certified
Email: Support@cpd-india.com
Add:- Block C-9/8, Sector -7, Rohini, Delhi 110085, India
2. What is SQL?
SQL stands for Structured Query Language.
Its main aim to store, access and mainpulate data in realtional database.
SQL was developed at IBM company by Donald D. Chamberline and Reymond
F.Boyce. In early 1970s.
All relational database management system like MySQL, MS Access, Oracle and
SQL server use SQL as astandered database langauge.
4. USES of SQL
• SQL is used to communicate with a database
• Used to perform task such as insert data,
update data in database.
• A tool to retrieve the required information
from database.
5. SQL Language Statement
›Clause: The clause are component of the statement
and queries.
›Expression: A combination of symbol and operators
that the database system evaluates to obtain a single data
value
›Queries: Queries are used to give command to server
to perform specific task.
7. (DDL)
Command Description
CREATE Create a new table and a view of a table
ALTER Modify an existing database object, such as
table.
DROP Delete an entire table, a view of a table or other
object in database.
8. Data Manipulation Language (DML)
Command Description
SELECT Retrieve certain record from one or more table.
INSERT Create a record
UPDATE Modify records
DELETE Delete records
9. Data Control Language (DCL)
Command Description
GRANT Gives a privilege to user
REVOKE Take back privilege granted from user
10. SQL
Syntax
Select * from Student;
The above SQL Statement select all records in the “Student” table:
Name Program Enrollment Number
Harsha MCA 126901230
Deepak BCA 125689023
11. CREATE Statement
Create database databaseName;
Create table Student
(
Name varchar(20), //Name has varchar Datatype having size of 20 charecter
Program varchar(10),
Enrol_No int //Enrol_No has integer datatype
)
12. INSERT Statement
The following SQL statement insert data into student table.
Insert into
Student(Name, Program, Enrol_No)
values(‘Aman’, ‘B.Com’, 134567890);
13. DROP Statement
The following statement is used to drop Database and Table.
Drop database databaseName; //delete database
Drop table Student; //delete table from database