Rdbms Assignment 3
Rdbms Assignment 3
03
PART A
(PART A: TO BE REFFERED BY STUDENTS)
A.1 Aim: Apply Data Manipulation language [DML] on the relational model designed and
apply certain constrains on the relational model designed.
A.3 Outcome:
After successful completion of this experiment students will be able to
A.4 Theory:
Data Manipulation Language (DML) statements are used for managing data in database. DML
commands are not auto-committed. It means changes made by DML command are not
permanent to database, it can be rolled back. DML is short name of Data Manipulation Language
which deals with data manipulation, and includes most common SQL statements such as
SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and
update data in database.
1. SELECT:
Syntax:
select column_name(s) from table_name; 🡪 selects only particular column(s) and all
rows
Or
Select * from table_name 🡪 selects all columns and all rows of the table mentioned
2. INSERT:
Syntax:
Or
insert into table_name values(value1, value2, value3, ….. valuen) 🡪 used when you
want to insert values into all columns of the table.
3. UPDATE:
Syntax:
Update table_name set column= value; 🡪 used when you want to update all the
rows for the particular column.
Or
4. DELETE:
Syntax:
delete from table_name; -🡪 used when you want to delete all the rows of the table.
Or
category_header
route_header
Place Header:
Fleet Header:
Ticket Header:
Ticket Detail:
Route Detail:
Queries:
a. Display all records of Category Header table.
b. Display place name and place address.
c. Check what will be the fare if it is incremented by 10 rs for each route. (Give new
column alias as new_fare).
d. Display distinct destination from route header table. [Hint : Use ‘distinct’ keyword]
e. Display structure of table route detail. [Hint; Use ‘desc’]
f. Gautam’s fare got increased by 1 unit. Make changes in the appropriate table.
g. Write a query to change age of ‘Anand’ from 28 to 30.
h. Write a query to insert a new record into Route_Detail table with details as below:
a. Route_id: 105 , Place_id : 01, NonStop: S
i. Write a query to delete row inserted above from Route_Detail table.
PART B
PART B: TO BE COMPLETED BY STUDENTS)
(Students must submit the soft copy as per following segments within two hours of the
practical. The soft copy must be uploaded on the Student Portal or emailed to the
concerned lab in charge faculties at the end of the practical in case the there is no Black
board access available)
B.1 Tasks given in PART A to be completed here (Students must write the answers of the
task(s) given in the PART A )
B.1.1 : Execution of each SQL query used to complete the task given in PART A :
a)A)
c)A)
e)A)
desc Route_header
update Ticket_Detail
f)A)
Route_id,place_id,Nonstop)values(105,01,’S’)
i)A)
1)
2)
3
5
6
B.2 Conclusion:
I learned how to use databases and how to insert, select, update, and delete data.