Presentation is loading. Please wait.

Presentation is loading. Please wait.

CREATE TABLE Customer (CustNo number, CustName text (15), CustAddr text (30), Balance number, CredLim number, SLSRNo text (3), CONSTRAINT SPIndex PRIMARY.

Similar presentations


Presentation on theme: "CREATE TABLE Customer (CustNo number, CustName text (15), CustAddr text (30), Balance number, CredLim number, SLSRNo text (3), CONSTRAINT SPIndex PRIMARY."— Presentation transcript:

1 CREATE TABLE Customer (CustNo number, CustName text (15), CustAddr text (30), Balance number, CredLim number, SLSRNo text (3), CONSTRAINT SPIndex PRIMARY KEY (CustNo)) Creating a new table using SQL

2 Using SQL, create a table called Employee that contains the fields EmpNo number, EmpName which is of type text and number of characters is 30, EmpAddr which is of type text and number of characters is 50, PostCode text and characters is 4, Phone_number is text and characters is 10. The Primary Key is EmpNo.

3 INSERT INTO Client ( CustNo, CustName, CustAddr, Balance, CredLim, SLSRNo ) VALUES (311, "Charles, Don", "48 College Ira MI", 200.1, 300, 12);

4 CREATE TABLE Worker (EmpNo number, EmpName text (30), HourlyRate number, SkillType text (10), SuprID number, CONSTRAINT SPIndex PRIMARY KEY (EmpNo))

5 CREATE TABLE Part (PartNo text (4), PartDesc text (15), UnitonHand number, ItemClass text (2), WrhsNo number, UnitPrice currency, CONSTRAINT SPIndex PRIMARY KEY (PartNo)) ALTER TABLE Part ADD COLUMN partloc text(15);

6 INSERT INTO Customer ( CustNo, CustName, CustAddr, Balance, CredLim, SLSRNo ) VALUES (311, "Charles, Don", "48 College, Ira, MI", 200.1, 300, 12);

7 DELETE FROM Table WHERE criteria

8 Use the AFL players table What is the name and DOB of the player who has played the maximum amount of games? SELECT LastName, FirstName, DOB FROM tblAFLPlayers WHERE GamesAsof1996 = (select max(GamesAsof1996) from tblAFLPlayers);


Download ppt "CREATE TABLE Customer (CustNo number, CustName text (15), CustAddr text (30), Balance number, CredLim number, SLSRNo text (3), CONSTRAINT SPIndex PRIMARY."

Similar presentations


Ads by Google