Last answered:

03 Apr 2020

Posted on:

03 Apr 2020

0

SQL default error

Hii,  I ran the query "insert into companies (headquarters_phonenumber)
values(+447415086473);" without assigning a default value to the company-name. Like in your the lecture video where an error was encountered, mine executed without any error. And the corresponding " select * from companies;" query result showed "NULL" for the company_name. I am just curious as to why I did not get an error message and why the query executed successfully. Thanks
1 answers ( 0 marked as helpful)
Instructor
Posted on:

03 Apr 2020

0
Hi Nosakhare! Thanks for reaching out. Had you added a DEFAULT constraint to the companies table by the time of the execution of the given query? What does the DDL tab about this table say before executing this query? Looking forward to your answer.
Best,
Martin

Submit an answer