Managing Tables

Creating new tables with INTO

SELECT * 
INTO emp3
FROM orders
WHERE employee_id = 3;

SELECT * FROM emp3;

select employee_id, ship_name from emp3 limit 5;

 employee_id |       ship_name        
-------------+------------------------
           3 | Victuailles en stock
           3 | Hanari Carnes
           3 | Wellington Importadora
           3 | Wartian Herkku
           3 | QUICK-Stop

Create table with NOT DATA

Just copying the table structure

Tables are Fraud

  • When you UPDATE value in database, it doesnt update the original row

  • When you DELETE a row in table, it doesnt show you the new row, but it still remains in db

Last updated

Was this helpful?