DBMS lab
DBMS lab
Pratical-1
Case study-1
Employee database- 'Create' Empolyee_table ,'Select' and Display an employee matching a
given condition, 'Delete' duplicate record, Delete rows using Triggers, Insert and update
records, Find net salary etc.
--
Syntax-CREATE TABLE<table_name>(
<Column_name 1><data_type>[(SIZE)]
<Column_name 2><data_type>[(SIZE)]
<Column_name 3><data_type>[(SIZE)]
1
EX-create table Employees (Emp_id int(11),Emp_name varchar(25),Job_name
varchar(25),Manager_id int(11),Hire_date Date, Salary int(11),Commission int(11),Dept_id
int(11))
Step-3 To verify that the table has been created, SHOW TABLES
+--------------------+
| Tables_in_employee |
+--------------------+
| employee |
| employees |
+--------------------+
EX-select*from Employees;
2
step-7 Updating the values
To modify data in table or to make changes for some or all of the values in the exiting records in
a table, we use the Update Statement.
Syntax- UPDATE<table_name>
SET<column1> = <values1>,<column2>,=values2
There statement help to delete the duplicate or the defect row from it .
3
Step9- Find the net salary of Employee