Professional Documents
Culture Documents
Column Name Data Type Constraint Description: Exercise 1
Column Name Data Type Constraint Description: Exercise 1
Sports Craft Company has organized tournaments in multiple individual sports and invited top ranked players to play. Each tournament
comprises of multiple matches in knock out format. Each match is played between two players.
Problem Statement: Create the Player table as per information provided below:
PId INTEGER PRIMARY KEY Unique player Id is mandatory for every player
Ranking INTEGER
Exercise 2
Create the Tournament table as per information below:
Column
Data Type Constraint Description
Name
TId INTEGER,
)
Exercise 3
Create Match table as per details below. A player cannot play against himself, so player1 should not be equal to player2.
Column
Data Type Constraint Description
Name
Existing player Id
Winner INTEGER FOREIGN KEY
present in Player table
MId INTEGER,
Exercise 4
Add 'MatchesPlayed', 'MatchesWon' columns of type NUMBER to Player table discribed below:
SELECT Prodid, Pdesc, Category, Discount FROM Product WHERE Category = 'Apparel' ;
Exercise 8
SELECT Prodid, Pdesc, Category, Discount FROM Product WHERE Pdesc IS NULL;
Exercise 9
SELECT Prodid, Pdesc, Category, Discount FROM Product WHERE Category = 'Apparel' AND (Discount>5);
Collaborative Assignment 2
Create the Shopper table with appropriate data types for the attributes described below.
Column
Constraints DESCRIPTION
Name
Shopperid PRIMARY KEY Unique id of the shopper. For ex. 2001, 2003
Column
Constraints DESCRIPTION
Name
ShopperName NOT NULL Name of the Shopper. It cannot be more than 20 characters.
Mobile number of the Shopper in numeric form. Characters like brackets and
MobileNo NOT NULL
hyphens are not allowed.
Address of the Shopper. It cannot be more than 50 characters. For ex. Allen
Address
Street, New York
Adress VARCHAR2(50)
);
Collaborative Assignment 3
Alter the table Shopper to change the data type of mobile number from NUMBER to VARCHAR2. Mobile number can have a
maximum length of 15 characters.
Shopperid PRIMARY KEY Unique id of the shopper. For ex. 2001, 2003
Address Address of the Shopper. For ex. Allen Street, New York
Adress VARCHAR2(50)
);
Assignment 1
ArCode CHAR(5) PRIMARY KEY; Must begin with character 'A' Unique code of the article e.g. A1001, A1004
Quantity NUMBER(4) Greater than or equal to 0; Default Value is 0 Quantity availability of the article. For ex. 20
Assignment 5 : Mandatory
Name VARCHAR2(20) PRIMARY KEY Unique name of the store. For ex. WalMart, Big Bazar
Location VARCHAR2(30) NOT NULL Location of the store. For ex. Dallas
Assignment 6 : Mandatory
Name VARCHAR2(20) PRIMARY KEY Unique name of the store. For ex. WalMart, Big Bazar
Location VARCHAR2(30) NOT NULL Location of the store. For ex. Dallas
BillNo NUMBER PRIMARY KEY Unique id of the bill. For ex. 5001, 5005
StoreName VARCHAR2(20),
Shopperid NUMBER,
ArCode CHAR(5),
Amount NUMBER,
BillDate DATE,
);
Assignment 8 : Mandatory
Name VARCHAR2(30),
EmailId VARCHAR2(30)
Assignment 9 : Mandatory
Modify the Supplier table to store the supplier city. The column name should be City and it can have maximum of 10 characters.
Assignment 10 : Mandatory
Assignment 11 : Optional
)
Assignment 12 : Optional
Actually we cannot drop the last (in this case one and only ) column from table, we need to drop table.
Assignment 13 : Optional
HouseNo NUMBER
Unique address identifier
Street VARCHAR2(30) PRIMARY KEY
state VARCHAR2(5)
HouseNo NUMBER,
Street VARCHAR2(30),
state VARCHAR2(5),
CONSTRAINT add_hous_pk PRIMARY KEY (HouseNo,Street,city)
Assignment 14 : Optional
HouseNo NUMBER
Unique address identifier
Street VARCHAR2(30) PRIMARY KEY
state VARCHAR2(5)
Collaborative Assignment 15
Insert the following data into Shopper table. Modify the data in case of constraint violation.
INSERT INTO Shopper (ShopperId, ShopperName, Gender, MobileNo, Address) VALUES (101, 'Mark Jane', 'M', 1234567890,
'Allen Street, New York');
Assignment 2
INSERT INTO Article (ArCode, ArName, Rate, Quantity, Class) VALUES ('A1001', 'Mouse', 500, 0, 'C');
Assignment 17 : Mandatory
INSERT INTO Store (StoreName, Location, ManagerName) VALUES ('Loyal World', 'Infy Campus, Mysore', 'Rohan Kumar');
Assignment 18 : Mandatory
INSERT INTO Bill (BillNo, StoreName, Shopperid, ArCode, Amount, BillDate, Quantity) VALUES (1001, 'Loyal World', 101, 'A1001',
1000, 20-OCT-15, 2);
Assignment 19 : Mandatory
Assignment 3
SELECT Quotationid, Sname, Itemcode, Quotedprice, Qdate, Qstatus FROM Quotation WHERE Qstatus = 'Rejected' OR Qstatus =
'Closed';
OR
SELECT Quotationid, Sname, Itemcode, Quotedprice, Qdate, Qstatus FROM Quotation WHERE Qstatus NOT IN ('Accepted')
OR
SELECT Quotationid, Sname, Itemcode, Quotedprice, Qdate, Qstatus FROM Quotation WHERE Qstatus <>'Accepted'
Assignment 5
SELECT Designation, Salary FROM Empdetails WHERE Designation IN('Manager', 'Billing Staff');
Assignment 6
Assignment 7
SELECT Orderid, Quotationid, Status FROM Orders WHERE Orderdate BETWEEN '1-Dec-2014' and '1-Jan-2015';
Assignment 25 : Mandatory
select itemcode,descr,price from item where descr like '%Shirt%' and category='B' or descr like '%Skirt%' and category='B';
Assignment 26 : Mandatory
Assignment 28 : Mandatory
SELECT Quotationid, Sname FROM Quotation WHERE Qstatus IN( 'Accepted', 'Rejected');
Assignment 29 : Mandatory
Assignment 30 : Mandatory
SELECT Orderid, Quotationid, Status, Pymtdate FROM Orders WHERE Pymtdate IS NULL;
Or
SELECT Orderid, Quotationid, Status, Pymtdate FROM Orders WHERE Amountpaid IS NULL;
Assignment 32 : Mandatory
SELECT Empid, Salary AS "Current Salary", 1.1*Salary AS "New Salary", 0.1*Salary AS "Incremented Amount" FROM Empdetails ;
Assignment 34 : Mandatory
INSERT INTO Address VALUES (350, 'Electronics City', 'Mysore', 570018, 'Karnataka')
Assignment 36 : Optional
SELECT Quotationid, Qdate, Quotedprice FROM Quotation WHERE Quotedprice BETWEEN 1401 and 2149;
Assignment 38 : Optional
SELECT Designation, Salary FROM Empdetails WHERE Designation IN('Manager','Billing Staff') AND Salary BETWEEN 2500 AND
5000;
Exercise 5
UPDATE Product SET Price=50 WHERE Category = 'Apparel' and Pdesc = 'Trouser';
Exercise 20 : Update
Exercise 22 : Delete
OR
Exercise 24 : Functions
SELECT COUNT(Saleid) SALE_COUNT FROM Sale WHERE Sldate Between SYSDATE AND (SYSDATE - 1200 )
OR
Exercise 26 : Functions
SELECT Prodid, Category, Price, Discount FROM Product ORDER BY Category DESC, Price ASC;
Exercise 10
SELECT Prodid, Category, Discount FROM Product WHERE Category ='Sports' OR Category ='Apparel' ORDER BY
Category,Discount;
OR
SELECT Prodid, Category, Discount FROM Product WHERE Category IN('Sports','Apparel') ORDER BY Category,Discount;
Collaborative Assignment 40
CASE
END Classification
FROM Item
Collaborative Assignment 42
SELECT Orderid, ROUND((MONTHS_BETWEEN(Pymtdate, Orderdate)), 2) "No of Months"
FROM Orders
Collaborative Assignment 43
SELECT Empid, Salary AS "Current Salary", Salary*1.2 AS "New Salary", Salary*0.2 AS "Incremented Amount" FROM Empdetails
WHERE Designation='Manager'
Collaborative Assignment 44
SELECT Prodid, Pdesc, Price AS "Old_Price", ROUND((Price*0.775), 2) AS "New_Price" FROM Product WHERE Category='Sports';
Exercise 32 : Functions
SELECT ROUND(AVG(Price), 2) AS "Avg", MIN(Price) AS "Min", MAX(Price) AS "Max", COUNT(Prodid) AS "Total" FROM Product
Exercise 34 : Functions
SELECT CONCAT(CONCAT(CONCAT(CONCAT(' ', Sname), ' is from '), Location), ' ') AS "RESULT" FROM Salesman;
Exercise 35 : Functions
SELECT Prodid, Pdesc, Price FROM Product ORDER BY Price DESC,Prodid DESC;
Exercise 37 : ORDER BY
Assignment 51 : Mandatory
SELECT Empid, Empname, Salary,
CASE
ELSE Salary*1.02
END "INCREASEDSALARY"
FROM Empdetails ;
Assignment 52 : Mandatory
SELECT EMPID,SALARY,
CASE
END AS "SALGRADE"
FROM EMPDETAILS;
Assignment 53 : Mandatory
SELECT Itemcode, Price AS "Old Price", ROUND((Price*0.745), 2) AS "New Price" FROM Item WHERE Itemtype = 'FMCG'
Assignment 54 : Mandatory
OR
SELECT Orderid, Status, NVL(Pymtmode, 'Payment yet not done') AS "PYMTMODE" FROM Orders ;
Assignment 56 : Mandatory
Assignment 58 : Mandatory
OR
OR
Assignment 60 : Optional
OR
Assignment 10
Assignment 65 : Optional
select to_char(sldate,'Month') "MONTH" ,count(1) "NUMBER_SALE" from sale group by to_char(sldate,'Month') order by 2
DESC;
Exercise 11
SELECT PRODID "PRODID",SUM(QUANTITY) "QTY_SOLD" FROM SALEDETAIL WHERE QUANTITY>1 GROUP BY PRODID HAVING
COUNT(PRODID)>1;
Exercise 40 : Union
SELECT Sid, Sname, Location FROM Salesman WHERE Sname LIKE '%e%' AND Location LIKE '%o%'
UNION ALL
SELECT Sid, Sname, Location FROM Salesman WHERE Sname LIKE '%a%' AND Location LIKE '%a%'
Exercise 41 : Union
UNION ALL
UNION
OR
SELECT Prodid, Pdesc, Category, Discount FROM Product WHERE Discount<10 OR Category='Sports'
Exercise 43 : Union
UNION ALL
SELECT Id, Ename, Dept, E.Compid, Make FROM Employee E INNER JOIN Computer C ON E.Compid=C.Compid;
Exercise 13
SELECT Id, Ename, C.Compid, Make FROM Employee E INNER JOIN Computer C ON E.Compid=C.Compid WHERE Model IN(
'Precision', 'Edge');
Exercise 14
SELECT E.Dept, COUNT(C.Compid) AS "NUMBER OF COMPUTERS" FROM Employee E INNER JOIN Computer C ON
E.Compid=C.Compid WHERE Make='Dell' GROUP BY E.Dept;
Collaborative Assignment 41
Exercise 39 : GROUP BY
SELECT itemcode, AVG(Qtyavailable) AS "Average Quantity" FROM Retailstock GROUP BY itemcode HAVING
AVG(Qtyavailable)<75;
Assignment 46 : Mandatory
SELECT Pymtmode, COUNT(1) AS "PYMTCOUNT" FROM Orders WHERE TO_CHAR(Pymtdate,'YYYY')<2015 GROUP BY Pymtmode
HAVING COUNT(1)>1;
Assignment 12
Assignment 48 : Mandatory
FROM Item WHERE Itemtype IN('FMCG', 'Computer') GROUP BY Itemtype, Category HAVING (AVG(Price))<2000;
Assignment 13
SELECT Job, AVG(Sal) AS "Average Salary" FROM Emp WHERE Job IN ('MANAGER', 'ANALYST') GROUP BY Job HAVING
AVG(Sal)>1500;
Assignment 14
SELECT Job, Deptno, AVG(Sal) AS "AVGSALARY" FROM Emp WHERE Deptno IN(10, 20) AND Sal>2000 GROUP BY Job, Deptno
HAVING AVG(Sal)>2500;
Assignment 63 : Optional
SELECT Sname, AVG(Quotedprice) AS "Average quoted price" FROM Quotation WHERE Quotedprice>1000 AND Qstatus='Closed'
GROUP BY Sname HAVING AVG(Quotedprice)<4500
Collaborative Assignment 67
SELECT Ename, Sal, D.Dname FROM Emp E INNER JOIN Dept D ON E.Deptno=D.Deptno WHERE E.Sal>2000;
Collaborative Assignment 68
SELECT E.Ename, D.Dname FROM Emp E INNER JOIN Dept D ON E.Deptno=D.Deptno WHERE E.Job='MANAGER'
Collaborative Assignment 69
SELECT DISTINCT Dname FROM Dept D INNER JOIN Emp E ON D.Deptno=E.Deptno WHERE E.Sal>1500;
Assignment 21
SELECT I.Itemcode, I.Descr, Q.Sname FROM Item I INNER JOIN Quotation Q ON I.Itemcode=Q.Itemcode WHERE Q.Quotedprice>0
OR
SELECT I.Itemcode, I.Descr, Q.Sname FROM Item I INNER JOIN Quotation Q ON I.Itemcode=Q.Itemcode WHERE Q.Quotationid IS
NOT NULL;
Assignment 72 : Mandatory
SELECT C.Custid AS "Customer Id", C.Custname AS "Customer Name" FROM Customer C INNER JOIN Empdetails E ON
C.Emailid=E.Emailid WHERE C.Custname=E.Empname;
Assignment 17
SELECT I.Itemcode, I.Descr, I.Category, Q.Quotedprice FROM Item I INNER JOIN Quotation Q ON I.Itemcode=Q.Itemcode WHERE
LOWER(Q.Qstatus)='accepted';
Assignment 74 : Mandatory
SELECT R.Roid, I.Descr, I.Itemtype, R.Unitprice AS "UNITPRICE" FROM Retailstock R INNER JOIN Item I ON R.Itemcode=I.Itemcode
WHERE R.Unitprice>1500;
Assignment 18
SELECT Q.Itemcode, Q.Sname, SUM(O.Qtyordered) AS "TOTALQUANTITY" FROM Orders O INNER JOIN Quotation Q ON
Q.Quotationid=O.Quotationid GROUP BY Q.Itemcode, Q.Sname HAVING SUM(O.Qtyordered)>=100;
Assignment 76 : Mandatory
SELECT I.Itemcode, I.Descr FROM Item I INNER JOIN Quotation Q ON I.Itemcode=Q.Itemcode AND I.Price=Q.Quotedprice GROUP
BY I.Itemcode, I.Descr HAVING COUNT(I.Itemcode)>1;
Assignment 77 : Mandatory
SELECT Q.Sname, Q.Quotationid FROM Quotation Q JOIN Orders O ON Q.Quotationid=O.Quotationid WHERE (Delivereddate-
Orderdate)<=5;
Assignment 85 : Optional
SELECT C.Custname, P.Billamount FROM Customer C JOIN Purchasebill P ON C.Custid=P.Custid WHERE P.Billamount>5000
Assignment 86 : Optional
SELECT RO.Roid, COUNT(1) AS "Number of items" FROM Retailoutlet RO JOIN Retailstock RS ON RO.Roid=RS.Roid GROUP BY
RS.Roid;
OR
Exercise 47 : Joins
SELECT S.Saleid, S.Sldate FROM Sale S JOIN Salesman SM ON S.Sid=SM.Sid WHERE SM.Location='London';
Exercise 15
SELECT S1.Sid, S1.Sname, S1.Location FROM Salesman S1 INNER JOIN Salesman S2 ON S1.Location=S2.Location AND
S1.Sid<>S2.Sid
Exercise 49 : Joins
SELECT S1.sname, S2.Saleid FROM salesman S1 LEFT OUTER JOIN sale S2 ON s1.sid=s2.sid;
Exercise 50 : Joins
FROM Salesman S1 JOIN Sale S2 ON S1.sid=S2.sid JOIN saledetails S3 ON S2.saleid=S3.saleid JOIN product P ON
S3.prodid=P.prodid GROUP BY S1.sid, S1.sname ORDER BY 3 DESC, 4 DESC
Exercise 51 : Joins
SELECT S1.Saleid, S1. Prodid, S3. Sid, S3.Sname FROM Saledetail S1 JOIN Sale S2 ON S1.Saleid=S2.Saleid JOIN Salesman S3 ON
s2.Sid=S3.Sid ;
Exercise 17
SELECT Location, Category, SUM(Quantity) "Total Quantity" FROM Salesman S1 JOIN Sale S2 ON S1.Sid=S2.Sid JOIN Saledetail
S3 ON S2.Saleid=S3.Saleid JOIN Product P ON S3.Prodid=P.Prodid GROUP BY Location, Category
Assignment 15
SELECT E.Ename, V.Vehiclename FROM Emp E FULL OUTER JOIN Empvehicle EV ON E.Empno=EV.Empno LEFT OUTER JOIN
Vehicle V ON EV.Vehicleid=V.Vehicleid
OR
SELECT E.Ename, V.Vehiclename FROM Emp E LEFT OUTER JOIN Empvehicle EV ON E.Empno=EV.Empno LEFT OUTER JOIN
Vehicle V ON EV.Vehicleid=V.Vehicleid
Exercise 54 : Joins
SELECT E.Ename, E.Dept, NVL(Model, 'Not allocated') MODEL FROM Employee E LEFT OUTER JOIN Computer C ON
E.Compid=C.Compid
Exercise 55 : Joins
SELECT E.Id, E.Ename, E.Dept, NVL(Model, 'NULL') MODEL FROM Employee E FUll OUTER JOIN Computer C ON
E.Compid=C.Compid
Exercise 18
SELECT E.Id, E.Ename, E.Manager AS "MGRID", MG.Ename AS "MGRNAME", C.MODEL AS "E_MODEL", CC.Model As "M_MODEL"
FROM EMPLOYEE E JOIN EMPLOYEE MG ON MG.ID=E.Manager JOIN COMPUTER C ON E.COMPID=C.Compid JOIN COMPUTER CC
ON MG.COMPID=CC.compid
Exercise 57 : Joins
SELECT Sid, Sname FROM Salesman WHERE Sid NOT IN (SELECT Sid FROM Sale)
Exercise 16
SELECT P1.Prodid, P1.Category, P1.Price FROM Product P1 INNER JOIN Product P2 ON P1.Price=P2.Price AND
P1.Category<>P2.Category
Assignment 78 : Mandatory
SELECT NVL(E.Empname, 'No Manager') EMPNAME, I.Category, SUM(RS.Qtyavailable) TOTALQUANTITY FROM Item I INNER
JOIN Retailstock RS ON I.Itemcode=RS.Itemcode INNER JOIN Retailoutlet RO ON RO.Roid=RS.Roid LEFT OUTER JOIN Empdetails E
ON RO.Managerid=E.Empid GROUP BY E.Empname, I.Category
Assignment 79 : Mandatory
Assignment 80 : Mandatory
SELECT I.Itemcode, I.Descr, NVL(P.Billamount,'0') AS "BILLAMOUNT", NVL(P.custid,'0') AS "CUSTID" FROM Item I LEFT OUTER
JOIN Purchasebill P ON I.Itemcode=P.Itemcode WHERE I.Itemtype='FMCG'
Assignment 16
Assignment 82 : Mandatory
SELECT E.Empid, E.Empname, R.Roid, R.Location FROM Retailoutlet R LEFT OUTER JOIN Empdetails E ON E.worksin=R.Roid
Assignment 19
SELECT E1.Empname, E1.Designation, E1.Emailid FROM Empdetails E1 JOIN Empdetails E2 ON E1.Worksin=E2.Worksin WHERE
E2.Empname='George' AND E1.Empname<>E2.Empname
Assignment 20
SELECT C1.Custid, C1.Custname FROM Customer C1 JOIN Customer C2 ON C1.Address=C2.Address AND C1.Custid<>C2.Custid
Assignment 87 :
SELECT I.Itemcode, I.Descr, RO.Location, RS.Qtyavailable FROM ITEM I JOIN Retailstock RS ON I.Itemcode=RS.Itemcode JOIN
SELECT I.Itemcode, I.Descr, NVL(Q.Quotationid,'No quotation received') AS "QUOTATIONID" FROM ITEM I LEFT OUTER JOIN
QUOTATION Q ON I.Itemcode=Q.Itemcode
Assignment 89 : Optional
SELECT I.Itemcode, I.Descr, R.Roid, R.Qtyavailable FROM ITEM I JOIN Retailstock R ON I.Itemcode=R.Itemcode
Assignment 90 : Optional
SELECT I.Descr, I.Itemtype, P.Billamount FROM ITEM I JOIN Purchasebill P ON I.Itemcode=P.Itemcode WHERE P.Roid='R1001'
Assignment 91 : Optional
SELECT I.Itemtype, I.Descr, NVL(Q.Quotationid,'No quotation received') AS "Available Quotation number" FROM ITEM I LEFT
OUTER JOIN Quotation Q ON I.Itemcode=Q.Itemcode WHERE I.Itemtype In('Computer', 'FMCG')
SELECT Saleid, Sldate FROM sale WHERE Sldate = (SELECT MAX(Sldate) FROM sale);
SELECT Saleid, Sldate FROM Sale WHERE Sldate IN (SELECT MAX(Sldate) FROM Sale)
Exercise 60 : Independent Subquery
SELECT Sname FROM Salesman WHERE Sid IN (SELECT Sid FROM Sale GROUP BY Sid HAVING COUNT(Saleid)>=2);
SELECT Prodid, Pdesc FROM Product WHERE Prodid IN (SELECT Prodid FROM Saledetail GROUP BY Prodid HAVING
SUM(Quantity) = (SELECT MIN(SUM(Quantity)) FROM Saledetail GROUP BY Prodid))
Exercise 62 : Independent Subquery
select * from salesman where sid in (select sale.sid from sale inner join saledetail on sale.saleid = saledetail.saleid inner join
product on product.prodid=saledetail.prodid group by sid having sum(saledetail.quantity*product.price*(1-
product.discount/100))>(select avg(sum(saledetail.quantity*product.price*(1-product.discount/100))) from product inner join
saledetail on product.prodid = saledetail.prodid group by saleid));
SELECT Sname FROM Salesman SM WHERE NOT EXISTS (SELECT Saleid FROM Sale S WHERE S.Sid=SM.Sid);
SELECT Sname FROM Salesman S WHERE EXISTS (SELECT * FROM Sale SA WHERE S.Sid=SA.Sid AND TO_CHAR(SA.Sldate, 'MM-
YY')='06-15')
Exercise 66 : Correlated Subquery
select sid,sname,location from salesman where sid in (select a1.sid from saledetail s1 join product p1 on s1.prodid=p1.prodid
join sale sa on s1.saleid=sa.saleid join salesman a1 on sa.sid=a1.sid group by a1.sid having
sum((price*quantity)*discount/100)>(select avg(sum((price*quantity)*discount/100)) from saledetail s1 join product p1 on
s1.prodid=p1.prodid join sale sa on s1.saleid=sa.saleid join salesman a1 on sa.sid=a1.sid group by a1.sid));
Collaborative Assignment 93
SELECT DISTINCT I.Itemcode, Itemtype, Descr, Category FROM Item I JOIN Purchasebill P ON I.Itemcode=P.Itemcode
Collaborative Assignment 94
SELECT Itemcode, Descr FROM Item WHERE Itemcode IN ( SELECT Itemcode FROM Quotation WHERE Quotedprice = ( SELECT
MAX(Quotedprice) FROM Quotation WHERE Qstatus IN ('Closed', 'Rejected')) AND Qstatus IN ('Closed', 'Rejected'))
Collaborative Assignment 96
)
Collaborative Assignment 97
Select empid,empname,designation from empdetails where empid in (select managerid from retailoutlet);
Assignment 98 : Mandatory
SELECT DISTINCT Q.Sname, Q.Itemcode, I.Descr FROM quotation Q JOIN Item I ON Q.Itemcode=I.Itemcode WHERE Quotedprice
<
( SELECT MAX(Quotedprice) FROM Quotation Q1 WHERE Q.Itemcode=Q1.Itemcode and Q.Sname <> Q1.Sname)
SELECT EMPID,EMPNAME,DESIGNATION ,SALARY FROM EMPDETAILS E1 WHERE SALARY = (SELECT MAX(SALARY) FROM
EMPDETAILS E2 WHERE E1.DESIGNATION=E2.DESIGNATION);
Assignment 106 : Mandatory
SELECT E.Empno, V.Vehicleid FROM Emp E JOIN Empvehicle V ON E.Empno=V.Empno WHERE Sal =