SlideShare a Scribd company logo
1 of 20
SQL Commands
(Part 2)
By: Ms. Rubab For DIT
SQL | INSERT INTO Statement
Insert is a DML Command
The INSERT INTO statement of SQL is used to insert a new row in a
table
There are 2 ways
of using INSERT
Only values: Column names and values both
By: Ms. Rubab For DIT
Only values:
First method is to specify only the value of data to be inserted
without the column names.
Syntax
INSERT INTO table_name VALUES (value1, value2,
value3,…);
table_name: name of the table.
value1, value2,.. : value of first column, second column,… for the
new record
By: Ms. Rubab For DIT
Column names and values both
In the second method we will specify both the columns which we
want to fill and their corresponding values
INSERT INTO table_name (column1, column2, column3,..)
VALUES ( value1, value2, value3,..);
table_name: name of the table.
column1: name of first column, second column …
value1, value2, value3 : value of first column, second column,…
for the new record
By: Ms. Rubab For DIT
Example
Roll_No Name Address Phone Age
1 Sajid Sobhodero Xxxxxxxxxxx 18
2 Majid Ranipur Xxxxxxxxxxx 18
3 Abid Hinjorja Xxxxxxxxxxx 18
4 Zahid Sajiyoon Xxxxxxxxxxx 17
5 Anwar Niwaro Xxxxxxxxxxx 17
6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18
Suppose we have a Table STUDENTS and it has 5 columns, Roll_No,
Name, Adddress, Phone and Age
By: Ms. Rubab For DIT
Task: We have to insert values in the previous
table. Using both methods of Insert
Roll_No Name Address Phone Age
1 Sajid Sobhodero Xxxxxxxxxxx 18
2 Majid Ranipur Xxxxxxxxxxx 18
3 Abid Hinjorja Xxxxxxxxxxx 18
4 Zahid Sajiyoon Xxxxxxxxxxx 17
5 Anwar Niwaro Xxxxxxxxxxx 17
6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18
By: Ms. Rubab For DIT
Method1: Only Inserting values
INSERT INTO Student VALUES
(‘7′,’Nasir’,’Sobhodero’,’XXXXXXXXXX’,’19’);
Roll_No Name Address Phone Age
1 Sajid Sobhodero Xxxxxxxxxxx 18
2 Majid Ranipur Xxxxxxxxxxx 18
3 Abid Hinjorja Xxxxxxxxxxx 18
4 Zahid Sajiyoon Xxxxxxxxxxx 17
5 Anwar Niwaro Xxxxxxxxxxx 17
6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18
7 Nasir Sobhodero Xxxxxxxxxxx 19
By: Ms. Rubab For DIT
Roll_No Name Address Phone Age
1 Sajid Sobhodero Xxxxxxxxxxx 18
2 Majid Ranipur Xxxxxxxxxxx 18
3 Abid Hinjorja Xxxxxxxxxxx 18
4 Zahid Sajiyoon Xxxxxxxxxxx 17
5 Anwar Niwaro Xxxxxxxxxxx 17
6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18
7 Nasir Sobhodero Xxxxxxxxxxx 19
8 Prizaad (null) (Null) 19
Method 2 (Inserting values in only specified columns):
INSERT INTO Student (ROLL_NO, NAME, Age) VALUES (‘8′,’Parizaad’,’19’);
By: Ms. Rubab For DIT
Notice
Notice that the columns for which
the values are not provided are
filled by null. Which is the default
values for those columns.
By: Ms. Rubab For DIT
SQL | SELECT Query
Select is the most used statement in SQL. The SELECT Statement in SQL is used to retrieve or fetch
data from a database. We can fetch either the entire table or according to some specified rules. The
data returned is stored in a result table. This result table is also called result-set.
With the SELECT clause of a SELECT command statement, we specify the columns that we want to
be displayed in the query result and, optionally, which column headings we prefer to see above the
result table.
The select clause is the first clause and is one of the last clauses of the select statement that the
database server evaluates. The reason for this is that before we can determine what to include in
the result set, we need to know all the possible columns that could be included in the result set.
By: Ms. Rubab For DIT
Basic Syntax
SELECT column1,column2
FROM table_name
column1 , column2: names of the fields of the table
table_name: from where we want to fetch
This query will return all the rows in the table with fields column1 ,
column2.
By: Ms. Rubab For DIT
Select *(* mean all)
Roll_No Name Address Phone Age
1 Sajid Sobhodero Xxxxxxxxxxx 18
2 Majid Ranipur Xxxxxxxxxxx 18
3 Abid Hinjorja Xxxxxxxxxxx 18
4 Zahid Sajiyoon Xxxxxxxxxxx 17
5 Anwar Niwaro Xxxxxxxxxxx 17
6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18
To fetch the entire table or all the fields in the table:
SELECT * FROM students;
By: Ms. Rubab For DIT
Selecting only selective columns
Roll_No Name Age
1 Sajid 18
2 Majid 18
3 Abid 18
4 Zahid 17
5 Anwar 17
6 Ghulam Nabi 18
Query to fetch the fields ROLL_NO, NAME, AGE from the table
Students
SELECT ROLL_NO, NAME, AGE FROM Students;
By: Ms. Rubab For DIT
Update Statement(DML Command)
The UPDATE statement in SQL is used to update the data of an
existing table in database. We can update single columns as well
as multiple columns using UPDATE statement as per our
requirement.
table_name: name of the table
column1: name of first , second, third column....
value1: new value for first, second, third column....
condition: condition to select the rows for which the
values of columns needs to be updated.
UPDATE table_name SET column1 = value1, column2 = value2,... WHERE condition;
By: Ms. Rubab For DIT
Points to Note
The SET statement is used to set
new values to the column .
The WHERE clause is used to
select the rows for which the
columns are needed to be
updated.
If we have not used the WHERE
clause then the columns
in all the rows will be updated.
So, the WHERE clause is used to
choose the specific rows.
By: Ms. Rubab For DIT
Example:Updating single column:
Roll_No Name Address Phone Age
1 Sajid Sobhodero Xxxxxxxxxxx 18
2 Majid Ranipur Xxxxxxxxxxx 18
3 Abid Hinjorja Xxxxxxxxxxx 18
4 Zahid Sajiyoon Xxxxxxxxxxx 17
5 Anwar Niwaro Xxxxxxxxxxx 17
6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18
Update the column NAME and set the value to ‘Seventeen’ in all
the rows where Age is 17.
UPDATE Student SET NAME = ‘Seventeen’ WHERE Age = 17;
By: Ms. Rubab For DIT
Example:Updated Table based on
Query:
Roll_No Name Address Phone Age
1 Sajid Sobhodero Xxxxxxxxxxx 18
2 Majid Ranipur Xxxxxxxxxxx 18
3 Abid Hinjorja Xxxxxxxxxxx 18
4 Seventeen Sajiyoon Xxxxxxxxxxx 17
5 Seventeen Niwaro Xxxxxxxxxxx 17
6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18
Update the column NAME and set the value to ‘Seventeen’ in all
the rows where Age is 17.
UPDATE Student SET NAME = ‘Seventeen’ WHERE Age = 17;
By: Ms. Rubab For DIT
Example 2: Updating multiple columns:
Roll_No Name Address Phone Age
1 Sajid Sobhodero Xxxxxxxxxxx 18
2 Majid Ranipur Xxxxxxxxxxx 18
3 Abid Hinjorja Xxxxxxxxxxx 18
4 Zahid Sajiyoon Xxxxxxxxxxx 17
5 Anwar Niwaro Xxxxxxxxxxx 17
6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18
Update the columns NAME to ‘Sajid Ali’ and ADDRESS to ‘Nakoo’ where ROLL_NO is 1.
UPDATE Student SET NAME = 'PRATIK', ADDRESS = 'SIKKIM' WHERE ROLL_NO = 1;
By: Ms. Rubab For DIT
Example 2: after successful run:
Roll_No Name Address Phone Age
1 Sajid Ali Nakoo Xxxxxxxxxxx 18
2 Majid Ranipur Xxxxxxxxxxx 18
3 Abid Hinjorja Xxxxxxxxxxx 18
4 Zahid Sajiyoon Xxxxxxxxxxx 17
5 Anwar Niwaro Xxxxxxxxxxx 17
6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18
Update the columns NAME to ‘Sajid Ali’ and ADDRESS to ‘Nakoo’ where ROLL_NO is 1.
UPDATE Student SET NAME = ' Sajid Ali ', ADDRESS = ‘Nakoo' WHERE ROLL_NO = 1;
By: Ms. Rubab For DIT
Example 3: Omitting WHERE clause:
Roll_No Name Address Phone Age
1 Sajid Ali Nakoo Xxxxxxxxxxx 18
2 Sajid Ali Nakoo Xxxxxxxxxxx 18
3 Sajid Ali Nakoo Xxxxxxxxxxx 18
4 Sajid Ali Nakoo Xxxxxxxxxxx 17
5 Sajid Ali Nakoo Xxxxxxxxxxx 17
6 Sajid Ali Nakoo Xxxxxxxxxxx` 18
Update the columns NAME to ‘Sajid Ali’ and ADDRESS to ‘Nakoo’ without where clause.
UPDATE Student SET NAME = ‘Sajid Ali', ADDRESS = ‘Nakoo’ ;
By: Ms. Rubab For DIT

More Related Content

More from RUBAB79 (6)

SQL Operators.pptx
SQL Operators.pptxSQL Operators.pptx
SQL Operators.pptx
 
SQL Commands Part 1.pptx
SQL Commands Part 1.pptxSQL Commands Part 1.pptx
SQL Commands Part 1.pptx
 
Database Lecture 3.pptx
Database Lecture 3.pptxDatabase Lecture 3.pptx
Database Lecture 3.pptx
 
SQL Conversion Functions.pptx
SQL Conversion Functions.pptxSQL Conversion Functions.pptx
SQL Conversion Functions.pptx
 
SQL Commands Part 3.pptx
SQL Commands Part 3.pptxSQL Commands Part 3.pptx
SQL Commands Part 3.pptx
 
DATABASE Lecture 1 and 2.pptx
DATABASE Lecture 1 and 2.pptxDATABASE Lecture 1 and 2.pptx
DATABASE Lecture 1 and 2.pptx
 

Recently uploaded

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

SQL Commands Part 2.pptx

  • 1. SQL Commands (Part 2) By: Ms. Rubab For DIT
  • 2. SQL | INSERT INTO Statement Insert is a DML Command The INSERT INTO statement of SQL is used to insert a new row in a table There are 2 ways of using INSERT Only values: Column names and values both By: Ms. Rubab For DIT
  • 3. Only values: First method is to specify only the value of data to be inserted without the column names. Syntax INSERT INTO table_name VALUES (value1, value2, value3,…); table_name: name of the table. value1, value2,.. : value of first column, second column,… for the new record By: Ms. Rubab For DIT
  • 4. Column names and values both In the second method we will specify both the columns which we want to fill and their corresponding values INSERT INTO table_name (column1, column2, column3,..) VALUES ( value1, value2, value3,..); table_name: name of the table. column1: name of first column, second column … value1, value2, value3 : value of first column, second column,… for the new record By: Ms. Rubab For DIT
  • 5. Example Roll_No Name Address Phone Age 1 Sajid Sobhodero Xxxxxxxxxxx 18 2 Majid Ranipur Xxxxxxxxxxx 18 3 Abid Hinjorja Xxxxxxxxxxx 18 4 Zahid Sajiyoon Xxxxxxxxxxx 17 5 Anwar Niwaro Xxxxxxxxxxx 17 6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18 Suppose we have a Table STUDENTS and it has 5 columns, Roll_No, Name, Adddress, Phone and Age By: Ms. Rubab For DIT
  • 6. Task: We have to insert values in the previous table. Using both methods of Insert Roll_No Name Address Phone Age 1 Sajid Sobhodero Xxxxxxxxxxx 18 2 Majid Ranipur Xxxxxxxxxxx 18 3 Abid Hinjorja Xxxxxxxxxxx 18 4 Zahid Sajiyoon Xxxxxxxxxxx 17 5 Anwar Niwaro Xxxxxxxxxxx 17 6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18 By: Ms. Rubab For DIT
  • 7. Method1: Only Inserting values INSERT INTO Student VALUES (‘7′,’Nasir’,’Sobhodero’,’XXXXXXXXXX’,’19’); Roll_No Name Address Phone Age 1 Sajid Sobhodero Xxxxxxxxxxx 18 2 Majid Ranipur Xxxxxxxxxxx 18 3 Abid Hinjorja Xxxxxxxxxxx 18 4 Zahid Sajiyoon Xxxxxxxxxxx 17 5 Anwar Niwaro Xxxxxxxxxxx 17 6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18 7 Nasir Sobhodero Xxxxxxxxxxx 19 By: Ms. Rubab For DIT
  • 8. Roll_No Name Address Phone Age 1 Sajid Sobhodero Xxxxxxxxxxx 18 2 Majid Ranipur Xxxxxxxxxxx 18 3 Abid Hinjorja Xxxxxxxxxxx 18 4 Zahid Sajiyoon Xxxxxxxxxxx 17 5 Anwar Niwaro Xxxxxxxxxxx 17 6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18 7 Nasir Sobhodero Xxxxxxxxxxx 19 8 Prizaad (null) (Null) 19 Method 2 (Inserting values in only specified columns): INSERT INTO Student (ROLL_NO, NAME, Age) VALUES (‘8′,’Parizaad’,’19’); By: Ms. Rubab For DIT
  • 9. Notice Notice that the columns for which the values are not provided are filled by null. Which is the default values for those columns. By: Ms. Rubab For DIT
  • 10. SQL | SELECT Query Select is the most used statement in SQL. The SELECT Statement in SQL is used to retrieve or fetch data from a database. We can fetch either the entire table or according to some specified rules. The data returned is stored in a result table. This result table is also called result-set. With the SELECT clause of a SELECT command statement, we specify the columns that we want to be displayed in the query result and, optionally, which column headings we prefer to see above the result table. The select clause is the first clause and is one of the last clauses of the select statement that the database server evaluates. The reason for this is that before we can determine what to include in the result set, we need to know all the possible columns that could be included in the result set. By: Ms. Rubab For DIT
  • 11. Basic Syntax SELECT column1,column2 FROM table_name column1 , column2: names of the fields of the table table_name: from where we want to fetch This query will return all the rows in the table with fields column1 , column2. By: Ms. Rubab For DIT
  • 12. Select *(* mean all) Roll_No Name Address Phone Age 1 Sajid Sobhodero Xxxxxxxxxxx 18 2 Majid Ranipur Xxxxxxxxxxx 18 3 Abid Hinjorja Xxxxxxxxxxx 18 4 Zahid Sajiyoon Xxxxxxxxxxx 17 5 Anwar Niwaro Xxxxxxxxxxx 17 6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18 To fetch the entire table or all the fields in the table: SELECT * FROM students; By: Ms. Rubab For DIT
  • 13. Selecting only selective columns Roll_No Name Age 1 Sajid 18 2 Majid 18 3 Abid 18 4 Zahid 17 5 Anwar 17 6 Ghulam Nabi 18 Query to fetch the fields ROLL_NO, NAME, AGE from the table Students SELECT ROLL_NO, NAME, AGE FROM Students; By: Ms. Rubab For DIT
  • 14. Update Statement(DML Command) The UPDATE statement in SQL is used to update the data of an existing table in database. We can update single columns as well as multiple columns using UPDATE statement as per our requirement. table_name: name of the table column1: name of first , second, third column.... value1: new value for first, second, third column.... condition: condition to select the rows for which the values of columns needs to be updated. UPDATE table_name SET column1 = value1, column2 = value2,... WHERE condition; By: Ms. Rubab For DIT
  • 15. Points to Note The SET statement is used to set new values to the column . The WHERE clause is used to select the rows for which the columns are needed to be updated. If we have not used the WHERE clause then the columns in all the rows will be updated. So, the WHERE clause is used to choose the specific rows. By: Ms. Rubab For DIT
  • 16. Example:Updating single column: Roll_No Name Address Phone Age 1 Sajid Sobhodero Xxxxxxxxxxx 18 2 Majid Ranipur Xxxxxxxxxxx 18 3 Abid Hinjorja Xxxxxxxxxxx 18 4 Zahid Sajiyoon Xxxxxxxxxxx 17 5 Anwar Niwaro Xxxxxxxxxxx 17 6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18 Update the column NAME and set the value to ‘Seventeen’ in all the rows where Age is 17. UPDATE Student SET NAME = ‘Seventeen’ WHERE Age = 17; By: Ms. Rubab For DIT
  • 17. Example:Updated Table based on Query: Roll_No Name Address Phone Age 1 Sajid Sobhodero Xxxxxxxxxxx 18 2 Majid Ranipur Xxxxxxxxxxx 18 3 Abid Hinjorja Xxxxxxxxxxx 18 4 Seventeen Sajiyoon Xxxxxxxxxxx 17 5 Seventeen Niwaro Xxxxxxxxxxx 17 6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18 Update the column NAME and set the value to ‘Seventeen’ in all the rows where Age is 17. UPDATE Student SET NAME = ‘Seventeen’ WHERE Age = 17; By: Ms. Rubab For DIT
  • 18. Example 2: Updating multiple columns: Roll_No Name Address Phone Age 1 Sajid Sobhodero Xxxxxxxxxxx 18 2 Majid Ranipur Xxxxxxxxxxx 18 3 Abid Hinjorja Xxxxxxxxxxx 18 4 Zahid Sajiyoon Xxxxxxxxxxx 17 5 Anwar Niwaro Xxxxxxxxxxx 17 6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18 Update the columns NAME to ‘Sajid Ali’ and ADDRESS to ‘Nakoo’ where ROLL_NO is 1. UPDATE Student SET NAME = 'PRATIK', ADDRESS = 'SIKKIM' WHERE ROLL_NO = 1; By: Ms. Rubab For DIT
  • 19. Example 2: after successful run: Roll_No Name Address Phone Age 1 Sajid Ali Nakoo Xxxxxxxxxxx 18 2 Majid Ranipur Xxxxxxxxxxx 18 3 Abid Hinjorja Xxxxxxxxxxx 18 4 Zahid Sajiyoon Xxxxxxxxxxx 17 5 Anwar Niwaro Xxxxxxxxxxx 17 6 Ghulam Nabi Razal Memon Xxxxxxxxxxx` 18 Update the columns NAME to ‘Sajid Ali’ and ADDRESS to ‘Nakoo’ where ROLL_NO is 1. UPDATE Student SET NAME = ' Sajid Ali ', ADDRESS = ‘Nakoo' WHERE ROLL_NO = 1; By: Ms. Rubab For DIT
  • 20. Example 3: Omitting WHERE clause: Roll_No Name Address Phone Age 1 Sajid Ali Nakoo Xxxxxxxxxxx 18 2 Sajid Ali Nakoo Xxxxxxxxxxx 18 3 Sajid Ali Nakoo Xxxxxxxxxxx 18 4 Sajid Ali Nakoo Xxxxxxxxxxx 17 5 Sajid Ali Nakoo Xxxxxxxxxxx 17 6 Sajid Ali Nakoo Xxxxxxxxxxx` 18 Update the columns NAME to ‘Sajid Ali’ and ADDRESS to ‘Nakoo’ without where clause. UPDATE Student SET NAME = ‘Sajid Ali', ADDRESS = ‘Nakoo’ ; By: Ms. Rubab For DIT