IS620

IS620 - 1 Recap of Relational Model & SQL n...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: 1 Recap of Relational Model & SQL n Relational Model n Keys, foreign keys n SQL n Data Definition Language (how to create a table) n Selectfromwhere n Joins n Aggregate functions n Insert, update, delete n String and time operation 2 Keys n Key is a set of attributes that identify a unique tuple of each possible relation. n How many primary keys can a table have? Jones Smith cust-name Cust-id 1 2 '05/1/1' '05/2/1 Order-date OID 1 2 Cust-id 1 1 3 Foreign Keys n Foreign keys are used represent relationships and link tables n Foreign means the key is copied from the primary key of another table. Jones Smith cust-name Cust-id 1 2 '05/1/1' '05/2/1 Order-date OID 1 2 Cust-id 1 1 4 Recap of Relational Model & SQL n Relational Model n Keys, foreign keys n SQL n Data Definition Language (how to create a table) n Selectfromwhere n Joins n Aggregate functions n Insert, update, delete n String and time operation 5 Create Table n An SQL relation is defined using the create table command: create table table-name ( attribute-name type, attribute-name type , integrity_constraint1, ..., integrity_constraintk) 6 Domain Types in Oracle-SQL n char(n). Fixed length character string, with user_specified length n. n varchar(n). Variable length character strings, with user_specified maximum length n. How do you choose between char and varchar? 7 Domain Types in Oracle-SQL n int Integer n Number Fixed point number n float Floating point number n Null values are allowed in all the domain types. Declaring an attribute to be not null prohibits null values for that attribute . 8...
View Full Document

Page1 / 26

IS620 - 1 Recap of Relational Model & SQL n...

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

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