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
 
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
 
Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015dezyneecole
 

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
 
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
 
Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015
 

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

原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAbdelrhman abooda
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改yuu sss
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...limedy534
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)jennyeacort
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhijennyeacort
 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home ServiceSapana Sha
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一F La
 
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一fhwihughh
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 

Recently uploaded (20)

原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
 
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 

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.