written 24 months ago by |
1] Modify the database so that employee sachin now lives in Mumbai.
update employee
set city = Mumbai
where empname = 'sachin'
2] Find no of employees in each city with date of joining as Aug-2017.
select count (emp name)
from employee
where date of joining = ' 01 Aug-2017'
group by city.
3] Find name of companies starting with letter A.
Select company name
from company
where company-nam " A% "
4] Display employee name manager name city of those employee whose date of joining is greater than 01-01-
Select empname, manager name, city
from employee
where date of join > '01-01-2014'
Given relations are
A B $\rightarrow$ C D E F G
C $\rightarrow$ B
A $\rightarrow$ D
E $\rightarrow$ G
1NF - Candidate lays are A, B assuming that it is in 1NF.
2NF - Relation is not in 2NF as partial dependency exist.
AB $\rightarrow$ C E F G
C $\rightarrow$ B
E $\rightarrow$ G
3NF - Looking at FD, Relation $R_1$ is not in 3NF but $R_2$ is in 3NF, Decomposing relation as:
B CNF - Looking at FD $R_11$ is not in B CNF.
Dependency diagram.