MIS - SQL Cheat Sheet

MIS - SQL Cheat Sheet - SQL STUDY SHEET DDL: CREATE TABLE...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
SQL STUDY SHEET DDL: CREATE TABLE tblName ( Data_Types: column_name data_type attribute1 attribute 2…., Char(#): Each Entry will be stored as # characters column_name data_type attribute1 attribute 2…., VarChar(#):  Entry will be stored as _ characters up to #. column_name data_type attribute1 attribute 2…., Int:  Integers only table checks/attributes ) Money:  Specified monetary unit according to DB. DateTime:  A date/time CREATE INDEX idxName ON tblName Decimal(x,y): ? X=total # of chars, y=# of decimals (first_column order, second_column order, …) *Order =ASC or DESC; ASC is default order* Attributes: Null or Not Null ALTER TABLE tblName Default Values:  Default ___ ADD     column_name    data_type    attribute Primary Key DROP COLUMN     column_name  References  tblName(field name) ALTER COLUMN   column_name  new_data_type     where field name is primary key of some other table.         new_attribute 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/15/2008 for the course MIS 325 taught by Professor Mote during the Spring '08 term at University of Texas.

Page1 / 4

MIS - SQL Cheat Sheet - SQL STUDY SHEET DDL: CREATE TABLE...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online