Sponsored Links
This presentation is the property of its rightful owner.
1 / 81

动态网页与数据库 PowerPoint PPT Presentation


  • 129 Views
  • Uploaded on
  • Presentation posted in: General

动态网页与数据库. 制作者 : 杨建国. 二零零五年一月. 联 系 方 式 QQ: 317154001 网址: http://www.jsjzx.net 电子邮件: repair_pc@163.com. 动态网页与数据库. 第一节 数据库基础. 第二节 数据库进阶. 第三节 静态网页与动态网页. 第四节 ASP 简介. 第一节 数据库基础.  数据库分类 小型: access 、 foxpro 、 foxbase 、 dbase 、 vfp 、 approach (适合个人、工作组) 中型: sql 、 mysql

Download Presentation

动态网页与数据库

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


:


QQ: 317154001

http://www.jsjzx.net

repair_pc@163.com


ASP


  • accessfoxprofoxbasedbase vfp

    approach

  • sql mysql

  • informix oracle sybase jasmine

    CAINTERNET


  • .SQL

    1.SQLWINDOWS

    RDBMS

    GUI

    2.

  • 3.


SQL Server

(Production)SQL Server 2000 (OLTP)

SQL ServerSQL Server

SQL Server 2000


CPU

Pentium 166MHzIntelCPU

RAM

64MB128MB

SQL Server 200095MB270MB250MB

Analysis ServiceEnglish QueryAnalysis Service50MBEnglish Query80MB

4.


SQL

Windows NT 4.0 ServerWindows 2000 ServerAdvanced ServerData Center Server

Windows NT 4.0 ServerWindows 2000 ServerAdvanced ServerData Center Server

Windows Me/98Windows NT 4.0 ServerWindows 2000 ProfessionalServerAdvanced ServerData Center Server

Windows NT 4.0Windows 2000

Windows Me/98Windows NT 4.0Windows 2000

Windows Me/98/95Windows NT 4.0Windows 2000

5.


6.

1SQL Server 2000

SETUP.EXE


1


2

SQL Server

3


2


4

SQL Server


3


5


4


64-5

SQL Server

2000


5


7


6


8


7


SQL Server

SQL

Server 2000

(Named Instance)

SQL Server


9


8


10

9


9


SQL

/10

Microsoft SQL Server

SQL ServerSQL Server


10


SQL Server


Microsoft SQL Server

2000

(Administrators)


11

SQL

Windows

Windows

Windows

SQL Server

SQL ServerWindowsSQL ServerSQL Serversasasa


11


windows 98SQL Server 2000

SQLServer

12


12


13

13


13


14

SQL Server 2000


14


7.

  • DDL (Data Define Language)

    Primary Key

    DDLCreate Table

    Drop TableAlter Table


  • DML(Data Manipulation Language )

  • SQLActive Query LanguageActive Query LanguageActive Query LanguageInsertDeleteUpdate

  • SelectActive Query LanguageRecordset


.SQL

  • SELECT email

    FROM [user1]

    WHERE (UserName = 'guest')


  • SELECT Email

    FROM [user1]

    WHERE (UserName = 'likedou') OR

    (UserName = 'guest')

  • SELECT UserName, Password

    FROM [user1]

    WHERE (UserName = 'guest') OR

    (UserName = 'likedou')

  • select * from user1

  • select email from user1


.

  • select user2.name,user3.english,user3.maths from

    user2,user3

  • select user2.name,user3.english,user3.maths from

    user2,user3 where user2.id=user3.id


.

  • select maths "mathematics" from user3

  • select history*0.6 "new history" from user3

  • select english "original english",english*0.6 "new

    english" from user3

  • select english,maths,history,english+maths+history

    "total score" from user3

  • select name+grade "new grade" from user3

  • select rtrim(name)+grade "new grade" from user3


.

  • select email from user1

  • select email from user1 order by email

  • select email,username from user1 order by

    email,username

  • select email from user1 order by username

  • select email from user1 order by email desc

  • select email from user1 where sex=1 order by email

    desc


.

  • select distinct sex from user1

  • select distinct logins from user1

  • DISTINCT textntext image

  • DISTINCT

    .

  • create table book(visitor varchar(40),comments

    text,entrydate datetime)

  • alter table book add address char(6)

  • drop table book


.

1.

  • Varchar255

  • Char

  • 2.

  • Text20

  • (

    2K)


3.

  • TINYINT0~255(1)

  • SMALLINT-32768~32767(2)

  • INT-2147483647~2147483647(4)

  • NUMERIC-10^38~10^38

    28

    NUMERIC(280)


4.INTNUMERIC

  • MONEY-922337203685477.5808~922337203685477.5807

  • SMALLMONEY-214748.3648~214748.3647

    5.bit

  • 01 (NOYES)

  • BIT

    6.

  • DATATIME1753.1.1~9999.12.31()

  • SMALLDATETIME1900.1.1~2079.6.6()


tinyint

1 Bytes

0 255

smallint

2 Bytes

32,768 32,767

int

4 Bytes

231(2311)

bigint

8 Bytes

263(2631)

decimal (numeric)

38 Bytes

1038 +110381

float

:4Bytes

:8Bytes

1.79E + 308 1.79E + 308

real

4 Bytes

3.40E + 38 3.40E + 38


Money

8 Bytes

263263 1

smallmoney

4 Bytes

214.748,3648+214,748.364


Datetime

8 Bytes

1753.1.1---

9999.12.31

smalldatetime

4 Bytes

1900.1.1---

2079.6.6


7.Unicode:

UnicodeUnicodencharnvarcharntextcharvarchartext

8.Binary:

19AFWordExcelPDF

SQL ServerbinaryvarbinaryimageBinary


binary

8,000

barbinary

8,000

image

231 1 (2,147,483,647)


10.timestamp

binarytimestamp

timestamp@@DBTSdatetimesmalldatetime


11.uniqueidentifier

16(GUID)GUIDGUID

uniqueidentifierNEWIDNEWIDGUID


12.sql_variant

textntexttimestampsql_variantSQL Serversql_variant


.

1.

  • NULL

  • BIT

  • NOT NULL

  • Empyt1 int null

  • Empyt2 int not null

    2.

  • Country varchar(30) default USA

  • Entrydate datetime default getdate( )


3.

  • NUMERICINT

  • theID nuberic(18) identity


.

  • SQL()

    .

    1.

    2.drop table mytable

    3.drop table


  • .

  • sp_spaceused,

    sp_spaceused user1

  • 1.

  • ()


  • 249

    2.

  • (

    )


3.SQL

  • Create index ID_index on user2(ID)

  • drop index user2.ID_index

  • create clustered index

    user2_clust_index on user2(ID)


create clustered index mycolumn_clust_index on

mytable(mycolumn) with allow_dup_row

  • create unique clustered index mycolumn_clust_index

    on mytable(mycolumn)

  • (16)

    create index name_index on

    username(firstname,lastname)


.SQL

1.

  • insert mytable(mycolumn) values(good)

  • Insert mytable(first_column,second_column,

    third_column) valuse(good,well,best)

  • InsertP169

  • writetext

  • P169

  • SQL

    @@identityP170


2.

  • Delete mytable where first_column=deltet me

  • DELETE P170

  • DELETEWHERE

    truncate table

    3.

  • Update mytable set first_column=good where second_column=best

  • UPDATEP171

  • updatetext

  • where


4.SELECT

  • Insert mytable(first_column,second_column) select

    another_first,another_second from anothertable

    where another_first =copy me

  • select * into newtable from mytable

  • select first_column into newtable from mytable

    where second_column=copy me


.

1.

  • Select count(au_lname) from authors

  • Select count(au_lname) from authors where

    au_lname=ringer

  • Select count(distinct au_lname) from authors

  • Select count(*) from authors

  • Select count(vote) from opinion_table where vote=1

    2.

  • Select avg(vote) from opinion


3.

  • Select sum(purchase_amount) from orders

    4.

  • Select max(vote) from opinion

  • Select min(vote) from opinion

    .SQL

    1.

  • Select username from opinion where vote>6 and vote<11

  • Select username from opinion where vote between 7 and 10

  • Select username from opinion where vote=1 or vote=10

  • Select username from opinion where vote in(1,10)


  • Select vote from opinion where username in(bill

    gates,president clinton)

  • Select username from opinion where vote not beteween

    7 and 10

  • Select vote from opinion where username not in(bill

    gates,president clinton)

    2.

  • Select convert(char(8),price)+us dollars from orders

  • Select the vote is +convert(char(1),vote) from opinion

    3.SQL


4.

  • Select site_name from site_directory where

    site_desc=trading card

  • Select site_name from site_directory where site_desc

    like %trading card%

  • Select site_name from site_directory where site_name

    like [A-M]%

  • Select site_name from site_directory where site_name

    like [N-Z]%

  • Select site_name from site_directory where site_name

    like [ABC]%


  • Select site_name from site_directory where site_name

    like [C-FY]%

  • Select site_name from site_directory where site_name

    like [^Y]%

  • Select site_name from site_directory where site_name

    like M_crosoft%

  • %_[ ]

  • -[ ]

  • [ ][ ]

  • Select site_name from site_directory where site_desc

    like %[%]%


5.

  • Ltrim( )

  • Rtrim( )

  • Select rtrim(site_name) from site_directory

  • Select lrtim(rtrim(site_name) from site_directory

    6.

    7.

  • Select getdate( )

  • Create table site_log( username varchar(40),

    useractivity varchar(100),entrydate datetime default

    getdate( ) )


8.

  • Select convert(varchar(30),getdate( ),9)

  • P180

  • 100

  • Select convert(varchar(30),getdate( ),111)

    9.

  • Select site_name site name,datepart(mm,site_entrydate)

    month posted from site_directory

  • P181


  • Select site_name site name

    datename(mm,site_entrydate) month posted

    from site_directory

  • Select site_name site name

    datename(dw,site_entrydate)+-+

    datename(mm,site_entrydate) day and month posted

    from site_directory

    10.

  • Select * from weblog where entrydate=12/25/2000

  • Select * from weblog where

    entrydate>=12/25/2000 and entrydate<12/26/2000


  • Select * from weblog where entrydate like Dec 25 2000%

    11.

  • Select entrydate time entered

    Datediff(hh,entrydate,getdate( )) hours ago from weblog

  • Select username user name,

    dateadd(mm,1,firstvisit_date) registration expires

    from registration_table

  • DATEADD( )30


null

varchar

16

varchar

50

varchar

4

varchar

200

decimal

9

182

Char

2

char

10

bit

1

varchar

50

  • 1.


2.CREATE TABLE


3.

4.

IX_

5.

6.

7.


  • 0001

  • 0002

  • 00010000003500010000003


  • Login