In this project, you will create a database to contain tables of batting_x000D_ statistics for major league baseball teams. You will then create a table_x000D_ named teamstats in the baseball_stats database and add records_x000D_ to the new table from a ï¬le named team_stats.txt in your Projects
_x000D_ 1. Log in to MySQL Monitor with your root account or with the_x000D_ _x000D_ user name and password supplied by your ISP or instructor._x000D_ 2. Enter the following command to create a database named_x000D_ baseball_stats:_x000D_ mysql> CREATE DATABASE baseball_stats;[ENTER ]_x000D_ _x000D_ 3. After you see the “Query OK†message, enter the following_x000D_ command to select the baseball_stats database:_x000D_ mysql> USE baseball_stats;[ENTER ]_x000D_
4. After you see the “Database changed†message, type_x000D_ the following command to ensure that you selected the_x000D_ baseball_stats database:_x000D_ mysql> SELECT DATABASE();[ENTER ]_x000D_ _x000D_ 5. Enter the following command to create the teamstats table._x000D_ The Team ï¬eld uses the VARCHAR data type. Eleven of the col- 439_x000D_ umns use INT data types, and the remaining two ï¬elds use_x000D_ FLOAT data types. Each of the statistical ï¬eld names uses com-_x000D_ mon baseball abbreviations, such as G for games, AB for at-_x000D_ bats, R for runs, and HR for home runs._x000D_ mysql> CREATE TABLE teamstats (Team VARCHAR(50),_x000D_ FirstYear INT,[ENTER ]_x000D_ -> G INT, W INT, L INT, Pennants INT, WS INT,[ENTER ]_x000D_ -> R INT, AB INT, H INT, HR INT, AVG FLOAT,[ENTER ]_x000D_ -> RA INT, ERA FLOAT);[ENTER ]_x000D_ _x000D_ 6. After you see the “Query OK†message, enter the following_x000D_ command to display the structure of the new table:_x000D_ mysql> DESCRIBE teamstats;[ENTER ]_x000D_ _x000D_ 7. Enter a LOAD DATA statement that inserts records from the_x000D_ team_stats.txt ï¬le in your Projects directory for Chapter 7_x000D_ Use the_x000D_ into the teamstats table. Replace path_to_PHP_folders with_x000D_ MySQL serv-_x000D_ the full path for your PHP_Projects directory for Chapter 7. er’s direc-_x000D_ mysql> LOAD DATA INFILE 'path_to_PHP_folders/ tory path,_x000D_ Chapter.07/Projects/team_stats.txt'[ENTER ] not the Web_x000D_ -> INTO TABLE teamstats;[ENTER ] URL path._x000D_ _x000D_ 8. After you see the “Query OK†message, enter the following_x000D_ command to view all the records in the teamstats table:_x000D_ mysql> SELECT * FROM teamstats;[ENTER ]_x000D_
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code “Newclient” for a 15% Discount!
NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.
The post web development exercise 7 1 appeared first on Nursing Writers Hub.