Foundations of Relational SQL Flashcards
Why write SQL in a standard way whenever possible?
- It’s more portable between platforms
- Your knowledge is more portable”
SQL Server 70-461 01-01
What mathematical model is standard SQL based on?
The Relational Model
SQL Server 70-461 01-01
How is a relation, from the Relational Model, represented in SQL?
SQL is not able to perfectly represent a relation. However, its best attempt to represent a relation is with a table.
SQL Server 70-461 01-01
What two components is does a relation have?
A heading and a body
SQL Server 70-461 01-01
What does a heading consist of?
A heading consists of a set of attributes, which SQL attempts to represent with columns.
SQL Server 70-461 01-01
What two components should each attribute have to be relational?
- A name that is unique. To be relational no two attributes should have the same name
- An assigned type.
SQL Server 70-461 01-01
What order are the attributes in?
The attributes are not required to be in any specific order
SQL Server 70-461 01-01
What order will the attributes be in if you use a SELECT * statement?
They will be ordered based on the order in which they were defined when initially creating the table.
SQL Server 70-461 01-01
What does a body consist of?
A body consists of a set of tuples, which SQL attempts to represent with rows.
SQL Server 70-461 01-01
What two branches of mathematics are the foundation for the relational model?
- Set Theory
- Predicate Logic
SQL Server 70-461 01-01
What is a set?
A collection of distinct objects, called the elements of the set.
SQL Server 70-461 01-01
What is a proposition?
It is a declarative sentence that is true or false. Example, Paul lives in Minneapolis.
SQL Server 70-461 01-01
What is a declarative sentence?
A declarative sentence makes a statement and ends with a period.
SQL Server 70-461 01-01
What is a predicate?
Something having the form of a declarative sentence with parameters that are not yet known, so it cannot be decided whether it is true or false. Example, Paul lives in x.
SQL Server 70-461 01-01
How do you make a predicate into a proposition?
Supply values for the unknown parameters. So Paul lives in x becomes Paul lives in Minneapolis. Now you can decide whether the statement is true or not.
SQL Server 70-461 01-01