final exam SR Flashcards

1
Q

What are the four types of queries we can perform on data?

A

SELECT, INSERT, UPDATE, DELETE

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

How do databases help decrease our workload as programmers? In other words, what can databases do to make it so we have to write less code?

A

Databases allow us to filter, sort, and group data with far less code

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

How are databases better than using text files?

A

Databases allow for random access of data

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

Which line is it important we always have in our queries, especially with DELETE and
UPDATE queries?

A

We should always have a WHERE clause

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

Explain conceptually (not programmatically) how two tables can be stitched together to
create more complex result sets.

A

We can use the primary key / foreign key relationship between two tables to specify how the tables interrelate

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

What happens if we do not specify how two tables relate to each other?

A

The result is a cartesian product

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

How does Maven help us make our code portable to other programmers?

A

Maven gets the dependencies for us meaning anyone who uses our project, will have the correct items to run the program

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

What are the three things we need to tell Maven about a dependency? What are the values for these items in the case of the SQLite JDBC?

A

Group ID - org.xerial
artifact ID - sqlite-jdbc
Version - 3.39.4.0

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

What is our groupID when creating Maven projects?

A

edu.psu.bd.cs.<username></username>

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

Why is the JDBC important?

A

The JDBC allows java to talk to the database

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

Why do we have to close ResultSet objects?

A

Closing the ResultSet releases a lock on the data

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

Besides the connection what do we need to create in order to run a query against the
database?

A

Prepared statement()

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

What is Spring Framework?

A

Spring Framework is a tool that helps do the “heavy lifting” when we want to create a web application

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

Why do we like using Maven when working with Spring?

A

Spring has numerous dependencies and having a tool to manage these dependencies means less work for us as programmers

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

What benefits does Spring provide when trying to create methods that can be run over the internet?

A
  1. Spring creates a Tomcat sever to run our application
  2. Spring handles I/O conversion to and from bytes
  3. Spring provides a mechanism to connect methods with URL’s and HTTP Verbs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What annotation do we need to use to make a class with methods that can be called over the web?

A

@RestController

17
Q

What annotation do we need to use to indicate how method that can be called over the internet?

A

@GetMappins