Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use SQL Management Studio to create a database called ITCO630_P1.MDF. Be sure to

ID: 3710148 • Letter: U

Question

Use SQL Management Studio to create a database called ITCO630_P1.MDF. Be sure to store the database in a location that you will remember. Add the following tables and data to the database. Use the appropriate field types and lengths for the tables. Create the following queries and save them all in a file called ITCO630_P1.SQL. Please note that you can execute individual queries in a query file by highlighting the lines that you want to execute before running the script. Define what database to use with a USE statement. Get the full details of the employee table. Get the full details of the employees who work in store S2. Get the full details of the promotions with a budget greater than $100,000. Get the employee number and promotion number for employees with unknown (NULL) jobs who work on promotion P2. Using a subquery, get the first and last names of the employees who work in the Orange Appeal store. Using a subquery, get full details of all the employees whose stores are located in Orlando. Detach the database and create a zip file called ITCO630_P1.ZIP including the associated log file and the query file. After creating the zip file, reattach the database.

Explanation / Answer

use ITCO630_P1.MDF; //Pointing to database for create tables

create table employee(field1 datatype1,field2 datatype2.......) //For Creating in DB

-------------------------------------------------------------------------------------------------------
QUERIES
-------------------------------------------------------------------------------------------------------

1.Get the full details of employee table.

Query : SELECT * FROM employee;

2.Get the full details of employee table who work in store S2.

Query : SELECT * FROM employee WHERE store="S2";

3.Get the full details of promotions with a budget greater than $100,000.

Query : SELECT * FROM employee WHERE promotionbudget>6546920 //Dollar is converted to INR...

4.Get Employee number and Promotion number for employees with unknown(NULL) Jobs who work on promotion P2.

Query : SELECT employeenumber,promotionnumber FROM employee WHERE jobs=" " && promotions="P2";

5.Using Subquery,get first and last names of an employees who work in the orange Appeal store.

Query: SELECT firstname,lastname FROM employee WHERE store="Orange Appeal";
6.Using Subquery,get full details of an employees who store is located in Orlando.

Query : SELECT * FROM employee WHERE location="Orlando":