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

  Explain the fifo structure of the queue

Explain the FIFO structure of the queue Explain how you would implement the queue data structure in its simplest form. Illustrate your answer fully with the necessary sample code

  Design algorithm to read a file of employee records

Design an algorithm and souce code C++ that will read a file of employee records and produce a weekly report of gross earnings for those employees.

  Write algorithm in pseudo code for bank account

Write an algorithm in pseudo code to settle following question: A bank account starts out with $10,000. Interest is compounded monthly at 6% per year(0.5% per month).

  Computing total number of keys needed in symmetric cipher

Determine the total number of keys that are needed for organization if symmetric cipher is used.

  Explaining adaptive playout delay algorithm

Consider adaptive playout delay algorithm. Demonstrate through simple example which adjusting playout delay at beginning of each talk spurt results in compressing

  Contents of registers for independent memory-reference

Find out the contents of registers PC, AR, DR, AC, and IR for two independent memory-reference instructions below. Each instruction starts with given Initial values.

  Create list of major steps to follow to get input

Create a list of major steps to follow to get input, process, and output desired information (software requirements). Refine the list to include individual refined steps (algorithm).

  Algorithm to read arbitrary number of data records

Write the algorithm to read arbitrary number of data records, each comprising name, age, and code.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Algorithm-decide whether language recognized by dfa is empty

Give an algorithm to decide whether the language recognized by a DFA is empty. Given two DFAs M1 and M2, give an algorithm to decide whether L(M1)subset or equal to L(M2).

  Ambiguity in proposed algorithm-in representation algorithm

Describe distinction between the ambiguity in proposed algorithm and ambiguity in representation of the algorithm.

  Converting arithmetic expression in reverse polish notation

Convert the following numerical arithmetic expression into reverse Polish notation and show the stack operations for evaluating the numerical result.

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