Select all columns from the jobs table using an asterisk. 2. Select only job title, min salary, and max salary columns from the jobs table. 3. Select all columns from the d_partners table by writing out all of the columns in the select statement. 4. Using the d_partners table, display the id, and then concatenate the first_name and last_name together with a space in between the two columns. Give the concatenated column an alias of NAME. Be sure to use the optional AS keyword.
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
Select all columns from the jobs table using an asterisk.
2. Select only job title, min salary, and max salary columns from the jobs table.
3. Select all columns from the d_partners table by writing out all of the columns in
the select statement.
4. Using the d_partners table, display the id, and then concatenate the first_name
and last_name together with a space in between the two columns. Give the
concatenated column an alias of NAME. Be sure to use the optional AS
keyword.
5. Using the job_grades table, show the grade level, and then subtract the
lowest_sal from the highest_sal to show the amount of variance there is for each
grade level. Give the calculated column an alias of Salary_Variance. Do not
use the optional AS keyword.
6. Using the employees table, show an unduplicated list of department_id’s.
7. Change the SELECT statement you built for question 4, adding a single column
called Partner_Information that concatenates the partner’s expertise,
auth_expense_amt, and manager_ id, so the output looks like this (note: some
2
of the columns for the partners have no value so it shows up empty in the
results.):
8. Each staff’s salary is displayed as their hourly salary in the f_staffs table. Write
a query that displays the id, salary, then multiplies that salary by 40, and then
multiplies by by 52 to show what the employee’s annual salary would be. Give
the calculated column an alias of Annual_Salary. Your results should look like
this:
9. Write a query using the dual table to subtract 59874 from 128579 and call the
calculated column Calculation.
10. Write a query that displays the name and description for all the events in
the DJs on Demand d_events table. The column headings should appear as
“Event” and “Description”
11. The employees in the employees table are going to get a 10% a month
raise for the year. However, when the president looked at the results, he couldn't
figure out why the new raises were not as he predicted. Kochhar should have a
new salary of $$18,700, Hunold’s salary should be $9,900, and De Ernst’s
should be $6,600. He used the following query:
select last_name, salary * .10 as New_Salary
from employees
What should he have done? Show me the corrected code and the results.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images