Class SQL Exercise

Class SQL Exercise - OTHER POSSIBLE SQL STATEMENTS FROM...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
OTHER POSSIBLE SQL STATEMENTS FROM EXAMPLE TABLES Remember, case does not matter unless it is in “quotes”. 1. Create the Emergency_Number table CREATE TABLE Emergency_Number (Empnumber Integer Not Null Primary Key, Itemnum Integer Not Null Primary Key, Emername Text Not Null, Relation Text, PhoneNumber Text Not Null); Note: On a test or homework, I would count off if you forgot an attribute or put an attribute type that did not make sense. I would not count off for putting the wrong special words. 2. Remove the relation attribute from the Emergency_Number table. ALTER TABLE Emergency_Number DROP relation; 3. Delete the Emergency_Number table. DROP TABLE emergency_number; 4. Add a new Emergency_Number for Jim Smith, it is his Mother, Amy Smith, at phone number (336) 555-1357. INSERT INTO emergency_number (empnumber, itemnum, emername, relation, phonenumber) VALUES (1,3,”Amy Smith”,”Mother”,”(336_ 555-1357)”); 5. Change Cathy Jones phone number in the Emergency_Number table to (336) 555-1480. UPDATE emergency_number SET phonenumber = “(336) 555-1480”
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/08/2012 for the course ITT 650 taught by Professor Dewey during the Spring '11 term at UNC Asheville.

Ask a homework question - tutors are online