Return the empid firstname lastname for the employee

Assignment Help Database Management System
Reference no: EM13811208

Part 1-

Questions- Explain why the following query will give an error:

SELECT empid, firstname, lastname, DATEPART(year, hiredate) AS YearHired
FROM HR.Employees
WHERE YearHired = 2004;

You have a table named File with column FileName. You want to write a query that returns all rows for file names that begin with an underscore. Why is WHERE clause i) better than WHERE clause ii)?

i) WHERE FileName LIKE '!_%' ESCAPE '!'
ii) WHERE LEFT(FileName, 1)

Part 3

All queries use the TSQL2012 database unless otherwise indicated.

Label each query with its letter. Copy the query from the SQL Server Management Studio query window into your Assignment Word document. Then copy the results into the Word document. If the result set has more than 10 rows, you need only show the first five rows of the result set, plus an indication of how many rows were returned.

a. Query the HR.Employees table. The result set column headers should be Employee ID, Last Name, and First Name.

b. Return the empid, firstname, lastname, and city for the employee with empid 9.

c. Return a list of employee id's, last names, and first names for employees hired on or after January 1, 2004.

d. Retrieve the product name and unit price of all products that have unit price between $10 and $15. Use the BETWEEN keyword.

e. Retrieve the product id, product name, supplier id, and unit price of all products that are supplied by suppliers 2, 3, 16, or 19. Use the IN keyword. Return the results in order of largest to smallest unit price.

f. List the category name and description for all product categories that contain the character string 'ee' anywhere in the description. Use the LIKE keyword.

g. Retrieve the order id, order date, employee id, and ship (to) city of all orders for which the shipped date is unknown.

h. Write a query that returns the number of days old you are. Use the DATEDIFF function.

Reference no: EM13811208

Questions Cloud

Corporate culture within the organization : Choose a company and briefly describe its business and uniqueness in its industry. Now compare its management practices with the six principles described in Lecture 3. Is the company on the right track? Support your response with solid reasoning. ..
What is an example of a firm or organization : What is an example of a firm or organization you know about, which, in your opinion, has developed a strategy de facto? Explain.
Discuss implementation activities that positively impacted : Discuss implementation activities that positively impacted customer satisfaction? Describe three advantages and three disadvantages of standardizing the marketing mix worldwide?
Describe robert nardelli leadership style : Clearly describe Robert Nardelli's leadership style in terms of Leadership Theory, incorporating the following theories within your paper:
Return the empid firstname lastname for the employee : Return the empid, firstname, lastname, and city for the employee with empid 9. Return a list of employee id's, last names, and first names for employees hired on or after January 1, 2004. Retrieve the product name and unit price of all products that ..
Determine the radial temperature gradient : How deep, would you have to be below the rock surface to detect only a 10% change in temperature compared to the surface during the day? State your answers both in metres and in terms of a multiple of the skin depth.
Provide a description of the project : Provide a description of the project to your instructor. Outline how the project you choose meets the criteria found in the course project description. The more detail you provide, the better your instructor can determine whether or not your proje..
Sap and petrotrin overall enterprise : How has PMMM brought success to both SAP and Petrotrin's overall enterprise?  Use current financial, operational, and strategic news to support the article details for either SAP or Petrotrin to describe their recent results.
Inputs for the productivity improvements : Analyze the trade-offs between inputs for the productivity improvements. Analyze the advantages and disadvantages of global sourcing versus producing in the U.S.

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd