Javaweb Project Development Case Highlights-4th Chapter blog Site System-001 Design

Source: Internet
Author: User

1.

2.

3.

1# Mysql-front 5.0 (Build 1.0)2 3 /*!40101 SET @[email protected] @SQL_MODE*/;4 /*!40101 SET sql_mode= ' strict_trans_tables,no_auto_create_user,no_engine_substitution '*/;5 /*!40111 SET @[email protected] @SQL_NOTES*/;6 /*!40103 SET sql_notes= ' on '*/;7 8 9 # host:localhost Database:db_blogTen# ------------------------------------------------------ One# Server Version 5.0.67-community-NT A  - DROP DATABASE IF EXISTS ' db_blog '; -CREATE DATABASE ' Db_blog '/*!40100 DEFAULT CHARACTER SET gb2312*/; the Use ' Db_blog '; -  - # -# Table Structure forTable Article + # -  + CREATE TABLE ' article ' ( A' Id 'int(11) not NULL auto_increment, at' title ' varchar (50)defaultNULL, - ' content ' text, -' username ' varchar (50)defaultNULL, -' Date ' datetimedefaultNULL, -' Hasread 'int(11)default' 0 ', - PRIMARY KEY (' Id '), in KEY ' username ' (' username ') -) Engine=innodb auto_increment=6 DEFAULT charset=gb2312 comment= ' article table '; toINSERT into ' article ' VALUES (1, ' SSH integration Scheme (i) ', ' <p> this time ready to write about the integration method of ssh </p> ', ' Xiaoxiao ', ' 2009-12-27 10:58:50 ', 2); +INSERT into ' article ' VALUES (2, ' SSH Integration Scheme (ii) ', ' <p> let's feel the charm of SSH integration together!!!!! </p> ', ' Xiaoxiao ', ' 2009-12-27 10:59:41 ', 1); -INSERT into ' article ' VALUES (3, ' It's so cold today! ' <p> it snowed outside, and the winter came too early this year. < /p> ', ' Xiaoxiao ', ' 2009-12-27 11:00:22 ', 1); theINSERT into ' article ' VALUES (4, ' Continue to update my SSH integration scheme! ', ', ' Xiaoxiao ', ' 2009-12-27 11:08:43 ', 1); *INSERT into ' article ' VALUES (5, ' Test log!! ', ' <p> Test logs!! < /p> ', ' Xiaoxiao ', ' 2010-01-27 18:05:06 ', 1); $ Panax Notoginseng # -# Table Structure forTable Bloginfo the # +  A CREATE TABLE ' Bloginfo ' ( the' username ' varchar (not NULL)default‘‘, +' Blogtitle ' varchar (50)defaultNULL, -' idiograph ' varchar (50)defaultNULL, $ PRIMARY KEY (' username ') $) Engine=innodb DEFAULT charset=gb2312 comment= ' Personality settings table '; -INSERT into ' bloginfo ' VALUES (' Xiaoxiao ', ' I'm a little ', ' I like blogging ')); -  the # -# Table Structure forTable CritiqueWuyi # the  - CREATE TABLE ' critique ' ( Wu' Id 'int(11) not NULL auto_increment, -' AId 'int(11)defaultNULL, About ' content ' text, $' username ' varchar (50)defaultNULL, - PRIMARY KEY (' Id '), - KEY ' aid ' (' aid ') -) Engine=innodb auto_increment=7 DEFAULT charset=gb2312 comment= ' comment form '; AINSERT into ' critique ' VALUES (1,3, ' <p> Yes, it's too cold, I'm okay!!! </p> ', ' Xiaoxiao '); +INSERT into ' critique ' VALUES (2,3, ' <p> our company's heating is broken, so cold!! </p> ', ' Xiaoxiao '); theINSERT into ' critique ' VALUES (3,2, ' <p> test it!) </p> ', ' Xiaoxiao '); -INSERT into ' critique ' VALUES (4,5, ' <p> reviews!! </p> ', ' Xiaoxiao '); $INSERT into ' critique ' VALUES (5,1, ' <p> Test it!! </p> ', ' Xiaoxiao '); theINSERT into ' critique ' VALUES (6,5, ' <p><a href=\ "http://localhost:8080/javaprj_4/\" >http://localhost :8080/javaprj_4/</a></p> ', ' anonymous '); the  the # the# Table Structure forTable Dianjiliang - # in  the CREATE TABLE ' Dianjiliang ' ( the' Id 'int(11) not NULL auto_increment, About' AId 'int(11)defaultNULL, the' IP ' varchar (255)defaultNULL, the' Time ' datedefaultNULL, the PRIMARY KEY (' Id '), + KEY ' aid ' (' aid ') -) Engine=innodb auto_increment=7 DEFAULT charset=gb2312 comment= ' click-Through scale '; theINSERT into ' Dianjiliang ' VALUES (1, 1, ' 0:0:0:0:0:0:0:1 ', ' 2009-12-27 '));BayiINSERT into ' Dianjiliang ' VALUES (2,3, ' 0:0:0:0:0:0:0:1 ', ' 2009-12-27 ')); theINSERT into ' Dianjiliang ' VALUES (3,1, ' 0:0:0:0:0:0:0:1 ', ' 2010-01-27 ')); theINSERT into ' Dianjiliang ' VALUES (4,2, ' 0:0:0:0:0:0:0:1 ', ' 2010-01-27 ')); -INSERT into ' Dianjiliang ' VALUES (5,5, ' 0:0:0:0:0:0:0:1 ', ' 2010-01-27 ')); -INSERT into ' Dianjiliang ' VALUES (6,4, ' 0:0:0:0:0:0:0:1 ', ' 2010-01-27 ')); the  the # the# Table Structure forTable User the # -  the CREATE TABLE ' user ' ( the' username ' varchar (not NULL)default‘‘, the' Password ' varchar (20)defaultNULL,94' Nickname ' varchar (20)defaultNULL, the' Question ' varchar (50)defaultNULL, the' Answer ' varchar (50)defaultNULL, the PRIMARY KEY (' username ')98) Engine=innodb DEFAULT charset=gb2312 comment= ' user table '; AboutINSERT into ' user ' VALUES (' Xiaoxiao ', ' Xiaoxiao ', ' Li-pop ', ' Your hometown ', ' Yiyang city, Hunan ')); - 101 #102# Foreign Keys forTable Article103 #104  the ALTER TABLE ' article '106 ADD CONSTRAINT ' article_ibfk_1 ' FOREIGN KEY (' username ') REFERENCES ' user ' (' username ');107 108 #109# Foreign Keys forTable Bloginfo the #111  the ALTER TABLE ' Bloginfo '113 ADD CONSTRAINT ' bloginfo_ibfk_1 ' FOREIGN KEY (' username ') REFERENCES ' user ' (' username '); the  the # the# Foreign Keys forTable Critique117 #118 119 ALTER TABLE ' critique ' - ADD CONSTRAINT ' critique_ibfk_1 ' FOREIGN KEY (' AId ') REFERENCES ' article ' (' Id ');121 122 #123# Foreign Keys forTable Dianjiliang124 # the 126 ALTER TABLE ' Dianjiliang '127 ADD CONSTRAINT ' dianjiliang_ibfk_1 ' FOREIGN KEY (' AId ') REFERENCES ' article ' (' Id '); - 129  the /*!40111 SET [email protected]_sql_notes*/;131 /*!40101 SET [email protected]_sql_mode*/;

4. Operation effect

5.

6.

7.

Javaweb Project Development Case Highlights-4th Chapter blog Site System-001 Design

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.