Java Programming 2

Card Set Information

Java Programming 2
2014-01-27 10:44:47
Java programming

this set of cards deals with relational databases and SQL
Show Answers:

  1. What are some Advantages of relational databases?
    There is a clear separation between the data and the "how" of accessing and manipulating it
  2. What is a relational database?
    A database that presents the information in tables with rows and columns that can be linked to other tables based off of what relationships you chose to apply to them.
  3. What is MySQL?
    • SQL (Structured Query Language)
    • It is a database management system (developed by Oracle) use to add, access, and process data stored in a database.
  4. What is PHPMyAdmin?
    • It is a free software tool written in PHP, intended to handle the administration of MySQL over the web.
    • Frequently used operations can be performed via the user interface, while you still have the ability to directly execute any SQL statement.
  5. What is JDBC?
    Java Database Connectivity

    A Java API that enables Java programmers to execute SQL statements allowing the Java programs to interact with and SQL-compliant database.
  6. What is an ORM?
    Object-relational mapping

    A programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages, creating a "virtual object database" that can be used from within the programming language.
  7. What is the purpose of a database management system?
    It organizes your files to give you more control over your data
  8. What is normalization?
    The process of organizing the fields and tables of a relational database to minimize redundancy and dependency.
  9. What is a primary key?
    It is a field in a table that is unique and does not change.
  10. What is a foreign key?
    Is a field in one table that uniquely identifies a row of another table? It is a combination of columns that is used to establish and enforce a link in the data from two tables
  11. What is a one-to-one relationship?  Give an example.
    A relationship of two items in which one can only belong with the other.

    EX: a car model is made by one company
  12. What is a one-to-many relationship?  Give an example.
    A relationship where one item can have several child records in another table.

    EX: a customer can have many orders
  13. What is a many-to-many relationship?  Give an example.
    When one or more rows in a table are associated with one or more rows in another table

    EX: multiple customers can purchase the same or multiple products
  14. What is referential integrity?
    Ensures that relationships between tables remain consistent.

    EX: one table has a foreign key to another table; you may not add a record to the table that contains the foreign key unless there is a corresponding record in the linked table. Also cascading update and delete
  15. What is a transaction?
    A unit of work that is treated as "a whole". it has to either happen in full, or not at all. EX: money out of the bank
  16. What does commit mean?
    The response is sent for the client to see it / becomes live to everyone
  17. What does rollback mean?
    an object previously read, should no longer be used, and is no longer pare of the persistence context. It was erased and not committed.
  18. What is a dangling reference?
    They point to memory that is no longer valid and which will be reallocated when there is a new memory request, but the pointers will be used as though they still pointed to the original memory. In Database: book points to author that was deleted, no longer exists
  19. What is a bridge table?
    Is the creation of a new table using two primary keys from two separate tables
  20. What types of relationships require a bridge table?
    It requires a many to many relationship
  21. What is a validation table?
    A static table in the database that stores valid codes and descriptions

    EX: NATION table contains a 5 character abbreviation for each nation
  22. What does cascade mean?
    If you insert, update or delete an object, related objects are inserted, updated or deleted as well. If you do not use cascade you would have to save both objects independently. If you initially create objects and you do not cascade then you must save each object explicitly.
  23. What is a SQL Inner Join?
    selects all rows from both tables as long as there is a match between the columns in both tables.
  24. Explain a SQL Left Join
    returns all rows from the left table (table1), with the matching rows in the right table (table2). The result is NULL in the right side when there is no match.
  25. Explain a SQL right join
    The RIGHT JOIN keyword returns all rows from the right table (table2), with the matching rows in the left table (table1). The result is NULL in the left side when there is no match.
  26. Explain a Full Outer Join
    The FULL OUTER JOIN keyword returns all rows from the left table (table1) and from the right table (table2).The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins.
  27. What is a Union
    combines the result of two or more selection statements
  28. SQL what is a primary key
    uniquely identifies each record in a database table, must be UNIQUE
  29. SQL What is a foreign key constraint?
    • it is a foreign key in one table points to a primary key in another table
    • EX: order Id number