SlideShare uma empresa Scribd logo
1 de 10
[SQL Tutorial – Part - 1]
by
[Speed4Career]
About Us:
 In modern days economic system the most
valuable asset is knowledge. Day by day
increasing competition and invention of
cutting edge technologies are the results of
revolution in the global Educational system
and use of process oriented learning
environment.
 This process oriented learning environment
is essential for the modern corporate world.
Speed4career.com understands the nature
of this revolution.
 We are committed to this process oriented
learning environment and set our goals to
help in creating a better modern corporate
world, more over a better world for our
future generation.
 In this quest for creating a process oriented
learning environment www.speed4career.com
introducing a new module – Tutorial.
 In this “Tutorial” module we are discussion
about the BEGINNERS lesson for the technology
related subjects.
 All the Tutorials are created by the INDUSTRY
EXPERTS working on the same field for years.
 For more details please visit:
www.speed4career.com/blog
SQL for Beginner – PART I
 About SQL:
 Collection of organized data called as
DATABASE. When we define, create, query
and update the database through software
then that system known as “Database
Management System” or “DBMS”. When we
want to manage all this things through
programming language then we use “SQL” or
“Structured Programming Language”.
 SQL was initially developed at IBM by Donald
D. Chamberlin and Raymond F. Boyce.
 Data Definition Language:
 Whenever you want to build or destroy or
altered any structure of database object at
that time whatever SQL commands we follow
those are inside of Data Definition
Language’s scope.
 SQL Commands:
1. Create – It will create an object in database.
2. Alter – It will alter required object in
database.
3. Drop – It will destroy the whole structure of
an object in database.
 Syntax:
1. CREATE table <table_name> (column_name
datatype,.....column_name datatype);
2. ALTER table <table_name>
add/modify/drop/rename column_name
datatype;
3. DROP table <table_name>
These are the examples of basic DDL SQL
commands. In advance SQL tutorial we will
give lots of other example.
So by this SQL command first we create a
table named “Speed4career_User_Details”
which has 5 columns.
 Command:
CREATE TABLE Speed4career_User_Details(
User_ID VARCHAR2(10),
User_Name VARCHAR2(200),
Address VARCHAR2(1000),
City VARCHAR2(100),
Postal_Code Number,
Country VARCHAR2(100),
Phn_number VARCHAR2(20));
[Note: - We are following Oracle SQL syntax for
this tutorial. SQL is NOT case sensitive]
Suppose you want to change the column
name “Postal_code” to “Zip_code” of this
table then you have to use ALTER command
to do this.
 Command:
ALTER TABLE Speed4career_User_Details
RENAME Postal_code TO Zip_code;
After change this now you want to add
another column “Special_User” in this table.
 Command:
ALTER TABLE Speed4career_User_Details
ADD Special_User VARCHAR2(1);
Now after doing this you feel that you want
to change the table name itself and want to
give new table name as
“Speed4career_Master_Details”.
 Command:
ALTER TABLE Speed4career_User_Details
RENAME TO Speed4career_Master_Details;
There are several more things you can do
with ALTER command.
Now you want to drop this table because you
don’t need this table anymore. So which
command you have to use?
Exactly “DROP” command.
 Command:
DROP TABLE Speed4career_User_Details;
• SQL INTERVIEW QUESTIONS:
1. What is SQL? What is the full form of SQL?
2. Which is the subset of SQL commands used
to manipulate Oracle Database Structures?
3. Example of CREATE TABLE.
4. What is the use of DROP option in the ALTER
TABLE command?
For more details please visit:
http://www.speed4career.com/blog/sql-for-beginne

Mais conteúdo relacionado

Destaque

Sql queries interview questions
Sql queries interview questionsSql queries interview questions
Sql queries interview questions
Pyadav010186
 
DBMS lab manual
DBMS lab manualDBMS lab manual
DBMS lab manual
maha tce
 

Destaque (19)

DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
Top 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and AnswersTop 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answers
 
Best sql plsql material
Best sql plsql materialBest sql plsql material
Best sql plsql material
 
Dbms lab questions
Dbms lab questionsDbms lab questions
Dbms lab questions
 
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick LearningOracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
 
DBMS Practical File
DBMS Practical FileDBMS Practical File
DBMS Practical File
 
Sql queries interview questions
Sql queries interview questionsSql queries interview questions
Sql queries interview questions
 
SQL Tutorial - How To Create, Drop, and Truncate Table
SQL Tutorial - How To Create, Drop, and Truncate TableSQL Tutorial - How To Create, Drop, and Truncate Table
SQL Tutorial - How To Create, Drop, and Truncate Table
 
DML Commands
DML CommandsDML Commands
DML Commands
 
Sql Server Basics
Sql Server BasicsSql Server Basics
Sql Server Basics
 
DBMS lab manual
DBMS lab manualDBMS lab manual
DBMS lab manual
 
Data Manipulation Language
Data Manipulation LanguageData Manipulation Language
Data Manipulation Language
 
Computer science curriculum based on Program learning outcomes and objectives
Computer science curriculum based on Program learning outcomes and objectivesComputer science curriculum based on Program learning outcomes and objectives
Computer science curriculum based on Program learning outcomes and objectives
 
Dml and ddl
Dml and ddlDml and ddl
Dml and ddl
 
Oracle sql & plsql
Oracle sql & plsqlOracle sql & plsql
Oracle sql & plsql
 
Advanced SQL - Lecture 6 - Introduction to Databases (1007156ANR)
Advanced SQL - Lecture 6 - Introduction to Databases (1007156ANR)Advanced SQL - Lecture 6 - Introduction to Databases (1007156ANR)
Advanced SQL - Lecture 6 - Introduction to Databases (1007156ANR)
 
Dbms viva questions
Dbms viva questionsDbms viva questions
Dbms viva questions
 
Sql queires
Sql queiresSql queires
Sql queires
 
MS Sql Server: Introduction To Database Concepts
MS Sql Server: Introduction To Database ConceptsMS Sql Server: Introduction To Database Concepts
MS Sql Server: Introduction To Database Concepts
 

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 

SQL tutorial for beginners | Basic SQL Commands | SQL Syntax

  • 1. [SQL Tutorial – Part - 1] by [Speed4Career]
  • 2. About Us:  In modern days economic system the most valuable asset is knowledge. Day by day increasing competition and invention of cutting edge technologies are the results of revolution in the global Educational system and use of process oriented learning environment.  This process oriented learning environment is essential for the modern corporate world. Speed4career.com understands the nature of this revolution.  We are committed to this process oriented learning environment and set our goals to help in creating a better modern corporate world, more over a better world for our future generation.
  • 3.  In this quest for creating a process oriented learning environment www.speed4career.com introducing a new module – Tutorial.  In this “Tutorial” module we are discussion about the BEGINNERS lesson for the technology related subjects.  All the Tutorials are created by the INDUSTRY EXPERTS working on the same field for years.  For more details please visit: www.speed4career.com/blog
  • 4. SQL for Beginner – PART I  About SQL:  Collection of organized data called as DATABASE. When we define, create, query and update the database through software then that system known as “Database Management System” or “DBMS”. When we want to manage all this things through programming language then we use “SQL” or “Structured Programming Language”.  SQL was initially developed at IBM by Donald D. Chamberlin and Raymond F. Boyce.
  • 5.  Data Definition Language:  Whenever you want to build or destroy or altered any structure of database object at that time whatever SQL commands we follow those are inside of Data Definition Language’s scope.  SQL Commands: 1. Create – It will create an object in database. 2. Alter – It will alter required object in database. 3. Drop – It will destroy the whole structure of an object in database.
  • 6.  Syntax: 1. CREATE table <table_name> (column_name datatype,.....column_name datatype); 2. ALTER table <table_name> add/modify/drop/rename column_name datatype; 3. DROP table <table_name> These are the examples of basic DDL SQL commands. In advance SQL tutorial we will give lots of other example. So by this SQL command first we create a table named “Speed4career_User_Details” which has 5 columns.
  • 7.  Command: CREATE TABLE Speed4career_User_Details( User_ID VARCHAR2(10), User_Name VARCHAR2(200), Address VARCHAR2(1000), City VARCHAR2(100), Postal_Code Number, Country VARCHAR2(100), Phn_number VARCHAR2(20)); [Note: - We are following Oracle SQL syntax for this tutorial. SQL is NOT case sensitive] Suppose you want to change the column name “Postal_code” to “Zip_code” of this table then you have to use ALTER command to do this.
  • 8.  Command: ALTER TABLE Speed4career_User_Details RENAME Postal_code TO Zip_code; After change this now you want to add another column “Special_User” in this table.  Command: ALTER TABLE Speed4career_User_Details ADD Special_User VARCHAR2(1); Now after doing this you feel that you want to change the table name itself and want to give new table name as “Speed4career_Master_Details”.
  • 9.  Command: ALTER TABLE Speed4career_User_Details RENAME TO Speed4career_Master_Details; There are several more things you can do with ALTER command. Now you want to drop this table because you don’t need this table anymore. So which command you have to use? Exactly “DROP” command.  Command: DROP TABLE Speed4career_User_Details;
  • 10. • SQL INTERVIEW QUESTIONS: 1. What is SQL? What is the full form of SQL? 2. Which is the subset of SQL commands used to manipulate Oracle Database Structures? 3. Example of CREATE TABLE. 4. What is the use of DROP option in the ALTER TABLE command? For more details please visit: http://www.speed4career.com/blog/sql-for-beginne