Exam 1.3 Flashcards
(29 cards)
What language are queries written in
declarative langauge
T or F DB optimize efficiency of running queries
T
T of F Null values are nuplicates
False null values do not count as duplicates
How does inserting into a table atheletes(aid, name , country , sport) work
you do values(x,x,x,x) wher eeach x is a value that belongs to the type specified in atheletes
T or F when inserting into table you need to specify the columns you are inserting into
False you can ommit the columns ex Atheletes() if the values are in the correct order that they are listed
T of F you can switch order of things inserted into tables
True but only if values inserted also matches
how does cross product work between 2 tables
rows in each of the tables will combine with the rows from the other tables
How do select statement work under the hood
they are just cross products and then use the constraints to filter out unwanted
How to define a view
Create view [viewname] ([vars you want in view])
after all that
as is used then after that is a query
T of F view can be directly modifiedd
False they must be dropped and recreated
In relational tables when there is one to many how is data stored and primary key represeted
you do not need an extra table you can store foreign key in table representing many side
how can participation constaints be shown in relational tables
they will have not null
How does ON DELETE NO ACTION work
usually used after foreign keys and makes the foreign key erference not able to be deleted til child is deleted
How are weak entities portrayed in tables
they have foreign key to parent element and they have on delete cascade
how is a weak entity primary key maintianed
their primary key is the combo of parent and their unique keyw
Principles of aggregration
You must keep primary key of all participation sets
What is not in SQL
<>
How do you define constaints
Constraint [cname]
Check [terms]
when does check constraint execute
every time table is modified
what does check constraint do for empty relation
evalues to true
Where are constraints defined
inside tables
What can be used for constraints across multiple functions
assertion and triggers
How are assertions created
CREATE ASSERTION [aname]
CHECK ((the assertion))
Which are better to use assertions or triggers
triggers because they cost less