Question

In: Computer Science

As a suggestion, you might want to accomplish this SQL exercise before you accomplish the primary...

  • As a suggestion, you might want to accomplish this SQL exercise before you accomplish the primary assignment for this week.
  • If you have not already done so, use MSSQLS Management Studio to create a new database named ch07_ConstructCo. Use the default settings. When the database has been created, run the Ch07_ConstructCo_SQL.txt script linked above to create and load the database tables and data.  
  • Write a T-SQL query for the constructco tables to list the employee last name, first name, job code, and hire date from the employee table.
  • Write a T-SQL query for the constructco tables to list the employee last name, first name, and hire date where the hire date is greater than 2000-01-01.
  • Write a T-SQL query for the constructco tables to list the employee last name, project number, assigned job from the employee, and assignment tables where the employee table employee number is equal to the assignment table employee number.
  • Ensure that you have copied and pasted all of the T-SQL statements and verification results into your assignment submission.

Once you have accomplished that action, paste the script into your assignment submission document for this part of your assignment.

Solutions

Expert Solution

Dear Student,

You will need to create the necessary and instructed databbase and tables as per the given question. You can copy paste the commands of the queries that are attached in the code snippet below. Do note that I have used the following terms:

constructco_employee - table that holds the employee data

attributes of the table: e_no = employee number (primary key), fname = first name, lname = last name, j_code = job code, hire_date = date of hire.

constructco_assignment - table that holds the data of the assigned projects to employees

attributes of the table: emp_no = employee number (foreign key), proj_no = project number, job = assigned job.

SELECT LNAME, FNAME, HIRE_DATE FROM constructco_employee;


SELECT LNAME, FNAME, HIRE_DATE 
    FROM constructco_employee  
    WHERE HIRE_DATE > 2000-01-01;


SELECT LNAME, PROJ_NO, JOB 
   FROM constructco_employee, constructco_assignment 
   WHERE  constructco_employee.E_NO = constructco_assignment.EMP_NO;

Note: make necessary changes in the names of the table and attributes. Table names and attributes are CASE SENSITIVE!


Related Solutions

Before you start this exercise, I want you to write down the answers to these questions.  ...
Before you start this exercise, I want you to write down the answers to these questions.   Really, write them down BEFORE you read the discussion question. 1)  Are you for or against any forms of discrimination?  (Seems like a fairly ridiculous question, doesn't it?) 2) How do you define discrimination? If you had to describe discrimination what would it be?  How would you know if you were being discriminated against? STOP!  Before you read anything else, did you write down the answer to...
Find the solution of the following problems. Before doing these problems, you might want to review...
Find the solution of the following problems. Before doing these problems, you might want to review Exercise 3** on page 63: d.) xy" + y' = x, where y(1) = 1m and y'(1) = -1 (answer should be y(x) = 1/4 x2 - 3/2 ln(x) + 3/4) e.) (x-1)2y" + (x-1)y' - y = 0, where y(2) = 1, and y'(2) = 0 (answer should be: y(x) = 1/2 (x-1)-1 + x/2 - 1/2) **Exercise 3: The formula for a...
Why might the doctor want to know if the patient is having a primary or secondary...
Why might the doctor want to know if the patient is having a primary or secondary immune response?
Write the SQL queries that accomplish the following tasks using the AP Database 9. Write a...
Write the SQL queries that accomplish the following tasks using the AP Database 9. Write a select statement to show the invoicelineitemdescriptions that have the total invoicelineitemamount >1000 and the number of accountno is >2. 10. Write a select statement that returns the vendorid, paymentsum of each vendor, and the number of invoices of each vendor, where paymentsum is the sum of the paymentotal column. Return only the top ten vendors who have been paid the most and the number...
Provide a suggestion on making a significant improvement on thegrowth of primary market of MALAYSIAN...
Provide a suggestion on making a significant improvement on the growth of primary market of MALAYSIAN STOCK MARKET.
What is the primary goal of Fair Trade? How does the movement accomplish this in a...
What is the primary goal of Fair Trade? How does the movement accomplish this in a world where commodity markets seem to be in continual decline?
Think of a product that you can recycle that you might want to be able to...
Think of a product that you can recycle that you might want to be able to deposit into aRecycling Machine, like maybe an empty soft drink can. Start by listing all the properties of that object that you can think of – try to come up with at least tengeneral properties of aRecyclableItemand write these down in your Assignment_Part_1_Microsoft Word document, provided for download in the assessment section of your Moodle shell. Next, use the process of abstraction to cut...
You are a nurse in a senior center. You want to develop primary, secondary, and tertiary...
You are a nurse in a senior center. You want to develop primary, secondary, and tertiary prevention programs. What activities would be appropriate under each program for a senior population.
BYZANTIUM What was The City of God? What did Augustine want to accomplish with The City...
BYZANTIUM What was The City of God? What did Augustine want to accomplish with The City of God and why is it important historically. What basic problem is the subject of The Consolation? What is the solution according to Lady Philosophy? What was Emperor Justinian’s most important legal achievement? Explain. Tell us more about Constantinople. What was it before? Why was it important for the Byzantine Empire? What became of it afterward/What is it today? Why was there a movement...
Suppose you want have a coin that you think might not be exactly fair, that is...
Suppose you want have a coin that you think might not be exactly fair, that is the probability of a head might be slightly different from 0.5. You would like to produce a 95% confidence interval for p, the true probability of a head. You decide that you would like the margin of error for your interval to be plus or minus 0.001 (that is plus or minus 0.1%). How many times, n, do you need to toss the coin...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT