Shared Flashcard Set

Details

DBMS Chapter 5
Data Languages in a Relational Environment
61
Other
Graduate
01/15/2015

Additional Other Flashcards

 


 

Cards

Term
Logical database design
Definition
creation of a logical schema and external schemas in the data model of the selected DBMS by mapping the conceptual schema
Term

System-independent mapping

(LogDataDesign)

Definition
does not consider any specific characteristics or special cases that apply to the DBMS implementation of the data model
Term
Tailoring to DBMS
Definition
adjust the schemas to exploit DBMS-specific modeling features and constraints in order to improve performance and/or semantic richness
Term
Physical database design
Definition
The process of choosing specific storage structures and access paths for the physical database files to achieve good performance for the various DB applications
Term
SQL as DDL
Definition
  1. Locial schema: "create table"
  2. Physical schema: "create database","create tablespace","create index"
  3. External schema:"create view" 
Term
SQL as DML
Definition
  1. Select...from...where
  2. Insert...into...
  3. Update...where...
  4. Delete where...
Term
Referential Triggered Action Clauses
Definition
Specified action to be taken if a referential integrity constraint is violotaed upon delete of a referenced tuple or modification of a referenced primary key value 
 
ON DELETE | ON UPDATE
SET NULL | CASCADE | SET DEFAULT | RESTRICT
Term
DROP SCHEMA COMPANY CASCADE
Definition
Automatical drops objects that are contained in the schema
Term
DROP SCHEMA COMPANY RESTRICT
Definition
refused to drop the schema if it contains any objects (default)
Term
DROP TABLE COMPANY CASCADE
Definition
automatically drop objects that depend on the table
Term
DROP TABLE COMPANY RESTRICT
Definition
refused to drop table if any objects depend on it (default)
Term
ALTER TABLE
Definition
  • adds of drops columns
  • changes colomn defenitions 
  • add or drop table constraints
  • ALTER TABLE EMPLOYEE ADD JOB VARCHAR(12);
Term
Relational Algebra
Definition
defines operators on relations to specify a retrieval request
Term
Relational Calculus
Definition
defines declarative expressions to specify a retrieval request
Term
SELECT-FROM-WHERE structure
Definition

SELECT <attribute list>

FROM <table list>

WHERE <condition>;

Term
INSERT
Definition

INSERT INTO EMPLOYEE(FNAME, LNAME, DNO, SSN)

VALUES  ('Richard', 'Marini', :DEPNUMBER, '653298653');

Term
Use of Asterisk
Definition
Get all attributes
Term
Joined Tables
Definition

Retrieve the name and address of all employees who work for the 'Research' department.

 

SELECT FNAME, LNAME, ADDRESS

FROM (EMPLOYEE JOIN DEPARTMENT ON DNUMBER = DNO)

WHERE DNAME = 'Research';

Term
Unspecified WHERE-clause
Definition

Select all EMPLOYEE SSNs

SELECT SSN

FROM EMPLOYEE;

 

Term
Elminating Duplicate Queries
Definition
SELECT DISTINCT SALARY FROM EMPLOYEE
Term
UNION
Definition

Make a list of project numbers for projects that 

involve an employee whose last name is 'Smith', 

either as a worker or as a manager of the 

department that controls the project.

 

(SELECT DISTINCT PNUMBER

FROM PROJECT, DEPARTMENT, EMPLOYEE

WHERE DNUM = DNUMBER

AND MGRSSN = SSN

AND LNAME = 'Smith')

UNION

(SELECT DISTINCT PNUMBER

FROM PROJECT, WORKS_ON, EMPLOYEE

WHERE PNUMBER = PNO

AND ESSN = SSN

AND LNAME = 'Smith');

Term
Substring Comparison
Definition

Retrieve all employees whose address is in Houston, Texas

 

SELECT FNAME, LNAME

FROM EMPLOYEE

WHERE ADDRESS LIKE '%HOUSTON,TX%'

Term
ORDER BY-clause
Definition
ORDER BY DNAME DESC, LNAME ASC, FNAME ASC;
Term
Nested queries:Scalar Subquery
Definition

Retrieve the first name and last name 

of all employees working in the 

department ‘Research’

 

SELECT FNAME, LNAME

FROM EMPLOYEE

WHERE DNO =  

(SELECT DNUMBER

 FROM DEPARTMENT

              WHERE DNAME = 'Research'

Term
Correlated nested queries
Definition
WHERE-clause of a nested query references some attribute of a relation declared in the outer query
Term
EXISTS
Definition

Retrieve the name of each employee who has a dependent with the same first name and sex as the employee

 

SELECT E.FNAME, E.LNAME

FROM EMPLOYEE E

WHERE EXISTS   (SELECT *

     FROM DEPENDENT

     WHERE E.SSN = ESSN

     AND E.SEX = SEX

     AND E.FNAME = DEPENDENT_NAME);

 

Term
NOT EXISTS
Definition

Retrieve the names of employees who 

have no dependents

 

SELECT FNAME, LNAME

FROM EMPLOYEE

WHERE NOT EXISTS  (SELECT *

              FROM DEPENDENT

              WHERE SSN = ESSN);

Term
Checking for null values
Definition

WHERE....IS NULL

WHERE...IS NOT NULL

Term
Types of joins
Definition
  • inner join
  • left outer join
  • right outer join
  • full outer join
Term

INNER JOIN

(default)

Definition
a tuple is included in result only if a matching tuple exists in the relation
Term
LEFT OUTER JOIN
Definition
all tuples of first table are included
Term
RIGHT OUTER JOIN
Definition
all tuples of second table are included
Term
FULL OUTER JOIN
Definition
all tuples of both tables are included
Term
Aggregate functions
Definition

Used after SELECT-clause or HAVING-clause

COUNT,SUM,MAX,MIN,AVG

Term
GROUP BY-clause
Definition

allows to apply aggregate function to subgroups of tubples in a relation based on an attribute value

 

SELECT DNO, COUNT(*), AVG(SALARY)

FROM EMPLOYEE

GROUP BY DNO;

Term
HAVING
Definition
condintion on the groups being selected
Term
Specification of views
Definition
  • virtual tables
  • consists of formula that determines which attributes from base table are shown
Term
Query modification
Definition
queries on views are modifed into queries on the underlying base tables
Term
view materialisation
Definition
temporary physical table created when the view is first queried
Term
Requirements for views to be updatable
Definition
  • No DISTINCT
  • no aggregate functions
  • only one table in FROM
  • no correlated subquery
  • no GROUP BY
  • no UNION, INTERSECT or EXCEPT
Term

View

(WITH CHECK OPTION)

Definition
allows to you to avoid an insert or update through a view that would leave it unretrievable through the view. UPDATE and INSERT statements are checked for conformity with the view definition
Term
authorisation identifier
Definition
referes to a user account or a group of user accounts. The DBMS must provide selective access to relation in the DB based on the spefic accounts
Term
Account Level
Definition
the DBA specifies the particular privlleges that each account holds independently of the tables in the database
Term
Table level
Definition
one can control the privileges to access each individual table or view in a DB
Term
Tramsactions
Definition
an atomic unit of work that is either completed in its entirety or not done at all
Term
BEGIN_TRANSACTION
Definition
marks beginning of the transactions
Term
END_TRANSACTION
Definition
specifies that read and write operations have ended and marks the end of the transaction
Term
COMMIT_TRANSACTION
Definition
signals a succesful end of the transaction
Term
ROLLBACK(or ABORT)
Definition
signals transacton has ended unsucessfully
Term
ACID properties
Definition
  • atomicity 
  • consistency preservation
  • isolation
  • durability
Term
Atomicity
Definition
transaction is an atomic unity of processing
Term
Consistency preservation
Definition
a transaction is consistency preserving if its complete execution takes the databse from one consistent state to another
Term
Isolation
Definition
a transaction should appear as though it is being executed in isolation from other transactions
Term
Durability
Definition
changes applied to the database by a commited transaction must persit in the database
Term
SQL delimiters
Definition

seperate the SQL instructions to be processed by the precompiled from the native host language

"#SQL"

Term
Host Language Variables
Definition
variable declared in host language that can be accessed in embedded SQL instructions to pass data from SQL to host language and vice versa
Term
output host variabe
Definition
used to pass database data to the applcation
Term
input host variable
Definition
assigned value by application code and then used in SQL
Term
Cursors
Definition
allow for the tuples that result from SQL query to be presented to the application code one by one
Supporting users have an ad free experience!