18.
A join operation is used to combine rows from two or more tables based on a related column between them. It is one of the fundamental operations used in relational databases for querying and retrieving data from multiple tables simultaneously.
Ans:
Select e.emp_name,e.province,e.city,b.branch,b.salary from Employee e
Left join Branch b on e.emp_name=b.emp_name;
Select e.emp_name,e.province,e.city,b.branch,b.salary from Employee e
Right join Branch b on e.emp_name=b.emp_name;
21.
a.Select R_Name ,R_address from Resturant
Where R_ID IN (Select R_id from works where Wshift=’day’);
b.Select r.R_Name,r.R_address from Resturant r
Join Works w on r.R_ID=W.R_ID
AND Wshift=’day’;
c. Select C_name from Cook where C_specilization=’Italian’;
Select count(*),Wshift from Works_At
Where Wshift=’night’;
d. Select avg(salary) from Cook;
Select R_Name,B_ID from Resturant
Where R_ID IN(Select R_ID from Branch where B_ID IN(select B_ID from Branch where revenue>15000));
e.Select r.R_Name,b.B_ID from Resturant r
Join Branch b on r.R_ID=b.R_ID
Where b.revenue>15000;
22.
Normalization is a critical concept in various fields, including databases, statistics, and machine learning. It involves organizing data in a structured manner to eliminate redundancy and dependency, ensuring efficient storage, retrieval, and analysis. Here are some key reasons why normalization is important: