SQL Intro - SQL Introduction Motes Notes 2/14/2011 Create...

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

View Full Document Right Arrow Icon
SQL Introduction Mote’s Notes 2/14/2011 Create Table Syntax CREATE TABLE table_name ( field_name_1 data_type attributes , field_name_2 data_type attributes , … field_name_N data_type attributes , table_attributes ) CREATE TABLE tblEmployee ( FirstName Varchar(20) Not Null, MiddleName Varchar(20) Null, LastName Varchar(30) Not Null, EID Varchar(10) Primary Key, Gender Char(1) Not Null Check (Gender = 'F' Or Gender = 'M'), DOB Datetime Not Null, HourlySalary Money Not Null Default 9.50 Check (HourlySalary >= 7.25) ) Select Syntax (highly simplified) SELECT field_name_1, field_name_2, … field_name_N FROM table_name(s) WHERE record level condition is true GROUP BY field_name_A, field_name_B, … field_name_C HAVING group level condition is true ORDER BY field_name_X, field_name_Y, … field_name_Z SELECT FirstName, LastName, HourlySalary FROM tblEmployee WHERE EID = 'ABC1234' SELECT FirstName, LastName, 8*HourlySalary FROM tblEmployee WHERE HourlySalary >= 25.00 ORDER BY LastName, FirstName
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 05/26/2011 for the course MIS 325 taught by Professor Mote during the Spring '08 term at University of Texas at Austin.

Page1 / 2

SQL Intro - SQL Introduction Motes Notes 2/14/2011 Create...

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