The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

SQL default error

SQL default error

0
Votes
1
Answer

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 Answer

365 Team
0
Votes

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

Hi Martin, Thank you for your reply, I had actually added a default constraint to the company_name column. which explains everything now. thank you 🙂

6 months

You are welcome!

6 months
×
LAST CHANCE
Ready to Learn Data Science?
50% OFF