SQL with Jupyter Notebook Tutorial

17 / 61

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

Execute:

%%sql

drop table if exists emp_<<your lab username>> ;

create table emp_<<your lab username>>(
   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...