New Job 1 Flashcards

1
Q

What is the difference between Java and Javascript

A

Key differences between Java and JavaScript:

  • Java is an OOP programming language while Java Script is an OOP scripting language.
  • Java creates applications that run in a virtual machine or browser while JavaScript code is run on a browser only.
  • Java code needs to be compiled while JavaScript code are all in text.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

package inputdemo
import java.util.Scanner

what is java.util.Scanner?

A

a class

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

objects are created from templates known as…

A

classes

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

Scanner input = new Scanner(System.in); - name each part

A
Scanner is the class
input is the name of the Scanner object we're creating
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In relational databases, rows are also called….

A

tuples or records

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

In relational databased, columns are also called…

A

attributes

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

In RDs, each row needs a…

A

unique key

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

A foreign key is

A

A column for the unique key of the linked row, which is used to link rows in a table to a row in another table

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

Primary key

A

Specific choice of a minimal set of attributes (columns) that uniquely specify a tuple (row) in a relation (table)

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

Surrogate key

A

an attribute created to function as a key (ie. case_id). Usually the primary key

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

Natural key

A

Real-world observations (like time and location of birth), usually the alternate keys

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

Candidate key

A

Minimal superkey for that relation; that is, a set of attributes such that:

  1. The relation does not have two distinct tuples (i.e. rows or records in common database language) with the same values for these attributes (which means that the set of attributes is a superkey)
  2. There is no proper subset of these attributes for which (1) holds (which means that the set is minimal).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Prime attributes

A

Attributes that are included in the candidate key

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

Superkey

A

a set of attributes of a relation variable for which it holds that in all relations assigned to that variable, there are no two distinct tuples (rows) that have the same values for the attributes in this set. The set of all attributes is a trivial key (because no two rows can be exactly the same)

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

When a PK migrates to another table, it becomes a….

A

foreign key

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

Other models besides the relational model include…

A

the hierarchical database model and the network model

17
Q

A table is also knowns as a…

A

Relation or Base relvar

18
Q

A result set is also known as a…

A

View or Derived relvar

19
Q

Relations can be modified using the….

A

insert, delete, and update operators

20
Q

What does ACID stand for?

A

Atomicity, Consistency, Isolation, Durability

21
Q

What is ACID?

A

It’s a set of properties of database transactions intended to guarantee validity even in the event of errors, power failures, etc

22
Q

What is the Atomicity property?

A

It requires that each transaction be “all or nothing”: if one part of the transaction fails, then the entire transaction fails, and the database state is left unchanged

23
Q

What is the consistency property?

A

The consistency property ensures that any transaction will bring the database from one valid state to another

24
Q

What is they isolation property?

A

The isolation property ensures that the concurrent execution of transactions results in a system state that would be obtained if transactions were executed sequentially, i.e., one after the other.

25
Q

What is the durability property?

A

The durability property ensures that once a transaction has been committed, it will remain so, even in the event of power loss, crashes, or errors. In a relational database, for instance, once a group of SQL statements execute, the results need to be stored permanently (even if the database crashes immediately thereafter)

26
Q

What are base relations?

A

Relations that store data

27
Q

What are derived relations?

A

Relations that are computed by applying relational operations to other relations, they do not store data. They can be used as an abstraction layer

28
Q

What is an abstraction layer?

A

In computing, an abstraction layer or abstraction level is a way of hiding the implementation details of a particular set of functionality, allowing the separation of concerns to facilitate interoperability and platform independence

29
Q

What is an integer?

A

1, 2, -20, 0

30
Q

Natural number

A

0, 1, 2 (not negative)

31
Q

Real number

A

.01, 0., -.01, 5. In SQL, can’t be more precise than 64 values

32
Q

Float in SQL

A

Specify precision. So FLOAT(8) wouldn’t accept 9-number numbers

33
Q

What is a stored procedure?

A

is a subroutine available to applications that access a relational database management system (RDBMS). Such procedures are stored in the database data dictionary.

34
Q

What are 2 examples of a stored procedure?

A

Data validations, access control mechanisms

35
Q

How are stored procedures invoked?

A

CALL or EXECUTE

36
Q

Cardinal vs. Ordinal

A

Cardinal tells you how much of something there are, ordinal tells you where the number is in the group. So For set {1, 3, 5, 7}, the cardinality of the set is 4, and the ordinality of 3 is 2.

37
Q

What is Pascal Casing?

A

ThisIsPascalCasing, it’s convention for naming classes

38
Q

What can the contents of a class include?

A

Fields, constructors, methods, interfaces, methods, and other classes