ch6 Flashcards
(13 cards)
define portion of database that a particular owner owns. dependent on a catalog
CREATE SCEHMA
defines a new table and columns. needs a schema to put it in
CREATE TABLE
defines logical table from other views
CREATE VIEW
delete a table
DROP TABLE Tablename
modify columns of existing table
ALTER TABLE
CREATE TABLE syntax
CREATE TABLE
(cols data_type [NOT NULL]
CONSTRAINT Table_PK PRIMARY KEY (col_name)
insert row into db
INSERT INTO (cols) TableName VALUES (data, data…)
delete database contents
DELETE FROM TableName WHERE condition
modify database contents
UPDATE TableName SET condition WHERE condition
make an index
CREATE INDEX IndexName ON TableName (ColName)
SELECT syntax
SELECT (cols) FROM TableName WHERE condition
select only unique rows
use SELECT DISTINCT
alias in oracle
use AS, used to rename cols into better names