Assignment-Ii: Inserting A Single Row Into A Table
Assignment-Ii: Inserting A Single Row Into A Table
ASSIGNMENT-II
Due
16 Jul by 1:59
Points
0
Submitting
a file upload
Available
7 Jul at 2:00 - 16 Jul at 1:59
9 days
DML commands are the most frequently used SQL commands and is used to query and manipulate
the existing database objects. Some of the commands are:
Insert
Select
Update
Delete
Insert Command
This is used to add one or more rows to a table. The values are separated by commas and the data
types char and date are enclosed in apostrophes. The values must be entered in the same order as
they are defined.
Insert into <tablename(coln names to which datas to b inserted)> values (list of values);
Select Commands
https://canvas.instructure.com/courses/2858741/assignments/23280198 1/5
8/2/2021 ASSIGNMENT-II
It is used to retrieve information from the table.it is generally refered to as querying the table.We can
either display all columns in a table or only specify column from the table.
Syntax: Select * from tablename; // This query selects all rowsfrom the table.
To select specific rows from a table we include ‘where’ clause in the select command. Itcan appear
only after the ‘from’ clause.
Syntax: Select column_name1 , ..….., column_namen from table name where condition;
Syntax: Select column_name1, …..,column_namen from table name where condition order
by colmnname;
Update Command
It is used to alter the column values in a table. A single column may be updated or more than one
column could be updated.
Delete command
After inserting row in a table we can also delete them if required. The delete command consists of a
from clause followed by an optional where clause.
ASSIGNMENT-II
https://canvas.instructure.com/courses/2858741/assignments/23280198 3/5
8/2/2021 ASSIGNMENT-II
Problem 2.5: List the records in the emp table order by salary in ascending order.
Problem 2.6: List the records in the emp table orderby salary in descending order.
Problem 2.8: Display deptno from the table employee avoiding the duplicated values.
Problem 2.11: List the employee names and the department name in which they are working.
https://canvas.instructure.com/courses/2858741/assignments/23280198 5/5