Mysql Admin Examples telnet dazzle login: cs93033 Password: dazzle% mysql -pany -u any -h gold suppDB mysql> show tables; # pretend S=Students,P=Courses,J=Teachers,SPJ=Sections mysql> select * from S,P,J,SPJ where S.S_NO=SPJ.S_NO and -> P.P_NO=SPJ.P_NO and J.J_NO=SPJ.J_NO; mysql> select SNAME, PNAME, JNAME from S,P,J,SPJ where S.S_NO=SPJ.S_NO and -> P.P_NO=SPJ.P_NO and J.J_NO=SPJ.J_NO and S.S_NO = "S1"; \q dazzle% mysql -pbillard1 -u cs93033 -h gold cs93033 mysql> create table Students ( SS_NO char(11) primary key, AGE int ); mysql> insert into Students values("111-22-3333",20); mysql> select * from Students; mysql> update Students set AGE=25 where SS_NO = "111-22-3333"; mysql> delete from Students where AGE > 21; \q dazzle% mysqladmin -pbillard1 -u cs93033 -h gold drop cs93033 Do you really want to drop the 'cs93033' database [y/N] y dazzle% mysqladmin -pbillard1 -u cs93033 -h gold create cs93033 dazzle% cd public_html/billard1 dazzle% more SuppDB.dd; more SuppDB.data; more SuppDB.query dazzle% mysql -pbillard1 -u cs93033 -h gold cs93033 SuppDB.rpt dazzle% more SuppDB.rpt dazzle% mysql -h dazzle% rm SuppDB.rpt dazzle% mysql -t -pbillard1 -u cs93033 -h gold cs93033SuppDB.rpt dazzle% more recreate dazzle% cp SuppDB.dd cs93033.dd dazzle% cp SuppDB.data cs93033.data dazzle% recreate cs93033 cs93033 billard1 dazzle% mysqladmin -pbillard1 -u cs93033 -h gold drop cs93033 dazzle% mysqladmin -pbillard1 -u cs93033 -h gold create cs93033 Netscape: http://gold.mcs.csuhayward.edu:8080/~cs93033/billard1/student.html dazzle% vi student.html # change Student to Ted Billard's Netscape: pick "My Application" dazzle% vi myapplication.html Netscape: http://gold.mcs.csuhayward.edu:8080/~cs93033/billard1 Netscape: pick "Two-Tier Architecture" Netscape: pick "Supplier Application" Netscape: push "List" Netscape: fill-in S_NO: S1 and push "Find" Netscape: change STATUS to 30 and push "Update" and "List" Netscape: push "Delete" and "List" Netscape: change STATUS back to 20 and push "Insert" and "List" Netscape: select View, Page Source # note forms, tables, input text, etc. dazzle% mysqladmin -p4311 -u 4311 -h gold drop SuppDB dazzle% mysqladmin -p4311 -u 4311 -h gold create SuppDB dazzle% mysql -p4311 -u 4311 -h gold SuppDB