MySQL-driven Web Site Construction (Cont.)

  1. Database Implementation Using MySQL Text Monitor (Cont.)
  2. Use MySQL text monitor to enter the SQL commands, which could be found from here.

    An Example of MySQL Database Processing
     shell> mysql -h undcemmysql.mysql.database.azure.com -u user_id -p
     Enter password: ******* 
    
     Welcome to the MySQL monitor.  Commands end with ; or \g.
     Your MySQL connection id is 30
     Server version: 8.0.37-azure Source distribution
     Copyright (c) 2000, 2024, Oracle and/or its affiliates.
     Oracle is a registered trademark of Oracle Corporation and/or its
     affiliates. Other names may be trademarks of their respective owners.
    
     Type 'help;' or '\h' for help. Type '\c' to clear the current input
     statement.
    
     mysql> show databases; 
     +--------------------+
     | Database           |
     +--------------------+
     | information_schema |
     | performance_schema |
     | wenchen            |
     +--------------------+
     3 rows in set (0.00 sec)
    
     mysql> -- Comment: wenchen is the instructor’s database 
     mysql> use wenchen; 
     Database changed
    
     mysql> create table books ( 
         ->   title   char(128), 
         ->   ISBN    char(20) primary key, 
         ->   price   real ); 
     Query OK, 0 rows affected (0.07 sec)
    
     mysql> insert into books values ( 
         ->   'PHP for the World Wide Web', '0321245652', 14.29 ); 
     Query OK, 1 row affected (0.01 sec)
    
     mysql> insert into books values ( 
         ->   'Programming PHP', '1565926102', 26.39 ); 
     Query OK, 1 row affected (0.00 sec)
    
     mysql> select * from books; 
     +----------------------------+------------+-------+
     | title                      | ISBN       | price |
     +----------------------------+------------+-------+
     | PHP for the World Wide Web | 0321245652 | 14.29 |
     | Programming PHP            | 1565926102 | 26.39 |
     +----------------------------+------------+-------+
     2 rows in set (0.00 sec)
    
     mysql> commit; 
     Query OK, 0 rows affected (0.00 sec)
    
     mysql> exit; 
     Bye
    
     shell>

    Note that this database implementation is only an example and is not related to this exercise.
    The italic, white text on navy background is entered by users.
    The wenchen is the instructor’s database. The MySQL DBA should assign a different database to you.



      According to unofficial sources,    
      a new simplified income-tax form contains only four lines:    
      1. What was your income for the year?    
      2. What were your expenses?    
      3. How much have you left?    
      4. Send it in.