Unit 10 : SQL ( Part 2 ) Flashcards
1
Q
What keyword do we need to add to make changes to table structure?
A
- ALTER
- Add
- Modify
- Drop
- It can be used to change data type
2
Q
Some RDBMS ( Oracle ) do not permit changes to data types unless what?
A
- Column to be changed is empty
3
Q
What actions does some RDBMS impose restrictions on the deletion of an attribute?
A
- Use ALTER to drop down
4
Q
List out the useful functions that SQL provides
A
- Count
- Find minimum and maximun values
- Calculates averages
5
Q
List out the aggregate functions
A
- Count
- Min
- Max
- Sum
- Avg
6
Q
What is a view?
A
- A virtual table based on SELECT query
7
Q
What can a view contain?
A
- Columns
- Computed Columns
- Aliases
- Aggregate Functions
8
Q
How can we create a view?
A
- Using CREATE VIEW to generate view
9
Q
What is the most important disrinction between relational database and other databases?
A
- Ability to combine ( join ) tables on common attributes ( primary keys )
10
Q
When is JOIN performed?
A
- When data are retrieved from more than one table at a time
11
Q
What does JOIN is generally composed?
A
- Equality comparison between foreign key and primary key of related tables
12
Q
What can alias be used to?
A
- Identify source source table
- Any legal table name can be used as alias
13
Q
How to join tables with alias?
A
- Use the FROM clause
- FROM tablename alias
14
Q
What is aggregate functions?
A
- Special functions that perform arithmetic computations over a set of rows
15
Q
What does the ORDER BY clause used to?
A
- Sort output of SELECT statement
- Can sort by one or more columns and use either an ascending or descending order