2-4 Lab Updating Tables Assignment

docx

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

220

Subject

Management

Date

Feb 20, 2024

Type

docx

Pages

5

Uploaded by CaptainPencil6470

Report
Sarah Byerly DAD 220 Professor Venckus 07 September 2023 1. Connect to the database you created and named in Module One (for example, Jetson). Type after the prompt mysql> A. use (table you named); I. Example: mysql> use Jetson; Explanation: Connected to my database that is my last name. 2. Create the Employee table using the SQL statement shown here. Press Return after each line. CREATE TABLE Employee ( Employee_ID SMALLINT, First_Name VARCHAR(40), Last_Name VARCHAR(60), Department_ID SMALLINT, Classification VARCHAR(10), STATUS VARCHAR(10), Salary DECIMAL(7,2)); Explanation: Created Employee table.
Sarah Byerly DAD 220 Professor Venckus 07 September 2023 3. Create the Branches table. Fill in the missing characters or punctuation in the incomplete statement shown below to complete this action. CREATE Branches ( Department_ID SMALLINT, Department_Name ) CREATE TABLE Branches ( Department_ID SMALLINT, Department_Name VARCHAR(50)); 4. After creating the tables, use the correct commands to describe them. You’ll only be given commands to describe one of the tables and must complete the same action for the second one on your own. Validate your work with a screenshot. A. describe Employee; B. Write the correct command to describe the Branches table
Sarah Byerly DAD 220 Professor Venckus 07 September 2023 DESCRIBE Branches; 5. Insert the following records into the Employee table (with support). Each line going from left to right is a record. Each line going from top to bottom is a column. Validate your work with a screenshot. A. INSERT INTO Employee VALUES (100, 'John', 'Smith', 1, 'Exempt', 'Full-Time', 90000), (101,'Mary','Jones',2,'Non-Exempt','Part-Time',35000), (102,'Mary','Williams',3,'Exempt','Full-Time',80000); B. Type the command select* from Employee; and take a screenshot of it to validate this step. Explanation: Inserted new records into Employee table using supporting commands. 6. Insert the following records into the Employee table for Gwen Johnson and Michael Jones by writing the correct SQL commands on your own (without support). A. Gwen Johnson: Employee ID = 103, DEPARTMENT_ID = 4, Classification = NULL, Status = Full-Time, SALARY = 40000 B. Michael Jones: Employee ID = 104, DEPARTMENT_ID = 4, Classification = Non- Exempt, Status = Full-Time, SALARY = 90000 C. Insert your name into the table to verify and prove your work.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Sarah Byerly DAD 220 Professor Venckus 07 September 2023 1. (Your First and Last Name, or a nickname): Employee ID = 105, DEPARTMENT_ID = 1, Classification = Non-Exempt, Statues = Full-time, SALARY = (Choose a value between 50000 and 99000) D. Type the command select* from Employee; and take a screenshot of it to validate this step. INSERT INTO Employee VALUES (103, 'Gwen', 'Johnson', 4, NULL, 'Full-Time', 40000), (104,'Michael','Jones',4,'Non-Exempt','Full-Time',90000), (105,'Sarah','Byerly',1,'Non-Exempt','Full-Time',90000); Insert records for a musician, athlete, or other famous character of your choice. Make sure to enter information for all of the fields listed in this table. The Department_ID must be a number between 1 and 4. Write the correct command to prove that you’ve successfully completed this step, and validate it with a screenshot. INSERT INTO Employee VALUES (106, 'Kyle', 'Larson', 3, Exempt, 'Full-Time', 85000); Select the fields of last name, first name, and department id from the table. Validate your work with a screenshot. Select First_Name, Last_Name, Employee_ID, Department_ID from Employee;
Sarah Byerly DAD 220 Professor Venckus 07 September 2023