Aarti Kakde Dbms - Final - Journal
Aarti Kakde Dbms - Final - Journal
Aarti Kakde Dbms - Final - Journal
4) Write a SQL statement to create a table named jobs including columns job_id,
job_title, min_salary and max_salary, and make sure that, the default value for
job_title is blank and min_salary is 8000 and max_salary is NULL will be entered
automatically at the time of insertion if no value assigned for the specified columns
5) Write a SQL statement to create a table employees including
columns employee_id, first_name, last_name, email, phone_number
hire_date, job_id, salary, commission, manager_id and department_id
Assume the structure of departments table below.
EMPLOYEE_ID , NOT NULL, PRIMARY
KEY, FIRST_NAME , NULL,
LAST_NAME , NOT NULL,
EMAIL , NOT NULL,
PHONE_NUMBER , DEFAULT
NULL, HIRE_DATE , NOT NULL,
JOB_ID , NOT NULL,
SALARY , DEFAULT
NULL,
COMMISSION_PCT , DEFAULT
NULL, MANAGER_ID , DEFAULT
NULL, DEPARTMENT_ID , DEFAULT
NULL.
Practical No 3
AIM:ALTER STATEMENTS
Q1)Create table Dept with following specifications Employee ID primary key, employee
name,departmen id, city , manager id, Salary , date of joining
Insert 10 records
.
Q2)WRITE A QUERY TO ADD A COLUMN BONUS AFTER SALARY
IN TABLE DEPARTMENT
Q 11): Write a MySQL statements to create a simple table Bike with following constraints:
a)Bik_id: primary key
b)Bik_name: NOT NULL, DEFAULT
c) cost: NOT NULL, DEFAULT
d)DOP: Date
Q12: Write a Query to change name of column bik_name from bike table.
Q13) Write a Query to change size of bik_cost from bike table.
Q14: Write a Query to add servicing column as first column from bike table
.
PRACTICAL NO. 4
Q4) ) Write a Query to display all records of employee whose date of joining
is between 2016-2020 from department table.
d) DOP : Date
Q6) Write a Query to change bik_cost for bik_id 003 from bike table.
Q7) Write a Query to reduce bikcost by 10000 from bike table.
PRACTICAL NO. 5
• Aggregate function and Group by and Having
condition.
LCASE: -
LEFT(str,len) :-
RIGHT(str,len) :-
MID(str,start,len) :-
CONCAT() :-
LTRIM() :-
RTRIM() :-
TRIM() :-
STRCMP() :-
REPLACE() :-
1) Demonstrate al mathematical functions in MySQL.
ABS() :-
CEIL() / CEILING() :-
FLOOR :-
MOD() :-
POW (X, Y) OR POWER(X,Y) :-
SQRT() :-
ROUND() :-
TRUNCATE() :-
2) Demonstrate all date functions in MySQL.
ADDDATE() :-
DATEDIFF() :-
DAY() :-
MONTH() :-
YEAR() :-
HOUR() :-
SECOND() :-
CURDATE() :-
NOW() :-
3) Write a query to:
a)Display emp_id and emp_name in uppercase
b)Display emp_id and city_name in reverse order
DBMS PARCTICAL
NO.7
JOINING OF TABLES.
Q1) Demonstrate inner join using department table and
department information.
Q2) Demonstrate left outer join using department table and
department information.
Q4) Write a Query to display dept_id, avg salary and total salary
from department if avg salary of particular department is greater
than average salary of all employees.
Q5) Write a Query to display dept_id and emp_name,
of all the employees who works in HR department from
table dept_info, dept_info(dept_id,dept_name).