Question: Help me solve this using SQL Manufacturing Company The company has offices in three cities: Boston, New York, and Cleveland. The database has to support

Help me solve this using SQL Help me solve this using SQL Manufacturing Company The company hasoffices in three cities: Boston, New York, and Cleveland. The database has

Manufacturing Company The company has offices in three cities: Boston, New York, and Cleveland. The database has to support data about departments and employees of the company. For the departments, the company needs to keep their codes, names (names are unique), locations, and types; for the employeesIDs, names, and types (full-time, part-time, or consultant). Each employee is assigned to one department. In addition, each employee has a title, which defines the employee's salary; salaries cannot exceed $100,000. Departments of the company are located in three cities. The logical model of this database is the following (primary keys are underlined; foreign keys are in italic): Title (titleCode, titleDescription, salary) Department (deptCode, deptName, location, deptType) Employee (ID, emplName, emplType, dept Code, titleCode) You may use the following data in the tables of your database: Title Department | titleCode title Description Accountant T2 Analyst T3 Programmer T4 DBA T5 Manager Employee salary 10000 20000 30000 | 40000 50000 deptCode | 001 002 003 | 004 005 deptName_ Computer Center Budget Marketing Database Support Purchasing location Boston New York Boston Cleveland New York deptType IT Business Marketing IT Business | ID empName emplType deptCode titleCode John Full-time 002 T1 Adam Consultant 001 T3 Mary Part-time 004 T4 Peter Full-time 003 Scott Consultant 002 Susan Full-time 005 ITS Alex Part-time 004 T2 T2 7 1. Write CREATE TABLE statements Choose appropriate datatypes for the attribute. Include constraints of the relational model and consider other constraints based on the requirements of the case. 2. Insert 4-5 records in tables Title and Department, and 8-10 records in the table Employee. 3. After you have inserted records, add the attribute DateOfBirth to the table Employee and populate this attribute with the values for the existing records. In the following review tasks X, Y, etc. are placeholders; use values that make sense for your database and that will allow you to see meaningful results. 0. SELECT on a Single Table 1. Show the list of titles with salary higher than X. 2. Show the list of titles with salary between X and Y. 3. Show names of employees from departments X and Y. 4. Show names of employees that start with letter 'A'. 5. Show names of employees with title codes X, Y, Z, and A. 1. SELECT on a Single Table (cont.) 1. List names of employees whose names include letter 'A'. 2. List names of employees where the third letter is 'A'. 3. List names of employees that are longer than 10 symbols. 4. Calculate average salary

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!