SQL Tutorial

17 / 68

Assessment Question - SQL Insert

Follow the below steps to drop and create a table 'emp'. Then, write and execute an insert statement per as given details.

INSTRUCTIONS
drop table emp;

create table emp(
   empid int not null auto_increment,
   empfname varchar(100) not null,
   emplname varchar(100) not null,
   depid int not null,
   doj datetime,
   empsal int not null,
   mgrempid int,
   primary key ( empid )
);

Now, write an insert statement to create a row with below data:

empid - System generated
empfname - Sam
emplname - Fox
depid - 1
doj - July 12 2018 2 PM
empsal - 2200
mgrempid - NULL

Now, execute the insert statement. When done, submit your answer.



Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...