LAB 1 Flashcards

1
Q

What is a Database Operation?

A

The operations that manage and manipulate data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does CREATE do?

A

Creates a new table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

CREATE syntax

A

CREATE TABLE <table name>
(

<element> <element> <null/not null>,
FOREIGN KEY ( <key> ) REFERENCE ( <key> ),
PRIMARY KEY (<key>)
);
</key></key></key></element></element>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does INSERT do?

A

Adds new records (rows) into one or more tables to populate the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

INSERT syntax

A

INSERT INTO <table name>
VALUES ( <element>, <''>,);</element>

INSERT INTO <table name> (<element>)
VALUES ();</element>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the syntax to insert a sql file?

A

@../<file>.sql</file>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does UPDATE do?

A

Allows you to modify existing data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

UPDATE syntax

A

UPDATE <table name>
SET <element> = '<element>'
WHERE <element> = 'element value';</element></element></element>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does DELETE do?

A

Remove records

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does SELECT do?

A

Retrieves specific information from tables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does ALTER TABLE do?

A

Allows you to add or remove columns from a table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

ALTER syntax

A

ALTER TABLE <table name>
ADD ( <element> <type> <value> );</value></type></element>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does CREATE SEQUENCE do?

A

Creates a new sequence number generator,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

CREATE SEQUENCE syntax

A

CREATE SEQUENCE <sequence>
START WITH <sequence>
INCREMENT BY <multiplier></multiplier></sequence></sequence>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to create a new sequence table? syntax

A

CREATE TABLE SequenceTest
(

<element> <type> NOT NULL,
PRIMARY KEY<element>
);
</element></type></element>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to insert a sequence into a table?

A

INSERT INTO <sequence>
VALUES(<sequence>.<element>);</element></sequence></sequence>

17
Q

What does SYSDATE do?

A

Returns the current date and time set for the OS.

18
Q

What does BETWEEN do?

A

Filters your query to return results that fit in a specified range.

19
Q

What does IS NULL do?

A

Return rows with a null value.

20
Q

What does IS NOT NULL do?

A

Return rows without a null value.

21
Q

What does ORDER BY do?

A

Sets the order of the returned results in ascending ordee by default

22
Q

What does DESC do?

A

Return the results in descending order.

23
Q

What does ASC do?

A

Ascending order.

24
Q

What is a Join?

A

A clause used to combine rows from two or more tables.

25
Q

What are the types of Joins?

A

Inner, left, right and full.

26
Q

What does INNER JOIN do?

A

Selects records that have matching values in both sides.

27
Q

What does LEFT JOIN do?

A

Selects records from the left table that match those on the right.

28
Q

What does RIGHT JOIN do?

A

Selects records from the right table that match the ones on the left.

29
Q

What does FULL JOIN do?

A

Selects records that have a match in the left or right table.

30
Q

What does OUTER JOIN do?

A

Display all results.