Question

In: Computer Science

The Common Requirements Of All Questions Are The Same. Read Each Question Carefully And Submit ......

The Common Requirements Of All Questions Are The Same. Read Each Question Carefully And Submit ... Question: The common requirements of all questions are the same. Read each question carefully and submit a ... The common requirements of all questions are the same. Read each question carefully and submit a query to fulfill for each question. Also, students need to submit the result of the corresponding query under the query. The query result should be copied and pasted as it is printed on the screen without any modification. If necessary, the column names appearing in the result should be converted appropriately using "AS" statement. Also, assignment has to be written with Microsoft Word for feedback. For technical issue, other formats, such as image, sql, are not appropriate to receive feedback and comments. Don’t delete or change questions. You just need to insert both your TEXT query and captured screenshot result under your query.

1. Using SELECT statement with CHR function, || Operator, and referring ASCII table, print your FULL name, although the example shows your instructor’s first name only. Also, there should be a space between first and last name (10 points). Eg) SELECT CHR(67)||CHR(104)||CHR(114)||CHR(105)||CHR(115) from dual; ---------------------------------------- Chris

2. Show all columns from locations table. If value of postal_code column is null, then replace null values with “No Postal Code”. If value of state_province column is null, then replace null values with “No State”. (10 points)

3. Calculate how many days the employees have been employed. You need to show hire_date, current date, and difference between hire_date and current date. (10 points) .

4.Using the NVL function, show the same results of the following select statement. (5 points) SELECT first_name, salary, commission_pct, NVL2(commission_pct, salary + salary * commission_pct, salary) compensation FROM employees WHERE first_name LIKE 'T%';

5. Using the CONCAT function, show the same results of the following select statement. (5 points) SELECT last_name || ', ' || first_name, department_id, job_id FROM employees WHERE department_id = 50 ORDER BY last_name, first_name;

This all the information given.

ACCOUNTS: CUST_NAME,ACC_OPEN_DATE, SALARY

BONUSES: EMPLOYEE_ID, BONUS

COUNTRIES: COUNTRY_ID, COUNTRY_NAME, REGION_ID

DBUSER: USER_ID, USERNAME, CREATED_BY, CREATED DATE

DEPARTMENTS: DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID

EMPLOYEES: EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISION_PCT, MANAGER_ID, DEPARTMENT_ID

JOB_HISTORY: EMPLOYEE_ID, START_DATE, END_DATE, JOB_ID, DEPARTMENT_ID

JOBS: JOB_ID, JOB_TITLE, MIN_SALARY, MAX_SALARY

LOCATIONS: LOCATION_ID, STREET_ADDRESS, POSTAL_COSE, CITY, STATE_PROVINCE, COUNTRY_ID

ORDERS: ORDER_ID, ORDER_DATE,ORDER_MODE, CUSTOMER_ID, ORDER_STATUS, ORDER_TOTAL, SALES_REP_ID, PROMOTION_ID

REGIONS: REGION_ID, REGION_NAME

Solutions

Expert Solution

Que.2) Answer:-

1. Below query shows all columns from the Locations table:

>select * from Locations

Example Output:

2. If the value of postal_code column is null, then replace null values with “No Postal Code”:

>Update Locations set Postal_Code = 'No Postal Code' where Postal_Code is NULL

Example Output:

3. If the value of state_province column is null, then replace null values with “No State”.

>Update Locations set State_Province='No State' where State_Province is NULL

Example Output:

Que.3) Answer:-

For Example, the Employees table has the following data as:

Query to find the difference between Hire_Date & Current_Date (The employment period of employees):

>select *, datediff(day,Hire_Date,GETDATE()) as Eployement_Period_In_Days from Employees

Output: (Please see the last column(Eployement_Period_In_Days) for the employment period of employees in days)


Related Solutions

Read each question carefully, make sure to answer all questions are answered and show your work:...
Read each question carefully, make sure to answer all questions are answered and show your work: 5. Nast stores has derived the following consumer credit-scoring model after years of data collect Y=(0.20 x Employment) + (0.4 x Homeowner) + (0.3 x Cards) Employment = 1 if employed part-time, and 0 if unemployed Cards= 1 if presently has 1-5 credit cards, 0 otherwise Nast determines that a score of at least 0.70 indicates a very good credit risk, and it extends...
Questions Nursing related questions answer 'em all read question carefully I'll rate thanks It is 11...
Questions Nursing related questions answer 'em all read question carefully I'll rate thanks It is 11 AM, and you have a patient seated for a restorative procedure. You notice that you have depleted the supply of clean handpieces while caring for the emergency patients seen earlier in the day. What do you do? A patient received her new dentures yesterday and has returned to the office with discomfort. The dentist tells the patient that the denture must be adjusted to...
Answer the following questions: Question 1: Why is it important to carefully read each email before...
Answer the following questions: Question 1: Why is it important to carefully read each email before sending it? Questions 2: Name three examples of communication technology commonly used in corporate communications
Scientific method Read the following story carefully, then answer all the questions that appear at the...
Scientific method Read the following story carefully, then answer all the questions that appear at the end of it. [It is a hypothetical study, raised by the teacher, I present all the available information. Than you for your help] Ana was looking for a project for her school's Science Fair. You read in a scientific journal about a study in which chickens were fed antibiotics. According to the study, chickens that were fed antibiotics grew faster than those that were...
Read each question carefully. Write your response in the space provided for each part of each...
Read each question carefully. Write your response in the space provided for each part of each question. Answers must be written out in paragraph form. Outlines, bulleted lists, or diagrams alone are not acceptable and will not be scored. Primary spermatocytes are diploid (2n) cells with all of the organelles typically found in eukaryotic animal cells. A representation of spermatogenesis from a primary spermatocyte with six chromosomes is shown in Figure 1. (a)  Describe the process in meiosis that ensures that...
Read each question carefully. Write your response in the space provided for each part of each...
Read each question carefully. Write your response in the space provided for each part of each question. Answers must be written out in paragraph form. Outlines, bulleted lists, or diagrams alone are not acceptable and will not be scored. Scientists used cells called fibroblasts to study factors that cause nondividing cells in the  G0 stage of the cell cycle to reenter the cell cycle and undergo mitosis. In a laboratory, fibroblasts typically grow and divide when they are cultured in a...
Read each question carefully. Write your response in the space provided for each part of each...
Read each question carefully. Write your response in the space provided for each part of each question. Answers must be written out in paragraph form. Outlines, bulleted lists, or diagrams alone are not acceptable and will not be scored. The sex of an organism is typically determined genetically, but environmental factors can also play a role. Scientists examined the roles of genes and environmental temperature in the sex determination of a lizard species. Individuals with a  ZW pair of chromosomes are...
Read each question carefully. Write your response in the space provided for each part of each...
Read each question carefully. Write your response in the space provided for each part of each question. Answers must be written out in paragraph form. Outlines, bulleted lists, or diagrams alone are not acceptable and will not be scored. Enolase is an enzyme that catalyzes one reaction in glycolysis in all organisms that carry out this process. The amino acid sequence of enolase is similar but not identical in the organisms. Researchers purified enolase from  Saccharomyces cerevisiae, a single-celled eukaryotic yeast...
Read the following case carefully and answer all the questions. Use a critical and analytical style...
Read the following case carefully and answer all the questions. Use a critical and analytical style and be clear in answering the questions; general answers earn zero marks. The maximum score is ​100 marks​, each question has ​25 marks​. Great Water of France, Inc.: Perrier Perrier is naturally carbonated spring water with smaller bubbles and a distinct flavor when compared with competing products, most of which are charged with machine-made carbon dioxides. Thedistinctivelyshapedgreen-tintedbottle,theequalitydistinctivelabel,thepremium price, and the advertising all combine to...
Instructions: Read the problemn and complete all the questions included below. Submit your answers on a...
Instructions: Read the problemn and complete all the questions included below. Submit your answers on a Word (.doc) or Excel (.xls) document Check the Rubric As a consultant for Acme Engineering you have been able to establish the following parameters from their Financial Statements: Item Amount Cash $200,000 Securities $90,000 Accounts Receivable $300,000 Inventories $400,000 Prepaid Expenses $16,000 Accounts Payable $630,000 Other Liabilities $180,000 Calculate the following parameters: Total Assets Total Liabilities Working Capital Current Ratio Acid Test Ratio
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT