There are two tables, student and otherStudent. The table information is as follows: SQLgt; descstudentnametypenullabledefacomments -------------
There are two tables, student and otherStudent. The table information is as follows: SQLgt; desc studentName Type Nullable Default Comments -------------
There are two tables, student and otherStudent. The table information is as follows:
SQL> desc student
Name Type Nullable Default Comments
---------------------------------------
NUM NUMBER
NAME VARCHAR2 (20)
AGE NUMBER Y
SQL> desc otherStudent
Name Type Nullable Default Comments
---------------------------------------
NUM VARCHAR2 (50)
NAME VARCHAR2 (50)
Perform the following experiments:
Lab 1
Now student has data. I want to insert the data into otherStudent.
Insert into otherStudent (num, name) select num, name from student
The inserted fields of the two tables can still be inserted if they have the same type or length. This means that as long as the inserted Table can receive the inserted fields, the type or length will not affect them.
Lab 2
OtherStudent has data. You can insert the data from this table to this table.
Insert into otherStudent select * from otherStudent
Lab 3
Statement insert into otherStudent select * from student. The error "too many values" is reported ".
Statement insert into student select * from student otherStudent. The error "not enough value" is reported ".