lec 3 Flashcards

1
Q

table level of an sql search

A

get all data in a table

ex. Select * from Employees

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

record level of an sql search

A

get a particular record from a table

select * from Employees where EmployeeNO = 977

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

slice and dice

A

get selected records from a table
get selected attributes for all records from a table
get selected attributes from all records from a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Problems with Select *

A

gives all attributes in whatever order their stored internally
- might not be order your expecting
- might include attributes your not expecting
If someone adds that attribute you would also get that attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Format of a query

A

SELECT (DETERMINES OUTPUT)
FROM (LIST OF TABLES(source of data))
WHERE (CONDITIONS (determine records selected))
- results in a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Renaming headings

A

add AS to each attribute in select clause

ex. SELECT XXXX AS XXX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In Modifying results….

A

You should be able to use any properly formed expression that evaluates to a single value as one of the attributes in a select

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Some SQL operations

A

determines the first position, if any, at which one string, S1, occurs within another, S2.
returns the length of a given character string.

(truncate)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Data typing in a select

A

is based on the most appropriate data type available for the individual attribute

  • data type of an individual attribute is based on its data definition
  • data type of a computed value is established implicitly based on the data types involved in the computation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

implicit type conversions can occur in

A

expressions, fetch operations, single row select operations, inserts, deletes and updates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

CAST operator

A

SPECIFIES EXPLICIT TYPE CONVERSIONS

- allows you to change between reals and integers when presenting data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Sorting results

A

Add order by

Add Desc for reverse order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

summarizing results

A

use distinct and correct

  • distinct will give you a short listing of which types are in there (getting a set of different values of an attribute)
  • adding distinct forces sql processor to add unique rows
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Group by clause

A

creates a seperate group for each distinct value of some attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

having clause

A

restricts members in a group based on some conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly