Question

In: Computer Science

What is wrong with the following INSERT commands: INSERT IN EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,...

  1. What is wrong with the following INSERT commands:

INSERT IN EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,

Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-285-8320','[email protected]');

INSERT INTO (EmployeeNumber, FirstName, LastName, Department, Position, Supervisor,

OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-2858320','[email protected]');

INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,

Supervisor, OfficePhone, EmailAddress) VALUES ('Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]');

INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,

Supervisor, OfficePhone, EmailAddress) VALUES ('Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]')

Solutions

Expert Solution

Solution :

1.

INSERT IN EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,

Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-285-8320','[email protected]');

This command is wrong as THERE is no IN keyword in sql it should be INTO.

Correct Sql command :

INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,

Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-285-8320','[email protected]');

2.

INSERT INTO (EmployeeNumber, FirstName, LastName, Department, Position, Supervisor,

OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-2858320','[email protected]');

This is also wrong as you are not defining the table name in this so that's why it should give error in it.

Correct INSERT Command :

INSERT INTO EMPLOYEE(EmployeeNumber, FirstName, LastName, Department, Position, Supervisor,

OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-2858320','[email protected]');

3.

INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,

Supervisor, OfficePhone, EmailAddress) VALUES ('Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]');

This is also worng as the first column is EmployeeNumber and you are not passing any value in the values so it will also give error.

Correct sql command.

INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,

Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]');

4.

INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,

Supervisor, OfficePhone, EmailAddress) VALUES ('Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]')

in that query there is same error as you are not giving any value for employee number.

correct sql command is :

INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,

Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]').


Related Solutions

SQL ONLY- Given Tables- Employee (EmployeeID, FirstName, LastName, Address) Department (DeptNo, DepartmentName, City) DepartmentEmployee(DeptNo, EmployeeID, Position)...
SQL ONLY- Given Tables- Employee (EmployeeID, FirstName, LastName, Address) Department (DeptNo, DepartmentName, City) DepartmentEmployee(DeptNo, EmployeeID, Position) Project (ProjectNo, ProjectName, DeptNo) Project Team ( ProjectNo, EmployeeID, Role) MAKE THE QUERY FOR- 1. List the name and position of all the employee who works in the (DeptNo = ‘22C’). 2. List the total number of employees in each department for those departments with more than 5 employees. 3. List the project number, project name and the number of employees who worked on...
describe what these mysql queries do 1.) select lastname, firstname, region, birthday from Members where birthday...
describe what these mysql queries do 1.) select lastname, firstname, region, birthday from Members where birthday in (select birthday from Members where email is not null) 2.) select Sales.Firstname As EmpFirst, Sales.Lastname as EmpLast, Sup.Firstname as SupFirst, Sup.Lastname as SupLast from Salespeople Sales inner join Salespeople Sup On Sales.Supervisor=Sup.SalesID 3.) select Region, Gender, Count(*) As Num from Members where Email is null group by region, gender 4.) select title from titles where not Genre = 'Jazz';
Write an AFTER Insert trigger for the following Employee table. Check Date of Birth and calculate...
Write an AFTER Insert trigger for the following Employee table. Check Date of Birth and calculate age. Update AGE field with calculated value in Employee_Info table Employee (Emp_ID int, DOB date) Employee_Info (Emp_ID int, Fname char, Lname char, Age int) Set variable Current_Date to CURDATE() Substract DOB from Current_Date to find Age
Write the following queries using the schema below Class (Number, Department, Term, Title) Student (Username, FirstName,...
Write the following queries using the schema below Class (Number, Department, Term, Title) Student (Username, FirstName, LastName, Year) Takes (Username, Department, Number, Term, Grade) [clarification] In Student, Year is an integer. A student can be a 2nd year student. In that case, Year value would be 2. For the Takes relation: ·         Grade is NA for current semester students ·         Username is foreign key to Student ·         (Department, Number, Term) is foreign key to Class a)       Write an SQL query that returns the Term...
5.8  What’s wrong? State what is wrong in each of the following scenarios. (a) A parameter...
5.8  What’s wrong? State what is wrong in each of the following scenarios. (a) A parameter describes a sample. (b) Bias and variability are two names for the same thing. (c) Large samples are always better than small samples. (d) A sampling distribution is something generated by a computer.
What is wrong with the following definition of the correlation coefficient?
What is wrong with the following definition of the correlation coefficient? The correlation coefficient measures the strength and direction of the linear relationship between two variables Choose the correct answer below  A. The correlation coefficient is a measure that describes the direction of the relationship, but the strength of the relationship cannot be determined from the  B. The relationship between the two variables does not have to be linear to use the correlation coefficient  C. The correlation coefficient is a measure that describes the strength...
The tbl_employee contains information about the employee and its department, and it contains the following fields...
The tbl_employee contains information about the employee and its department, and it contains the following fields (it is possible to also include other missing fields): employee_id, employee_gender ,employee_salary, employee_annual_sallary, department_name, department_location, department head. Make use of the database normalization skills learned to normalize a database to the third normalization form. Organize the columns and tables to reduce data redundancy and arrange attributes based on the relationships. Provide a screen shot of the database design before the normalization. Create a heading...
What does the duty to mitigate require of an employee whose position has been constructively terminated?...
What does the duty to mitigate require of an employee whose position has been constructively terminated? A. It requires the former employee to take reasonable steps to find comparable employment. B. The employee could be required to accept a lower position in the same company. C. It requires the former employee to take the first job available. D. The individual is expected to accept a lower-level job in another company to reduce his loss.
Discuss some of the various financial position found in most hotels. What does the employee do?...
Discuss some of the various financial position found in most hotels. What does the employee do? How does their work contribute to the hotels overall success? (400 words required this sucject is hospitality accounting Please write clear your own thought or search the internet. Thank you!) this is all the requestments
Trinidad Schwab is an employee at the Kyletown Fire Department. He received the following benefits from...
Trinidad Schwab is an employee at the Kyletown Fire Department. He received the following benefits from his employer during 2017: On-site housing, $400 per month Employer-provided cell phone, $100 per month Meals, $200 per month Required: What amount of these benefits are taxable for 2017?____ ✓ The employer gets to deduct the cost of the meals as a business expense and the employeesget a tax-free fringe benefit: free food. By looking at the above provisions, only meals are tax free...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT