https://365datascience.com/dwqa-answer/answer-for-remove-column-record-does-not-work-with-change-statement/ -
Hi Jo!
Thanks for reaching out.
This is a very interesting question!
Basically, this modification doesn’t turn the dept_no into a Unique Key. Instead, it adds NULL as a default value. Moreover, it doesn’t affect the records that have been inserted so far in the table.
That’s why if you executed again the following query, for instance:
INSERT INTO departments_dup
(
dept_no,
dept_name
)
SELECT
*
FROM
departments;
you’ll manage to insert all for records with all department numbers available. However, if you only try to insert a record containing a value for the department name, then the value in the dept_no field will be null.
INSERT INTO departments_dup (dept_name) VALUES (‘Finance’);
Hope this helps.
Best,
Martin
#365datascience #DataScience #data #science #365datascience #BigData #tutorial #infographic #career #salary #education #howto #scientist #engineer #course #engineer #MachineLearning #machine #learning #certificate #udemy
No comments:
Post a Comment