Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
44 Cards in this Set
- Front
- Back
- 3rd side (hint)
What is a DBMS?
|
A Database Management System is a software package designed to maintain and utilize databases.
|
|
|
What are five reasons for using a DBMS?
|
*Data independence and efficient access * Data integrity and security * Uniform data administration * Concurrent access, recovery from crashes * Reduced application development time
|
|
|
What is a data model
|
A collection of concepts for describing data
|
|
|
What is a schema
|
a description of a particular collection of data, using the given data model
|
|
|
What is the relational model of data
|
Based on the concept of a relation, basically a table with rows and columns. Every relation has a schema which describes the columns or fields.
|
|
|
That are the different levels of abstraction?
|
Many different views, the conceptual (logical) schema and the physical schema
|
|
|
What is the Conceptual schema
|
Conceptual schema defines logical structure
|
|
|
What is the Physical schema
|
The Phys sch describes the files and indexes used
|
|
|
What is DDL?
|
Data definition language defines views and schemas;
|
|
|
What is logical data independence?
|
Protection for the application from changes in logical structure of data
|
|
|
What is Physical data independence?
|
Protection for the application from changes in the physical structure of the data.
|
|
|
What does ACID stand for ((very important))
|
Atomicity- all actions in the trans happen or none at all; Consistency- If each trans is consistent, and the DB starts consistent, it ends consistent; Isolation - Execution of one trans is isolated from that of other trans; Durability - If a transact commits, its effects persist
|
|
|
What component of the DBMS guarantees Atomicity & Durability?
|
The recovery manager
|
|
|
What is the motivation of concurrency control?
|
Consistency and Isolation
|
|
|
Define a relationship in an ER mode? What is a relationship set?l
|
Association among 2 or more entities;
|
|
|
What is a key constraint?
|
A restriction on a relationship that affects the key. Eg: an employee can work in many departments, a department can have only one manager per store.
|
|
|
What is a participation constraint?
|
This is a constraint that requires every key value in a table to participate in a relationship with another entity's key (total) or none at all (partial)
|
|
|
How is a participation constraint shown in the ER model?
|
Total participation is shown with a bold (or double) connector between relations, a partial participation is an unbolded line. A key constraint is an arrow toward the one in a one-to-many relationship.
|
|
|
What is a weak entity?
|
It can be identified uniquely only by considering the primary key of another (owner) entity.
|
|
|
What is an ISA hierarchy?
|
If we declare A ISA B, every A is a B; It is shown as a triangle with ISA inside.
|
|
|
What is the difference between an overlap and covering constraint?
|
In an ISA hierarchy, on overlap constraint determines if an employee can be both Hourly and Contract; Covering says whether and employee has to be one or the other.
|
isa
|
|
What is the reasons for using an ISA hierarchy?
|
To add descriptive attributes specific to a subclass and to identify entities that participate in a relationship; signifies inheritance
|
|
|
What is aggregation?
|
It allows us to treat a relationship set as an entity set for purposes of participation in (other) relationships; It is shown by a dotted rectangle around the aggregated entity set.
|
|
|
What is conceptual design?
|
It follows requirements analysis and uses ER diagrams.
|
|
|
What is the difference between cardinality and degree/arity?
|
Cardinality is the number of rows and fields is the degree/arity
|
|
|
What is a relation?
|
A relation is a set of distinct rows or tuples.
|
|
|
What is the current standard of SQL?
|
SQL-92; Nobody uses SQL-99 yet
|
|
|
How, in SQL, do you create a Students table with three fields?
|
CREATE TABLE Students (fieldone CHAR(20), fieldtwo CHAR(20), fieldthree INTEGER)
|
|
|
How do you get rid of a table? How do you alter it?
|
DROP TABLE Students
ALTER TABLE Students ADD COLUMN firstYear: INTEGER |
|
|
How do you add a tuple?
|
INSERT INTO Students (fieldone, fieldtwo, fieldthree)
VALUES (53699, 'Green', ITIS) |
|
|
How do you delete a tuple?
|
DELETE
FROM Students S WHERE S.name='Smith' |
|
|
To find all 18 year old students
|
SELECT *
FROM Students S WHERE S.age=18 |
|
|
What is an integrity constraint?
|
A condition that must be true for any instance of the database; Created when schema is defined; checked when relation in modified.
|
|
|
What is a domain constraint
|
integer, char or other datatype for a field
|
|
|
A set of fields is a key for a relation if:
|
No two distinct tuples can have the same values in all key fields and this is not true for any subset of the key.
|
|
|
What is a superkey? A candidate key?
|
A set of columns within a table whose values can be used to uniquely identify a row. A candidate key is a minimal set of columns necessary to identify a row.
|
|
|
How do you designate a primary key in SQL?
|
CREATE TABLE Enrolled (sid CHAR(20), PRIMARY KEY grade CHAR(20))
|
|
|
What is a foreign key?
|
A set of fields in one relation that is used to refer to a tuple in another relation. It must correspond to primary key of the second relation.
|
|
|
How do you designate a foreign key in SQL and why would you?
|
FOREIGN KEY (name, addr) REFERENCES Customer_info
Designating a foreign key helps to reinforce referential integrity and prevent invalid entries. |
|
|
What happens if a row with a non-existent foreign key is inserted
|
The insertion is rejected or assigned either a null or default foreign key
|
|
|
What happens to a record in Table2 if the primary key row in Table1 that matches to the Table2 foreign key is deleted?
|
Either delete all foreign key tuples that refer to it * disallow deletion of a primary key row that is referred to by a foreign key * assign it a default key * or set the foreign key to null.
|
|
|
How to create a View in SQL?
|
CREATE VIEW Viewname(field1, field2) as select s.field1, s.field2 from Students S where s.field1>3.0
|
|
|
True or False: When the owner entity is deleted, all owned weak entity must also be deleted.
|
True
|
|
|
How do you show a cascade delete?
|
When designating a foreign key:
FOREIGN KEY (ssn) REFERENCES Employees, ON DELETE CASCADE) |
|