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>
How to insert a sequence into a table?
INSERT INTO <sequence>
VALUES(<sequence>.<element>);</element></sequence></sequence>
What does SYSDATE do?
Returns the current date and time set for the OS.
What does BETWEEN do?
Filters your query to return results that fit in a specified range.
What does IS NULL do?
Return rows with a null value.
What does IS NOT NULL do?
Return rows without a null value.
What does ORDER BY do?
Sets the order of the returned results in ascending ordee by default
What does DESC do?
Return the results in descending order.
What does ASC do?
Ascending order.
What is a Join?
A clause used to combine rows from two or more tables.