SQL_RelationalAlg Flashcards
Is SQL case sensitive?
Case convention
• SQL is completely case insensitive.
Upper-case or Lower-case makes no
difference. We will use case in the
following way:
– UPPERCASE marks keywords of the SQL
language.
– lowercase marks the name of an attribute.
– Capitalized marks the name of a table.
How to Create and Drop Tables?
What are Table declaration elements?
Why add NOT NULL when creating tables?
How to declare keys?
How to add Primary Key SQL?
How to code foreign keys?
Rules concerning Foregin Keys.
Code in SQL.
Another Example
How to use value constraints?
Add value constraint that the period is an INT for period 1:4.
Another Check Constraint for the Period being an INT of values 1-4.
How to insert data to this table?
Why is one of those illegal?
CREATE TABLE GivenCourses (
course CHAR(6) REFERENCES Courses,
period INT CHECK (period IN (1,2,3,4)),
numStudents INT,
teacher INT REFERENCES People(ssn) NOT
NULL,
PRIMARY KEY (course, period)
);
How to Delete rows from Table.
How to update tables.
What is a Query? What is the difference between query and modifications?
What does SQL means?
How is Algebra defined in this context?
What is relational algebra?
Explain Selection (Relational Algebra).
Which operations is denoted with a sigma?
Explain Projection (Relational Algebra).
Which operation is denoted with a pi?
What are Cartesian Products?
What are Joining relations?
What does this symbol represent?
Explain Natural Join.
What does this specific symbol represent?
Explain Sets or Bags.
Differences between sets and bags?
Method for selecting from a specific table with conditions.
How does query result look?
Translate to Relation Algebra Expression.
Translate.
Translate to Relational Algebra.
Translate.
Translate.
Explain Subqueries.
Why renaming attributes?
Why renaming relations?
Explain Renaming in Relational Algebra.
Explain the following expression.
Explain Sequencing.
Explain views.
Create a view DBLectures containing room, weekday and hour from the table Lectures. The course should be TDA357 and the period should be 3. Then query the weekday from the view based on the room HC1.
Explain the WHERE clause.
How to test for membership.
What does this mean?
How do you test for existence?
What does this mean?
What is a correlated query?
What are ordinary comparisons?
Meaning?