LAB 1 Flashcards
What is a Database Operation?
The operations that manage and manipulate data.
What does CREATE do?
Creates a new table
CREATE syntax
CREATE TABLE <table name>
(
<element> <element> <null/not null>,
FOREIGN KEY ( <key> ) REFERENCE ( <key> ),
PRIMARY KEY (<key>)
);
</key></key></key></element></element>
What does INSERT do?
Adds new records (rows) into one or more tables to populate the database.
INSERT syntax
INSERT INTO <table name>
VALUES ( <element>, <''>,);</element>
INSERT INTO <table name> (<element>)
VALUES ();</element>
What is the syntax to insert a sql file?
@../<file>.sql</file>
What does UPDATE do?
Allows you to modify existing data.
UPDATE syntax
UPDATE <table name>
SET <element> = '<element>'
WHERE <element> = 'element value';</element></element></element>
What does DELETE do?
Remove records
What does SELECT do?
Retrieves specific information from tables.
What does ALTER TABLE do?
Allows you to add or remove columns from a table.
ALTER syntax
ALTER TABLE <table name>
ADD ( <element> <type> <value> );</value></type></element>
What does CREATE SEQUENCE do?
Creates a new sequence number generator,
CREATE SEQUENCE syntax
CREATE SEQUENCE <sequence>
START WITH <sequence>
INCREMENT BY <multiplier></multiplier></sequence></sequence>
How to create a new sequence table? syntax
CREATE TABLE SequenceTest
(
<element> <type> NOT NULL,
PRIMARY KEY<element>
);
</element></type></element>