Practical File 2
Practical File 2
Table : Store
a. To create the above table: Store and insert all five records in it.
ANSWER :
use dataframe1;
values('S101','Planetfashion','Karol Bagh','Delhi',7,'2015/10/16',300000),
('S102','Trends','Nehru Nagar','Mumbai',11,'2015/08/09',400000),
('S103','Vogue','Vikas Vihar','Delhi',10,'2015/06/27',200000),
('S104','Superfashion','Defence Colony','Delhi',8,'2015/02/18',450000),
('S105','Rage','Bandra','Mumbai',5,'2015/09/22',600000);
select*from Store;
OUTPUT:
ANSWER:
OUTPUT:
c. To display names of stores along with SalesAmount of those stores that have
‘fashion’ anywhere in their store names.
ANSWER:
OUTPUT:
d. To display Stores names, Location and Date Opened of stores that were opened
before 1st March, 2015.
ANSWER:
ANSWER:
OUTPUT:
f. To add a new column YearOfSales.
ANSWER:
select*from Store;
OUTPUT:
ANSWER:
select*from Store;
OUTPUT:
g. To display store names ending with “ion”.
ANSWER:
OUTPUT:
ANSWER:
select*from Store;
OUTPUT:
ANSWER:
select*from Store;
OUTPUT:
101 President 200000
a. To display employee ids, names of employees, job ids with corresponding job
titles.
ANSWER:
OUTPUT:
b. To display names of employees, sales and corresponding job titles who have
achieved sales more than 1300000.
ANSWER:
select Employee.Name,Employee.Sales,Job1.Jobtitle from Employee,Job1 where
Employee.Sales>1300000 and Employee.JobID=Job1.JobID;
OUTPUT:
c. To display names and corresponding job titles of those employee who have
‘SINGH’ (anywhere) in their names.
ANSWER:
OUTPUT:
ANSWER: JOBID
e. Write SQL command to change the JOBID to 104 of the Employee with ID as
E4 in the table ‘EMPLOYEE’.
ANSWER:
Q3. Consider a table EMPLOYEE with the following data and answer the SQL
queries:
CODE (%)
ANSWER:
ANSWER:
OUTPUT:
ANSWER:
OUTPUT:
d. Display the names of employees in upper case and lower case.
ANSWER:
OUTPUT:
ANSWER:
OUTPUT:
ANSWER:
OUTPUT:
f. Display the ename and month of date of join.
ANSWER:
OUTPUT:
ANSWER: