-
What is an SQL code
Hi all!
I am taking a course for databases. I came to a question and am completely stumped. Does any know write an SQl code for a table structure?? What is an SQL code?
-
SQL = Structured Query Language
There are many different types of SQL and which one you are using is important to how you write the code. But basically, the code is like this:
Create Table [TableName] (
[ColumnName1] datatype options,
[ColumnName2] datatype options,
[ColumnName3] datatype options,
[ColumnName4] datatype options,
[ColumnName(n)] datatype options
)
For example, in T-SQL (Transact-SQL for MS SQL Server), you would write it like this:
Create Table dbo.MyTable (
MyKeyColumn int identity(1, 1) not null primary key,
MyStringData varchar(100) null,
MyDateColumn datetime not null default(getdate())
MyBitFlagData bit not null default(0)
)
-
Thank you so much! I thought thats what it could have been. I was up until 4 in the morning doing that project. Thanks for verifying!
Originally posted by Rawhide
SQL = Structured Query Language
There are many different types of SQL and which one you are using is important to how you write the code. But basically, the code is like this:
Create Table [TableName] (
[ColumnName1] datatype options,
[ColumnName2] datatype options,
[ColumnName3] datatype options,
[ColumnName4] datatype options,
[ColumnName(n)] datatype options
)
For example, in T-SQL (Transact-SQL for MS SQL Server), you would write it like this:
Create Table dbo.MyTable (
MyKeyColumn int identity(1, 1) not null primary key,
MyStringData varchar(100) null,
MyDateColumn datetime not null default(getdate())
MyBitFlagData bit not null default(0)
)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|