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 following/ let me know what queries to use on MS SQL Server:
1.Create the database and its tables. Use the Field Names as given. Decide on the appropriate Data Types
2. Use the INSERT queries below to add rows to the associated tables:
EMPLOYEE TABLE:
INSERT INTO EMPLOYEE
VALUES (1, 'John', 'Doe', 1),
(2, 'Jane', 'Smith', 2),
(3, 'Bob', 'Johnson', 1);
DEPARTMENT TABLE:
INSERT INTO DEPARTMENT
VALUES (1, 'Sales'),
(2, 'Marketing');
SALESORDER TABLE:
INSERT INTO SALESORDER
VALUES (101,1,'2024-04-01',1000.00),
(102,2,'2024-04-05',1500.50),
(103,3,'2024-04-10',2000.75);
3.After inserting the rows to the tables, create the appropriate SQL queries to achieve the following tasks.
3.1.Retrieve all employees whose first name starts with 'J'.
3.2.Retrieve all orders placed between April 1st,2024 and April 10th,2024.
3.3. Retrieve all departments with DepartmentID 1 and 2.
3.4.Retrieve all employees who have been assigned to a department.
3.5.Retrieve distinct combinations of EmployeeID, FirstName, and LastName from the EMPLOYEE table.
3.6.Retrieve EmployeeID, FirstName, LastName, and DepartmentName of all employees along with their corresponding departments.
3.7.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.
3.8.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.
3.9.Retrieve all orders placed on or after April 1st,2024.
3.10. Add a new column 'Email' to the EMPLOYEE table. The column must have a length of 100
3.11. Retrieve EmployeeID, FirstName, and LastName of employees who belong to the 'Sales' department.
 Hello, please consider the attached Bookstore database schema and complete the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!