SlideShare a Scribd company logo
1 of 4
Download to read offline
Introduction to databases
Mohd Tousif
Assignment – S1
1. Prepare the below tables in database in the given format (Employee)
A) Employee
Column Name Data Type Size
Employee_Id Number 6
First_Name Varchar2 20
Last_Name Varchar2 25
Email_Id Varchar2 14
Phone_Number Varchar2 20
Hire_Date Date
Job_Id Varchar2 10
Salary Number 8,2
Commission_Percent Number 2,2
Manager_Id Number 6
Department_Id Number 4
Insert into the above table below values
Emplo
yee_Id
First_N
ame
Last_N
ame
Email_
Id
Phone_
Numbe
r
Hire_D
ate
Job_Id Salary Commi
ssion_P
ercent
Manag
er_Id
Depart
ment_I
d
100 Sailaja Balgeri sb 515.123
.1421
06/17/8
7
AD_PR
ES
24000 0.9 90
101 Neelim
a
Atmuri na 515.124
.1431
09/21/8
9
AD_VP 17000 0.9 100 90
102 Nitin Agarw
al
nag 514.123
.1543
01/13/9
3
AD_VP 17000 0.9 100 90
103 Prasan
th
Rathor
e
pr 515.124
.1421
01/03/9
0
IT_PR
OG
9000 0.6 102 60
104 Santos
h
Devun
uri
sd 514.152
.1278
21/05/9
1
IT_PR
OG
6000 0.6 103 60
107 Ravi ra 512.123
.1234
07/02/9
9
IT_PR
OG
4200 0.6 103 60
124 Vijay vi 513.235
.1246
16/11/9
9
ST_M
AN
5800 0.5 100 50
141 Naveen nav 512.124
.1234
17/10/9
5
ST_CL
ERK
3500 0.5 124 50
142 Amrith
a
am 512.124
.2345
29/01/9
7
ST_CL
ERK
3100 0.5 124 50
143 Srikant
h
G sg 512.123
.1245
15/03/9
8
ST_CL
ERK
2600 0.5 124 50
144 Amol Singh as 09/07/9
8
ST_CL
ERK
2500 0.5 124 50
B) Department
Column Name Data Type Size
Department_Id Number 4
Department_Name Varchar2 30
Manager_Id Number 6
Location_Id Number 4
Insert into the above table below values
Department_Id Department_Name Manager_Id Location_Id
10 Administration 200 1700
20 Marketing 201 1800
50 Shipping 124 1500
60 IT 103 1400
80 Sales 149 2500
90 Executive 100 1700
110 Accounting 205 1700
190 Contracting 1700
C) Salgrade
Column Name Data Type Size
Grade_Level Varcahr2 3
Lowest_Sal Number 6
Highest_Sal Number 6
Insert into the above table below values
Grade_Level Lowest_Sal Highest_Sal
A 1000 2999
B 3000 5999
C 6000 9999
D 10000 14999
E 15000 24999
F 25000 40000
2. Create an Emp table with the following criteria:
Eno number(6)
Ename varchar2(30)
Sal number(8,2)
3. Add a column deptno with the datatype number of size 4
4. Change the name of the column Sal to Salary
5. Change the size of a column Ename to 40 character long
6. Create a Dept table with the following criteria:
Dno number(6)
Dname varchar2(40)
loc_id number(4)
7. remove a column loc_id from dept table
8. change the name of the Dept to Departments
9. insert into emp table the below values
Eno Ename Salary Deptno
1 ANIL 20000 1001
2 ATUL 25000 2002
3 ARUL 30000 1001
4 AMIT 27000 3003
5 ANUP 35000 2002
6 ANIR 30000 1001
10. Insert into departments table the below information
Dno Dname
1001 MARKETING
2002 SALES
3003 EXECUTIVE
4004 IT
5005 PRODUCTION
11. Change the salary of all employees who belong to department number 1001 to 40000
12. Change the department number of ARUL to 2002
13. Remove the information of those employees who are earning 27000
14. Empty the table departments
15. Remove the table Departments from the database
16. Remove the table Emp from the database
17. Clear the recyclebin
18. Show the structure of the SALGRADE table.
19. Select all data from the DEPARTMENT table.
20. Show the structure of the EMPLOYEE table.
21. Write a query to display the last name,job code,hire date, and employee number for
each employee, with employee numbers appearing first. Provide an alias name
STARTDATE for the HIRE DATE column.
22. Write a query to display unique job codes from the EMPLOYEE table.
23. Write a query to display the last name concatenated with the job code, separated by a
comma and space
24. Create a query to display the last name and salary of employees earning more than
12,000.
25. Write a query to display the last name and department number for employee number
176.
26. Write a query to display the last name and salary of employees whose salary is not in
the range of 5,000 and 12,000.
27. Write a query to display the last name, job code and start date of employees hired
between February 20,1998 and May 1,1998. Order the query in the ascending order by
start date.
28. Write a query to display the last name and department number of all employees in
department number 20 and 50 in the alphabetical order by last name.
29. Write a query to display the last name and salary of employees who earn between
5,000 and 12,000 and are in the department 20 or 50. Label the columns as Employee
and Monthly Salary.
30. Write a query to display the last name and hire date of all employees who was hired in
1994.
31. Write a query to display the last name, salary and commission for all employees who
earn commission. Sort data in descending order of salary and commission.
32. Write a query to display the last names of all employees where the third letter of the
last name is an 'A'.
33. Write a query to display the last name of all employees who have an 'A' and 'E' in
their last name.
34. Write a query to display the last name,job and salary whose job is sales representative
or stock clerk and whose salary is not equal to 2500,3500,7000.
35. Write a query to display the current date
36. For each employee, display the employee number, last name and salary and the salary
increased by 15% ,rename it as New Salary
37. For the above query add a column called Increase which should contain the difference
between the old and new salaries.
38. Write a query that produces the following for each employee:
39. <employee last name> earns <salary> monthly but wants <3 times salary>. Label the
column as Dream Salaries.
40. Create a query to display the last name and salary for all employees. Format the salary
to be 15 character long, left-padded with $. label the column Salary.
41. Display each employee's last name,hire date, and salary review date, which is the first
Monday after six months of service. Label the column REVIEW. Format the dates to
appear in the format similar to “Monday, the Thirty-First of July, 2000”.
42. Display the last name, hire date, and day of the week on which the employee started.
Label the column DAY. Order the results by the day of the week.
43. Create a query that display's the employee's last names and indicates the amounts of
their annual salaries. Sort the data in the descending order of salary. Label the column
EMPLOYEE_AND_THEIR_SALARIES.

More Related Content

Similar to Introduction to Databases - Assignment_1

DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaMohammad Imam Hossain
 
12th information practices mysql practice questions
12th information practices mysql practice questions12th information practices mysql practice questions
12th information practices mysql practice questionsHarish Gyanani
 
Sql task answers
Sql task answersSql task answers
Sql task answersNawaz Sk
 
SQL case study Analysis PPT by Radhika Kashidd
SQL case study Analysis PPT by Radhika KashiddSQL case study Analysis PPT by Radhika Kashidd
SQL case study Analysis PPT by Radhika Kashiddradhikakashid25
 
Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015dezyneecole
 
Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Yeardezyneecole
 
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole CollegeDivyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole Collegedezyneecole
 
Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015dezyneecole
 
Pooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer ApplicationPooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer Applicationdezyneecole
 

Similar to Introduction to Databases - Assignment_1 (20)

DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR Schema
 
Sql task
Sql taskSql task
Sql task
 
12th information practices mysql practice questions
12th information practices mysql practice questions12th information practices mysql practice questions
12th information practices mysql practice questions
 
Sql task answers
Sql task answersSql task answers
Sql task answers
 
Case study
Case studyCase study
Case study
 
SQL BASIC QUERIES
SQL  BASIC QUERIES SQL  BASIC QUERIES
SQL BASIC QUERIES
 
SQL case study Analysis PPT by Radhika Kashidd
SQL case study Analysis PPT by Radhika KashiddSQL case study Analysis PPT by Radhika Kashidd
SQL case study Analysis PPT by Radhika Kashidd
 
Vijay Kumar
Vijay KumarVijay Kumar
Vijay Kumar
 
Sql assignment 4
Sql assignment 4Sql assignment 4
Sql assignment 4
 
Sql lab experiments
Sql lab experimentsSql lab experiments
Sql lab experiments
 
Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015
 
sql qn.docx
sql qn.docxsql qn.docx
sql qn.docx
 
Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Year
 
Pooja Jain
Pooja JainPooja Jain
Pooja Jain
 
Sql wksht-5
Sql wksht-5Sql wksht-5
Sql wksht-5
 
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole CollegeDivyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
 
Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015
 
Ravi querys 425
Ravi querys  425Ravi querys  425
Ravi querys 425
 
Dump Answers
Dump AnswersDump Answers
Dump Answers
 
Pooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer ApplicationPooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer Application
 

More from Mohd Tousif

Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statementsMohd Tousif
 
Introduction to Databases
Introduction to DatabasesIntroduction to Databases
Introduction to DatabasesMohd Tousif
 
Entity Relationship Model - An Example
Entity Relationship Model - An ExampleEntity Relationship Model - An Example
Entity Relationship Model - An ExampleMohd Tousif
 
Entity Relationship (ER) Model Questions
Entity Relationship (ER) Model QuestionsEntity Relationship (ER) Model Questions
Entity Relationship (ER) Model QuestionsMohd Tousif
 
Entity Relationship (ER) Model
Entity Relationship (ER) ModelEntity Relationship (ER) Model
Entity Relationship (ER) ModelMohd Tousif
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL) Mohd Tousif
 
Data Warehouse Concepts and Architecture
Data Warehouse Concepts and ArchitectureData Warehouse Concepts and Architecture
Data Warehouse Concepts and ArchitectureMohd Tousif
 
SQL practice questions for beginners
SQL practice questions for beginnersSQL practice questions for beginners
SQL practice questions for beginnersMohd Tousif
 
Oracle sql tutorial
Oracle sql tutorialOracle sql tutorial
Oracle sql tutorialMohd Tousif
 
Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Mohd Tousif
 
System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xpMohd Tousif
 
Inter process communication
Inter process communicationInter process communication
Inter process communicationMohd Tousif
 
Producer consumer
Producer consumerProducer consumer
Producer consumerMohd Tousif
 

More from Mohd Tousif (19)

Sql commands
Sql commandsSql commands
Sql commands
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 
Introduction to Databases
Introduction to DatabasesIntroduction to Databases
Introduction to Databases
 
Entity Relationship Model - An Example
Entity Relationship Model - An ExampleEntity Relationship Model - An Example
Entity Relationship Model - An Example
 
Entity Relationship (ER) Model Questions
Entity Relationship (ER) Model QuestionsEntity Relationship (ER) Model Questions
Entity Relationship (ER) Model Questions
 
Entity Relationship (ER) Model
Entity Relationship (ER) ModelEntity Relationship (ER) Model
Entity Relationship (ER) Model
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL)
 
Data Warehouse Concepts and Architecture
Data Warehouse Concepts and ArchitectureData Warehouse Concepts and Architecture
Data Warehouse Concepts and Architecture
 
SQL practice questions for beginners
SQL practice questions for beginnersSQL practice questions for beginners
SQL practice questions for beginners
 
Oracle sql tutorial
Oracle sql tutorialOracle sql tutorial
Oracle sql tutorial
 
Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)
 
Sql commands
Sql commandsSql commands
Sql commands
 
Virtual box
Virtual boxVirtual box
Virtual box
 
Deadlock
DeadlockDeadlock
Deadlock
 
Algorithm o.s.
Algorithm o.s.Algorithm o.s.
Algorithm o.s.
 
System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xp
 
Ipc
IpcIpc
Ipc
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Producer consumer
Producer consumerProducer consumer
Producer consumer
 

Recently uploaded

BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...shambhavirathore45
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...shivangimorya083
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 

Recently uploaded (20)

BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 

Introduction to Databases - Assignment_1

  • 1. Introduction to databases Mohd Tousif Assignment – S1 1. Prepare the below tables in database in the given format (Employee) A) Employee Column Name Data Type Size Employee_Id Number 6 First_Name Varchar2 20 Last_Name Varchar2 25 Email_Id Varchar2 14 Phone_Number Varchar2 20 Hire_Date Date Job_Id Varchar2 10 Salary Number 8,2 Commission_Percent Number 2,2 Manager_Id Number 6 Department_Id Number 4 Insert into the above table below values Emplo yee_Id First_N ame Last_N ame Email_ Id Phone_ Numbe r Hire_D ate Job_Id Salary Commi ssion_P ercent Manag er_Id Depart ment_I d 100 Sailaja Balgeri sb 515.123 .1421 06/17/8 7 AD_PR ES 24000 0.9 90 101 Neelim a Atmuri na 515.124 .1431 09/21/8 9 AD_VP 17000 0.9 100 90 102 Nitin Agarw al nag 514.123 .1543 01/13/9 3 AD_VP 17000 0.9 100 90 103 Prasan th Rathor e pr 515.124 .1421 01/03/9 0 IT_PR OG 9000 0.6 102 60 104 Santos h Devun uri sd 514.152 .1278 21/05/9 1 IT_PR OG 6000 0.6 103 60 107 Ravi ra 512.123 .1234 07/02/9 9 IT_PR OG 4200 0.6 103 60
  • 2. 124 Vijay vi 513.235 .1246 16/11/9 9 ST_M AN 5800 0.5 100 50 141 Naveen nav 512.124 .1234 17/10/9 5 ST_CL ERK 3500 0.5 124 50 142 Amrith a am 512.124 .2345 29/01/9 7 ST_CL ERK 3100 0.5 124 50 143 Srikant h G sg 512.123 .1245 15/03/9 8 ST_CL ERK 2600 0.5 124 50 144 Amol Singh as 09/07/9 8 ST_CL ERK 2500 0.5 124 50 B) Department Column Name Data Type Size Department_Id Number 4 Department_Name Varchar2 30 Manager_Id Number 6 Location_Id Number 4 Insert into the above table below values Department_Id Department_Name Manager_Id Location_Id 10 Administration 200 1700 20 Marketing 201 1800 50 Shipping 124 1500 60 IT 103 1400 80 Sales 149 2500 90 Executive 100 1700 110 Accounting 205 1700 190 Contracting 1700 C) Salgrade Column Name Data Type Size Grade_Level Varcahr2 3 Lowest_Sal Number 6 Highest_Sal Number 6 Insert into the above table below values Grade_Level Lowest_Sal Highest_Sal A 1000 2999 B 3000 5999 C 6000 9999
  • 3. D 10000 14999 E 15000 24999 F 25000 40000 2. Create an Emp table with the following criteria: Eno number(6) Ename varchar2(30) Sal number(8,2) 3. Add a column deptno with the datatype number of size 4 4. Change the name of the column Sal to Salary 5. Change the size of a column Ename to 40 character long 6. Create a Dept table with the following criteria: Dno number(6) Dname varchar2(40) loc_id number(4) 7. remove a column loc_id from dept table 8. change the name of the Dept to Departments 9. insert into emp table the below values Eno Ename Salary Deptno 1 ANIL 20000 1001 2 ATUL 25000 2002 3 ARUL 30000 1001 4 AMIT 27000 3003 5 ANUP 35000 2002 6 ANIR 30000 1001 10. Insert into departments table the below information Dno Dname 1001 MARKETING 2002 SALES 3003 EXECUTIVE 4004 IT 5005 PRODUCTION 11. Change the salary of all employees who belong to department number 1001 to 40000 12. Change the department number of ARUL to 2002 13. Remove the information of those employees who are earning 27000 14. Empty the table departments 15. Remove the table Departments from the database 16. Remove the table Emp from the database 17. Clear the recyclebin 18. Show the structure of the SALGRADE table. 19. Select all data from the DEPARTMENT table. 20. Show the structure of the EMPLOYEE table. 21. Write a query to display the last name,job code,hire date, and employee number for
  • 4. each employee, with employee numbers appearing first. Provide an alias name STARTDATE for the HIRE DATE column. 22. Write a query to display unique job codes from the EMPLOYEE table. 23. Write a query to display the last name concatenated with the job code, separated by a comma and space 24. Create a query to display the last name and salary of employees earning more than 12,000. 25. Write a query to display the last name and department number for employee number 176. 26. Write a query to display the last name and salary of employees whose salary is not in the range of 5,000 and 12,000. 27. Write a query to display the last name, job code and start date of employees hired between February 20,1998 and May 1,1998. Order the query in the ascending order by start date. 28. Write a query to display the last name and department number of all employees in department number 20 and 50 in the alphabetical order by last name. 29. Write a query to display the last name and salary of employees who earn between 5,000 and 12,000 and are in the department 20 or 50. Label the columns as Employee and Monthly Salary. 30. Write a query to display the last name and hire date of all employees who was hired in 1994. 31. Write a query to display the last name, salary and commission for all employees who earn commission. Sort data in descending order of salary and commission. 32. Write a query to display the last names of all employees where the third letter of the last name is an 'A'. 33. Write a query to display the last name of all employees who have an 'A' and 'E' in their last name. 34. Write a query to display the last name,job and salary whose job is sales representative or stock clerk and whose salary is not equal to 2500,3500,7000. 35. Write a query to display the current date 36. For each employee, display the employee number, last name and salary and the salary increased by 15% ,rename it as New Salary 37. For the above query add a column called Increase which should contain the difference between the old and new salaries. 38. Write a query that produces the following for each employee: 39. <employee last name> earns <salary> monthly but wants <3 times salary>. Label the column as Dream Salaries. 40. Create a query to display the last name and salary for all employees. Format the salary to be 15 character long, left-padded with $. label the column Salary. 41. Display each employee's last name,hire date, and salary review date, which is the first Monday after six months of service. Label the column REVIEW. Format the dates to appear in the format similar to “Monday, the Thirty-First of July, 2000”. 42. Display the last name, hire date, and day of the week on which the employee started. Label the column DAY. Order the results by the day of the week. 43. Create a query that display's the employee's last names and indicates the amounts of their annual salaries. Sort the data in the descending order of salary. Label the column EMPLOYEE_AND_THEIR_SALARIES.