You are on page 1of 8

Name: Pritam Das Roll Number: 17ETCS002130

Database Systems Laboratory


B.Tech. 6thSemester

Name : Pritam Das


Roll Number : 17ETCS002130
Department : Computer Science and Engineering

Faculty of Engineering & Technology


Ramaiah University of Applied Sciences
Name: Pritam Das Roll Number: 17ETCS002130
Ramaiah University of Applied Sciences
Private University Established in Karnataka State by Act No. 15 of 2013

Faculty Engineering & Technology

Programme B. Tech. in Computer Science and Engineering

Year/Semester 3rd Year / 6th Semester


Name of the Laboratory Database Systems Laboratory
Laboratory Code CSC313A

List of Experiments
1. DDL and DML commands
2. Requirement analysis and data modelling
3. Data model to relational model
4. Data constraints and built in functions
5. Java database programming
6. Interface to the system
7. XPATH with XML
8. Nested queries and Join queries
9. Procedure in MySQL
10. Multidimensional data modelling
Name: Pritam Das Roll Number: 17ETCS002130

Index Sheet
No Lab Experiment Performing Document Viva Total
. the (7) (6) Marks
experiment (20)
(7)
1 DDL and DML commands
2 Requirement analysis and data
modelling
3 Data model to relational model
4 Data constraints and built in
functions
5 Java database programming
6 Interface to the system
7 XPATH with XML
8 Nested queries and Join queries
9 Procedure in MySQL
10 Multidimensional data modelling
11 Lab Internal Test conducted along the lines of SEE and valued for 50 Marks
and reduced for 20 Marks
Total Marks

Component 1 = Lab Internal Marks =

Signature of the Staff In-charge


Name: Pritam Das Roll Number: 17ETCS002130

Laboratory 1
Title of the Laboratory Exercise: DDL and DML commands
1. Introduction and Purpose of Experiment
Structured Query Language (SQL) is used to pass the query to retrieve and manipulate the
information from database. Depending upon the nature of query, SQL is divided into
different components such as Data Definition Language (DDL) and Data Manipulation
Language (DML). DDL statements create the database, maintain the structure of the
database and remove database objects such as tables, indexes, and users. DML statements
are used for managing data in database such as insert tuples into, delete tuples from, and
modify tuples in the database. By doing this lab, students will be able to execute DDL and
DML commands
2. Aim and Objectives
Aim
 To execute Data Definition Language (DDL) and Data Management Language (DML)
commands
Objectives
At the end of this lab, the student will be able to
 Create a database and populate it with data using SQL commands
 Execute DDL and DML commands for the given database

3. Experimental Procedure
i. Analyse the problem statement
ii. Execute DDL and DML commands
iii. Create a database for the given schema
iv. Design SQL commands using DDL and DML commands
v. Test the executed commands
vi. Analyse and discuss the outcomes of your experiment
vii. Document the work

4. Questions
a. Practice DDL and DML commands
b. Consider the following relational schema that keeps track of the employees in a
company. Enter at least five tuples for the relation. Assume appropriate domain and
data type for each field.
Name: Pritam Das Roll Number: 17ETCS002130

EMPLOYEE (EmpId, EmpName, EmpAddress)


Execute the following queries based on the above schema
i. Display the details of all the employees
ii. Display the name and address of the employee with id=101
iii. Insert a new employee<105, ‘Bob’, ‘Bangalore’>
iv. Change the address of the employee Bob to ‘Delhi’
v. Delete the details of an employee with employee id=105
vi. Add a column to the schema EMPLOYEE with appropriate data type

5. Calculations/Computations/Algorithms
a. We have to firstly create a database using,
create database pritam_das;
b. Then we need to create table in the database naming it EMPLOYEE along with the
fields and their data types,
create table EMPLOYEE(EmpId VARCHAR(20),EmpName VARCHAR(20),EmpAddress VARCHAR(20));
c. We create 5 Records and insert it in the table for example,
insert into EMPLOYEE values('100','Harshit','Bangalore');
d. To display the table with the employee details,
select *from EMPLOYEE;
e. To display the name and address of the employee with id=101,
select EmpName,EmpAddress from EMPLOYEE where EmpId = 101;
f. To insert a new employee<105, ‘Bob’, ‘Bangalore’>,
insert into EMPLOYEE values('105','Bob','Bangalore');
g. To change the address of the employee Bob to ‘Delhi’ we perform,
update EMPLOYEE set EmpAddress = 'Delhi' where EmpAddress = 'Bangalore';
h. To delete the details of an employee with employee id=105 we perform,
delete from EMPLOYEE where EmpId = 105;
i. To add a column to the schema EMPLOYEE with appropriate data type we use,
alter table EMPLOYEE add(EmpType VARCHAR(20));
Name: Pritam Das Roll Number: 17ETCS002130

6. Presentation of Results
a. Display the details of all the employees

b. Display the name and address of the employee with id=101

c. Insert a new employee<105, ‘Bob’, ‘Bangalore’>


Name: Pritam Das Roll Number: 17ETCS002130

d. Change the address of the employee Bob to ‘Delhi’

e. Delete the details of an employee with employee id=105

f. Add a column to the schema EMPLOYEE with appropriate data type

7. Analysis and Discussions


DML statements are SQL statements that manipulate data. DML stands for Data
Manipulation Language. The SQL statements that are in the DML class are INSERT, UPDATE
and DELETE. Some people also lump the SELECT statement in the DML classification.
Data Definition Languages (DDL) are used to define the database structure. Any CREATE,
DROP and ALTER commands are examples of DDL SQL statements.
8. Conclusions
For forming a database language both DDL and DML is necessary. As they both will be
required to form and access the database.
Name: Pritam Das Roll Number: 17ETCS002130

9. Comments
1. Limitations of Experiments
The experiment is limited to some extent of usage of DDL and DML command to
operate with only databases and tables in the databases. We didn’t require to
operate with other functionalities of databases.
2. Limitations of Results
The results are not sorted and cannot be operated sequentially until and unless
external concepts breakthroughs.
3. Learning happened
We learned the basics of SQL to make a database and table and even how to
manipulate data in the table.
4. Recommendations
None.

You might also like