PDA

View Full Version : نمونه Data-definition query



mansori
سه شنبه 23 آبان 1385, 15:56 عصر
باسلام - دوستان نمونه دستور کوئری data-definition query رو نه اینجا پیدا کردم و نه چند تا سایت خارجی اگه نمونه با create table, Altertable, drop & create index در دسترس دارید و زحمت معرفی بکشید. متشکرم

سنبله کار
چهارشنبه 24 آبان 1385, 11:55 صبح
از help اکسس
Examples of data-definition queries (MDB)
Show All
Hide All
Note The information in this topic applies only to a Microsoft Access database (.mdb).

Creating a table

This data-definition query (data-definition query: An SQL-specific query that contains data definition language (DDL) statements. These statements allow you to create or alter objects in the database.) uses the CREATE TABLE statement to create a table named Friends. The statement includes the name and data type (data type: The characteristic of a field that determines what type of data it can hold. Data types include Boolean, Integer, Long, Currency, Single, Double, Date, String, and Variant (default).) for each field in the table and assigns the FriendID field an index (index: A feature that speeds up searching and sorting in a table based on key values and can enforce uniqueness on the rows in a table. The primary key of a table is automatically indexed. Some fields can't be indexed because of their data type.) that marks it as the primary key (primary key: One or more fields (columns) whose values uniquely identify each record in a table. A primary key cannot allow Null values and must always have a unique index. A primary key is used to relate a table to foreign keys in other tables.).

CREATE TABLE Friends
([FriendID] integer,
[LastName] text,
[FirstName] text,
[Birthdate] date,
[Phone] text,
[Notes] memo,
CONSTRAINT [Index1] PRIMARY KEY ([FriendID]));


Creating an index

This data-definition query (data-definition query: An SQL-specific query that contains data definition language (DDL) statements. These statements allow you to create or alter objects in the database.) uses the CREATE INDEX statement to create a multiple-field index (index: A feature that speeds up searching and sorting in a table based on key values and can enforce uniqueness on the rows in a table. The primary key of a table is automatically indexed. Some fields can't be indexed because of their data type.) on the LastName and FirstName fields of a table called Friends.

CREATE INDEX NewIndex
ON Friends ([LastName], [FirstName]);

mansori
چهارشنبه 24 آبان 1385, 12:02 عصر
ضمن تشکر. از اساتید مثل شما انتظار آدرس سرراست تر از این هست. حسب دستور دوستان قبل از جستجو اینو دیدم. ممنونم اگه راهنمایی بفرمائید.

mansori
چهارشنبه 24 آبان 1385, 14:20 عصر
این آدرس با توضیحات و مثال
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acintsql.asp

mansori
پنج شنبه 25 آبان 1385, 11:50 صبح
مثالهای در مورد ساخت کوئری data-definition

سنبله کار
یک شنبه 28 آبان 1385, 14:06 عصر
شما نمونه دستور خواستی من هم راهنمای اکسسو گذاشتم .
حالا اگه منظور شما از آدرس سر راست چیز دیگست ما نمی دونستیم .

mansori
دوشنبه 29 آبان 1385, 08:23 صبح
با عرض معذرت چون بنا به تاکید دوستان که آخرین مرحله جستجو ایجاد تایپیک هست، بعد از جستجو در هلپ و تالار و گوگل تایپیک ایجاد شد. ضمن تقدیر از راهنمایی جنابعالی با توجه به دسترسی شما به اطلاعات بیشتر بعنوان مدیر ناظر، انتظار نمونه های دیگه ای بود که ضمن تشکر مجدد از لطفتون امیدوارم موجب رنجش جنابعالی نشده. :تشویق: