UID Lab+12
UID Lab+12
1. Insert 3 rows into the MOVIES table, Below is the MOVIES table structure.
Movie_number number,
Movie_name varchar2(100),
Movie_type varchar2(40),
Movie_release_date date
2. Modify movie release date of movie number 101 from ’12-jan-2015’ to ’14-jan-2015’
3. Delete the row from MOVIES table where the movie name is RUSH HOUR.
Copy and paste the below SQL’s in SQL Developer and run
them, You will get errors and try to correct those errors.
1. INSERT INTO SALES VALUES '12-jan-2015',3456,101,12,3000,10,30,300,30,330)
);
COMMIT;
);
COMMIT;
);
COMMIT;
COMMIT;
COMMIT;
Answers for errors:
1) You will get an error “ ORA-00933: SQL command not properly ended” when you run below
SQL statement.
It is throwing an error because we missed ( after VALUES. Correct the above SQL
statement by adding ( after VALUES keyword. (This error might be stupid, but these are
the common mistakes we make.)
2) You will get an error “ ORA-00947: not enough values ” when you run below SQL statement.
It is throwing an error because we have 10 columns in the sales table and we are
inserting only 9 values. So to correct this we need to add the 10 th value (This error might
be stupid, but these are the common mistakes we make.)
3) You will get an error “ ORA-00917: missing comma” when you run below SQL statement.
4) You will get an error “ ORA-12899: value too large for column
TDS_INT"."CUSTOMER"."FIRST_NAME" (actual: 52, maximum: 50) ” when you run below SQL
statement.
The error is clearly stating that FIRST_NAME length is 50 and you are trying to insert 52
characters. So the solution is either to increase the length of the column FIRST_NAME or
reduce the value you are inserting to less than 50.
ALTER TABLE CUSTOMER MODIFY (FIRST_NAME VARCHAR2(60));
Or