DealCo Database, computer science homework help
DealCo Database, computer science homework help
Week 7 Assignment Create a new database called DealCo.
Load the DealCo script linked above into the DealCo database to use for problems 1-5.
1. Write a T-SQL query to display the emp code, emp lname, employee job code, from the employee table joining the job table where the employee job code equals the job table job code. Order the output by employee job code. Copy and paste the query and the output into your assignment document. (hint: use table aliases)
2. Write a T-SQL query to display the employee store code and a count of the number of employees by store joining the employee and store tables where the employee store code equals the store store code. group by the employee store code.
3. Write a T-SQL correlated subquery selecting the store code, store name, store ytd sales from the store table where the store code matches the selection result of the max store code from the store table where the store code matches.
4. Write a T-SQL query to select the employee last name, title, and store code where the last name begins with an upper case R followed by a string of any length.
5. Write a T-SQL query to select the store code, employee last name, and the computed age of the employee based on the difference between the employee date of birth and the systdatetime of the query run with a column name of AGE. The age should be computed as whole years (ie. 49).
Attached is the DealCo database script, just copy and paste it into SSMS and execute after creating the DealCo database.
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


