Lecture 19 Flashcards

1
Q

Query to create a schema

A

CREATE SCHEMA creates a schema.
CREATE SCHEMA COMPANY AUTHORIZATION ‘John_Smith’ ;

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

The main command for data definition is

A

CREATE

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

SQL uses the terms ….. for the formal relational model terms

A

table, row and column

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

Query to create a relation

A

CREATE TABLE ; - they are called base tables

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

numeric data types

A

INTEGER, SMALLINT, REAL DOUBLE PRECISION, FLOAT, DECIMAL(P, D)

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

Boolean

A

TRUE FALSE UNKOWN

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

character-string

A

CHAR(N), VARCHAR(N)

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

bit-strings

A

BIT(N), VARBIT(N)

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

large object types?

A

blob - binary large object, clob - character large object

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

When a query returns a large object…

A

a pointer is returned rather than the large object itself

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

how to define domain

A

CREATE DOMAIN AIRPORT-CODE CHAR(3);
CREATE DOMAIN FLIGHTNUMBER CHAR(5);

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

what query does not allow null

A

NOT NULL

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

secification of a default value

A

DEFAULT<value></value>

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

how to check a specific constraint

A

CHECK
EX: INT NOT NULL CHECK (Dnumber > 0 AND Dnumber < 21)

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

How to define primary ot foreign key

A

(FOREIGN KEY) PRIMARY KEY
INT PRIMARY KEY or PRIMARY KEY(Dnumber)

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

What to use to make delete data from other tables where it is foreign key

A

FOREIGN KEY(Dno) REFERENCES DEPARTMENT(Dnumber) ON DELETE
SET DEFAULT ON UPDATE CASCADE;