Lab 1 Database
Lab 1 Database
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
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
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
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.