Create world database using mysql

Assignment Help Data Structure & Algorithms
Reference no: EM1375654

Project:

1. install MySQL DBMS (and DB/language connector) software on your machine,

2. create World database using MySQL (using command files - NOT a Setup PROGRAM)

3. write a Java or C# or ... program to access the DB.

Batch processing is used:

• queries (data retrieval & update requests) are in a transaction file
• output sent to a log file.

Steps:

A. Download & install MySQL on your machine.

B. Download & install appropriate connector for MySQL which allows Java or C# to interact with a MySQL database.

C. SETUP [NOT A PROGRAM]: Use MySQL and the script files provided (which need a slight alteration) to create the WorldDB consisting of Country and CountryLanguage tables (though NOT the City table).

D. UserApp PROGRAM with 1 (or more) additional class (in separate file)

1. program does batch processing (using "INPUT STREAM Processing Algorithm" [that is, loop til EOF { read 1 transaction, then deal with it completely } ].

2. Trans file & Log file handling are done in main program or a separate UI class

3. 4 local methods (in UserApp), SelectHandler, InsertHandler, DeleteHandler, UpdateHandler - each takes the transaction line (when it' called upon by Main) and builds (somehow) the appropriate sqlString.

4. 2 methods in a SEPARATE CLASS, DBAccess (in a physically separate file), do actual SQL DB interaction:

a. RetrieveData for handling SELECTs
b. ChangeData for handling INSERTs & DELETEs & UPDATEs

For each transaction:

1. Echo original transaction request (from transaction file)

2. For INSERTs & DELETEs (but not SELECTs or UPDATEs),

show actual SQL statement which your program BUILT, which it sent to the DBS for processing

3. Show results from executing the "query" - i.e.,

a. a "table" for a SELECT
b. a reassurance message for changes: OK, INSERT done
OK, DELETE done
OK, UPDATE done
4. Write out a blank line.

Each transaction on a new line - 1st column is transCode: S, I, D, U (always caps).

S(elect) transactions (RETRIEVE data from DB)

- transaction data is an actual SQL statement to be used "as is".
    [This is not a common/proper programming approach, but time is short so...].

- Allow for 0 or 1 or Many ROWS to be returned to the program from the DB.

- rdr.FieldCount gives the number of COLUMNS there'll be for a result set

- "table" printed to TheLog file does NOT NEED TO:

- be in a box (e.g., like a typical interactive result in the command window)

- have column headings (but if it does,
    DON'T use what's in my demo program &
    DON'T hardcode the header labels (as my demo program does)

- be perfectly aligned since this SINGLE GENERIC METHOD doesn't know 
    what data type rdr[0] or rdr[1] or the other columns are.

U(pdate) transactions (CHANGE data in DB)
- transaction data is an actual SQL statement to be used "as is"

D(elete) transactions (CHANGE data in DB)
- transaction data is NOT an SQL statement
- your program has to construct it from the "parameters" supplied
- Basic format for a simple DELETE SQL statement:
    DELETE FROM Country WHERE Name = 'Disneyland'
  Transaction data (i.e., the parameters) would look like:
     D Country|Name|'Disneyland'

I(nsert) transactions (CHANGE data in DB)
   - transaction data is NOT an SQL statement
           - your program has to construct it from the "parameters" supplied using various string-handling methods (e.g., Split, +, etc.)
- 2 basic formats for simple SQL INSERT statements:

1) all-columns INSERT (so column names NOT specified in SQL statement):

INSERT INTO CountryLanguage VALUES ('USA','C#','F',0.01)
Transaction data (parameters) looks like:
I CountryLanguage|'USA','C#','F',0.01

2) some-columns INSERT (so column names MUST BE specified in SQL stmt):

INSERT INTO Country(Code, Name) VALUES ('HEX','Hexland')

Transaction data (parameters) looks like:

I Country|(Code, Name)|'HEX','Hexland'

Reference no: EM1375654

Questions Cloud

Predict the change of the exchange rate : The Economist reports that the interest rate per year is 5.93 percent in the United States and 70.00 percent in the Turkey,in the October 23, 1999 issue.
Events related to wage inequality : Examine how wage inequality is measured and if it present in your selected industry. My Selected industry is the automotive industry.
Trade in a capital abundant country : Use the specific factors model, describe why you might expect to see certain capital owners and labor groups discussing against developing trade in a capital abundant country.
Question related to international trade policy : Assume that a nation declares that it is moving toward free trade through decreasing its tariffs on intermediate inputs while maintaining its tariffs on final goods.
Create world database using mysql : create World database using MySQL and write a Java or C# or program to access the DB
Determining the price for an acquisition : When determining the value to be paid for an merger, one of the factors considered is often,
List the costs of high inflation : In the early 1930s there were a number of bank failures in U.S. What did this do to money supply? The New York Federal Reserve Bank advocated open market buys and list the costs of high inflation.
Question about international organizations : International managements whether the UN, NATO, World Bank, WTO, IMF and others are no more than playgrounds of major powers who use these multilateral institutions to advance their interests often at expense of less powerful nations.
Multiple choice - international policies : An article written immediately after re election of George  W. Bush referred to his environmental rule system where power  plants purchase and sell the right to pollute in form of emission  credits,

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Finding page faults for lru replacement algorithms

How many page faults would happen for the given replacement algorithms, assuming one, two, three, and four frames?

  Find terminal nodes in tree nil if pointer is represented

The node's right child. If the nil pointer is represented by 00 and the tree's root pointer contains 53, how many terminal nodes are in tree?

  Addition and subtraction of numbers in binary

Addition and Subtraction of numbers in binary and round to the nearest decimal number with three significant decimal digits

  Pseudocode for divide-and-conquer algorithm

Write a pseudocode for a divide-and-conquer algorithm for finding the position of the largest element in an array of n numbers.

  Algorithm for finding smallest element in unsorted array

Consider the following algorithm for finding the smallest element in an unsorted array: RANDOMMIN(A[1 .. n]). What is the exact expected number of executions of line ( )?

  Factors-principles considering indecency regulation issues

What factors and principles should the federal government take into account when considering indecency regulation issues?

  Write recursive version of array-based linear search

Write an algorithm but not code. Write a recursive version of the array-based linear search algorithm. Write a recursive version of the linked-list-based linear search algorithm."""

  Design algorithm to receive two integer items from terminal

Design an algorithm that will receive two integer items from a terminal operator, and display to the screen their sum, difference, product and quotient.

  Use of primitives helps remove ambiguities in algorithm

Explain the distinction between an ambiguity in a proposed algorithm and an ambiguity in the representation of an algorithm. Describe how the use of primitives helps remove ambiguities in an algorithm's representation.

  Create greedy algorithm to find market to buy apples

Assume we drive pickup truck from city A to city B. Along high way, we will go through n apple markets, labeled with 1, 2, ..., n, where you can buy or sell apples. which means you buy and sell apples at the same market i.

  Creating financial tracking program

Acme Inc. is making next generation financial tracking program, and Alice has been provided the task of writing encryption component.

  Create algorithm to prepare daily hotel charge report

Create the algorithm to prepare the daily hotel charge report. Input consists of series of records which contain a room number, customer name, cost of the room, and cost of meals charged to the room.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd