Lab - 10
1. Create table CITIES from table LOCATIONS, but only for location numbers less than 2000 (do NOT create this table from scratch). You will have exactly 10 rows here.
When you describe CITIES, the output is shown below:
SQL> DESC cities Name Null? Type ----------------------------------------- -------- ----------------- LOCATION_ID NUMBER(4) STREET_ADDRESS VARCHAR2(40) POSTAL_CODE VARCHAR2(12) CITY NOT NULL VARCHAR2(30) STATE_PROVINCE VARCHAR2(25) COUNTRY_ID CHAR(2)
create table CITIES AS (SELECT location_id, street_address, postal_code, city, state_province, country_id FROM LOCATIONS where location_id < 2000);
2. Create table TOWNS from table LOCATIONS, but only for location numbers less than 1500 (do NOT create this table from scratch). This table will have same structure as table CITIES.
You will have exactly 5 rows here.
3. Now you will empty your RECYCLE BIN with one powerful command. Then remove your table TOWNS, so that will remain in the recycle bin. Check that it is really there and what time was removed.
4. Restore your table TOWNS from recycle bin and describe it. Check what is in your recycle bin now.
5. Now remove table TOWNS so that does NOT remain in the recycle bin. Check that is really NOT there and then try to restore it. Explain what happened? 6. Create simple view called CAN_CITY_VU, based on table CITIES so that will contain only columns Street_Address, Postal_Code, City and State_Province for locations only in CANADA. Then display all data from this view.
7. Modify your simple view so that will have