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

动态网页与数据库 PowerPoint PPT Presentation


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

动态网页与数据库. 制作者 : 杨建国. 二零零五年一月. 联 系 方 式 QQ: 317154001 网址: http://www.jsjzx.net 电子邮件: [email protected] 动态网页与数据库. 第一节 数据库基础. 第二节 数据库进阶. 第三节 静态网页与动态网页. 第四节 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


3714172

:


3714172

QQ: 317154001

http://www.jsjzx.net

[email protected]


3714172

ASP


3714172

  • accessfoxprofoxbasedbase vfp

    approach

  • sql mysql

  • informix oracle sybase jasmine

    CAINTERNET


3714172

  • .SQL

    1.SQLWINDOWS

    RDBMS

    GUI

    2.

  • 3.


3714172

SQL Server

(Production)SQL Server 2000 (OLTP)

SQL ServerSQL Server

SQL Server 2000


3714172

CPU

Pentium 166MHzIntelCPU

RAM

64MB128MB

SQL Server 200095MB270MB250MB

Analysis ServiceEnglish QueryAnalysis Service50MBEnglish Query80MB

4.


3714172

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.


3714172

6.

1SQL Server 2000

SETUP.EXE


3714172

1


3714172

2

SQL Server

3


3714172

2


3714172

4

SQL Server


3714172

3


3714172

5


3714172

4


3714172

64-5

SQL Server

2000


3714172

5


3714172

7


3714172

6


3714172

8


3714172

7


3714172

SQL Server

SQL

Server 2000

(Named Instance)

SQL Server


3714172

9


3714172

8


3714172

10

9


3714172

9


3714172

SQL

/10

Microsoft SQL Server

SQL ServerSQL Server


3714172

10


3714172

SQL Server


3714172

Microsoft SQL Server

2000

(Administrators)


3714172

11

SQL

Windows

Windows

Windows

SQL Server

SQL ServerWindowsSQL ServerSQL Serversasasa


3714172

11


3714172

windows 98SQL Server 2000

SQLServer

12


3714172

12


3714172

13

13


3714172

13


3714172

14

SQL Server 2000


3714172

14


3714172

7.

  • DDL (Data Define Language)

    Primary Key

    DDLCreate Table

    Drop TableAlter Table


3714172

  • DML(Data Manipulation Language )

  • SQLActive Query LanguageActive Query LanguageActive Query LanguageInsertDeleteUpdate

  • SelectActive Query LanguageRecordset


3714172

.SQL

  • SELECT email

    FROM [user1]

    WHERE (UserName = 'guest')


3714172

  • 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


3714172

.

  • 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


3714172

.

  • 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


3714172

.

  • 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


3714172

.

  • 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


3714172

.

1.

  • Varchar255

  • Char

  • 2.

  • Text20

  • (

    2K)


3714172

3.

  • TINYINT0~255(1)

  • SMALLINT-32768~32767(2)

  • INT-2147483647~2147483647(4)

  • NUMERIC-10^38~10^38

    28

    NUMERIC(280)


3714172

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()


3714172

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


3714172

Money

8 Bytes

263263 1

smallmoney

4 Bytes

214.748,3648+214,748.364


3714172

Datetime

8 Bytes

1753.1.1---

9999.12.31

smalldatetime

4 Bytes

1900.1.1---

2079.6.6


3714172

7.Unicode:

UnicodeUnicodencharnvarcharntextcharvarchartext

8.Binary:

19AFWordExcelPDF

SQL ServerbinaryvarbinaryimageBinary


3714172

binary

8,000

barbinary

8,000

image

231 1 (2,147,483,647)


3714172

10.timestamp

binarytimestamp

timestamp@@DBTSdatetimesmalldatetime


3714172

11.uniqueidentifier

16(GUID)GUIDGUID

uniqueidentifierNEWIDNEWIDGUID


3714172

12.sql_variant

textntexttimestampsql_variantSQL Serversql_variant


3714172

.

1.

  • NULL

  • BIT

  • NOT NULL

  • Empyt1 int null

  • Empyt2 int not null

    2.

  • Country varchar(30) default USA

  • Entrydate datetime default getdate( )


3714172

3.

  • NUMERICINT

  • theID nuberic(18) identity


3714172

.

  • SQL()

    .

    1.

    2.drop table mytable

    3.drop table


3714172

  • .

  • sp_spaceused,

    sp_spaceused user1

  • 1.

  • ()


3714172

  • 249

    2.

  • (

    )


3714172

3.SQL

  • Create index ID_index on user2(ID)

  • drop index user2.ID_index

  • create clustered index

    user2_clust_index on user2(ID)


3714172

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)


3714172

.SQL

1.

  • insert mytable(mycolumn) values(good)

  • Insert mytable(first_column,second_column,

    third_column) valuse(good,well,best)

  • InsertP169

  • writetext

  • P169

  • SQL

    @@identityP170


3714172

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


3714172

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


3714172

.

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


3714172

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)


3714172

  • 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


3714172

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]%


3714172

  • 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 %[%]%


3714172

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( ) )


3714172

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


3714172

  • 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


3714172

  • 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


3714172

null

varchar

16

varchar

50

varchar

4

varchar

200

decimal

9

182

Char

2

char

10

bit

1

varchar

50

  • 1.


3714172

2.CREATE TABLE


3714172

3.

4.

IX_

5.

6.

7.


3714172

  • 0001

  • 0002

  • 00010000003500010000003


  • Login