

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Wang; Class: File Structures and Database Systems; Subject: Computer Science; University: California State University - Fullerton; Term: Fall 2006;
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


8/17/2006 Dr. Wang, Cal State Fullerton 1
CREATE DATABASE
CREATE TABLE 8/17/2006 Dr. Wang, Cal State Fullerton 2 Datatypes: CHAR( Attribute constraints: NOT NULL UNIQUE PRIMARY KEY ย DEFAULT Table constraints: [CONSTRAINT 8/17/2006 Dr. Wang, Cal State Fullerton 4 CREATE TABLE STUDENT(SSN numeric(9) primary key, FNAME varchar(20), LNAME varchar(20), SEX enum(โMโ, โFโ), DBIRTH date, STADDRESS varchar(20), CITY varchar(20), STATE char(2), ZIPCODE char(5), TELEPHONE numeric(10), MAJOR char(4), CLASS tinyint); 8/17/2006 Dr. Wang, Cal State Fullerton 5 CREATE TABLE COURSE(CNUM char(7) primary key, CNAME varchar(30), TEXTBOOK varchar(50), UNITS tinyint, DEPARTMENT varchar(30)); CREATE TABLE ENROLL(SNO numeric(9), CNO char(7), GRADE enum(โAโ, โBโ, โCโ, โDโ, โFโ, โWโ), primary key (SNO, CNO), foreign key (SNO) references STUDENT(SSN), foreign key (CNO) references COURSE(CNUM)); DROP DATABASE {,
}] );
SQL-The Structural Query Language
SQL-The Structural Query Language
(
SQL-The Structural Query Language
SQL-The Structural Query Language
3. DROP