Question: Hello, please consider the attached Bookstore database schema and complete the following / let me know what queries to use on MS SQL Server: 1
Hello, please consider the attached Bookstore database schema and complete the followinglet me know what queries to use on MS SQL Server:
Create the database and its tables. Use the Field Names as given and CapsLock format as given. Decide on the appropriate Data Types.
Use the INSERT queries below to add rows to the associated tables:
EMPLOYEE TABLE:
INSERT INTO EMPLOYEE
VALUES 'John', 'Doe',
'Jane', 'Smith',
'Bob', 'Johnson', ;
DEPARTMENT TABLE:
INSERT INTO DEPARTMENT
VALUES 'Sales'
'Marketing';
SALESORDER TABLE:
INSERT INTO SALESORDER
VALUES
;
After inserting the rows to the tables, create the appropriate SQL queries to achieve the following tasks.
Retrieve all employees whose first name starts with J
Retrieve all orders placed between April st and April th
Retrieve all departments with DepartmentID and
Retrieve all employees who have been assigned to a department.
Retrieve distinct combinations of EmployeeID, FirstName, and LastName from the EMPLOYEE table.
Retrieve EmployeeID, FirstName, LastName, and DepartmentName of all employees along with their corresponding departments.
Retrieve EmployeeID, FirstName, LastName, and OrderDate of all employees and their orders. Include all employees even if they haven't placed any orders. Hint LEFT JOIN.
Retrieve EmployeeID, FirstName, LastName, and OrderDate of all employees and their orders. Include all employees even if they haven't placed any orders. Hint OUTER JOIN.
Retrieve all orders placed on or after April st
Add a new column 'Email' to the EMPLOYEE table. The column must have a length of
Retrieve EmployeeID, FirstName, and LastName of employees who belong to the 'Sales' department.
Thank You
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
