COMPSCI345 Midterm

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/39

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

40 Terms

1
New cards

database

a collection of data with a specific structure

2
New cards

DBMS

Database Management System

3
New cards

Create Operation

CREATE

4
New cards

Read Operation

SELECT

5
New cards

Update Operation

INSERT, UPDATE

6
New cards

Delete Operation

DELETE

7
New cards

Relational Database

organized as records in tables and relationships between them, with each row being unique

8
New cards

CAP Theorem

a system must choose between Consistency and Availability

9
New cards

Consistency

read requests get the most current view (Relational DBs)

10
New cards

Availability

system provides a non-error response to requests (non-relational DBs)

11
New cards

Network partition tolerance

degree to which a system operation continues despite data interruption

12
New cards

Select query (SQL)

SELECT [attrs] FROM [tbl];

13
New cards

Create table (SQL)

CREATE TABLE [tblname] ( [attrname] [attrtype] [constraints] );

14
New cards

Insert (SQL)

INSERT INTO [tbl] ([attrs]) VALUES [vals];

15
New cards

WHERE clause (SQL)

SELECT … WHERE [constraints];

16
New cards

LIKE operator (SQL)

SELECT … WHERE [attr] LIKE [string/wildcard];

17
New cards

M:N (ER Model)

requires “bridge” table because RDBs only allow implementation of 1:1 and 1:M

18
New cards

Weak Entity Implementation (ER Model)

[Customer PK cid], [Loan PK cid,lid]

19
New cards

Weak Entity Implementation (SQL)

CREATE TABLE [tblname] ( … FOREIGN KEY [attrname] REFERENCES [tbl] [attrname] );

20
New cards

Primary Key Constraint

specifies uniqueness (each row has 1 unique non-null PK)

21
New cards

Foreign Key Constraint

implements a relationship between tables, commonly 1:M (M side FK references 1 side PK)

22
New cards

UNIQUE constraints

CREATE TABLE [tblname] ( … UNIQUE [attrs] );

23
New cards

CHECK constraints

CREATE TABLE [tblname] ( ... CHECK [constraint] );

24
New cards

CASCADE constraints

CREATE TABLE [tblname] ( … [ON DELETE/UPDATE] [CASCADE/SET NULL] );

25
New cards

COUNT ([attr])

gives count of column rows (or other)

26
New cards

SUM ([attr])

gives sum of column values (or other)

27
New cards

AVG ([attr])

gives average of column values (or other)

28
New cards

GROUP BY [attr];

groups output by attribute

29
New cards

HAVING [aggregation] [constraints];

applies constraints to groups in GROUP BY clause

30
New cards

Join query (SQL)

SELECT [attrs] FROM [tbls] WHERE [attr] = [attr];

31
New cards

Left Outer Join

SELECT [attrs] FROM [tblA] LEFT OUTER JOIN [tblB] ON tblA.[attr] = tblB.[attr];

32
New cards

Right Outer Join

SELECT [attrs] FROM [tblA] RIGHT OUTER JOIN [tblB] ON tblA.[attr] = tblB.[attr];

33
New cards

Full Outer Join

SELECT [attrs] FROM [tblA] FULL OUTER JOIN [tblB] ON tblA.[attr] = tblB.[attr];

34
New cards

Subquery

SELECT … WHERE [varname] IN ( [subquery] );

35
New cards

IN

checks for membership

36
New cards

ANY

used with comparison operator, any record that meets condition

37
New cards

ALL

used with comparison operator, all records must meet condition

38
New cards

EXISTS

checks for existence

39
New cards

Uncorrelated query

subquery does not reference outer query’s tables

40
New cards

Correlated query

subquery references outer query’s tables