Database independent code to data Flashcards

1
Q

Name the 3 parts of SQL

A

DML - Data manipulation
DDL - Data definition
DCL - Data Control

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

What parts of SQL does Open SQL cover?

A

A small part of DML.

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

What part of SQL is handled in SAP by the data dictionary

A

Only a small part of DDL

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

How much of DCL is implemented in SAP prior to NW 7.4 sp05?

A

Almost nothing. The DCL would normally be used for user control but in SAP the database only knows one user

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

What is the single database user of an SAP system

A

The user is SAP{sid} or SAPR3. All data is stored in this accounts schema

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

What are two examples of differences in new Open SQL

A

Fields must be comma separated, Host variables must be used

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

In new Open SQL mathematical operations are available on all operand types?

A

False, there are many limitations. For example, MOD is only allowed on types I and P without decimals. I believe AVG must always be cast to type F

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

The CDS consist of what three things?

A

DDL
QL (from the ABAP code)
DCL

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

In comparison to ABAP DICTIONARY views, what additional functions do CDS views

A

Outer joins and unions are supported
Calculation expressions, aggregations, and groupings are supported
Nested views are supported

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

From least to most advanced, list the ways views can be created

A

SE11
CDS
SQL92
HANA Column views

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

CDS views support all facets of SQL92 and HANA specific features?

A

That’s a big “NO” on both accounts

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

What is the path in eclipse to create a CDS

A

From the ABAP project

New->Other ABAP object->Dictionary->Data Definition

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

It is not possible to see the CDS view in the ABAP dictionary?

A

False, the CDS view shows up in the dictionary as a DDL SQL View with the name given in the CDS definition as the sqlViewName.

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

The sqlViewName is always the same as the name given in the “define view” statement?

A

It is never the same. Both names must be unique across the system

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

There are two ways to see the native SQL used to create the CDS view on the database. What are they?

A

From the ABAP dictionary extras->create

From the CDS definition press F3 while on the sqlViewName. Click on the presented link

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

CDS views cannot be buffered!

A

Of course they can

buffering. status
buffering. type

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

How can reference information, such as currency and unit of measure info be added to a CDS definition?

A

Using annotations such as
@semantics.amount.currencyCode: ‘CURRENCY’
@semantics.currencyCode: true

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

By default, CDS views are client dependent?

A

True, but this can be changed on each individual CDS by setting
@ClientDependent: ‘false’

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

In a CDS can CAST expressions be nested?

A

No

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

What does CDS stand for?

A

Core Data Services

21
Q

What does the COALESCE do?

A

Can replace null values in a list

22
Q

Cast types in CDS views are defined using

A

abap. decfloat34
abap. cuky
abap. fltp……

23
Q

You can use either he CDS view name or the SQL view name in the SELECT clause?

A

Not anymore, only the CDS view name can be used as of NW7.5

24
Q

When using an exposed association over an adhoc association, what advantage is gained?

A

The entire exposed association can be referenced by name instead of individual columns

25
Q

I don’t understand how to use exposed associations

A

It seems like a new view can select from another CDS view and the associations can be addressed simply

26
Q

When using path expressions what must the association names be prefixed with? This seems to be related to addressing association fields from ABAP

A

A backslash _association-field

27
Q

I don’t understand the difference between exposed and ad-hoc associations

A

An adhoc is a list of fields from the associated table or view or cds
An Exposed is the entire row. The pre-req for the exposed is to have the “on” field from the left hand side of the association listed as the field above the associated entity in the field list.
This EXPOSES the entire entity row of the associated entity

28
Q

You can use SELECT * when employing a UNION or UNION ALL

A

No

29
Q

A field of the right table must be included in the ON clause?

A

It says no but I don’t understand how that works

30
Q

INTO no longer needs to be at the end of the Select

A

True except in UNIONS where it must still be the last clause

31
Q

DCL source is?

A

The data control represented in the ABAP dictionary

32
Q

What is the difference between an Association and a View

A

Associations use foreign key relationships to avaid having to define the view relationship

33
Q

What is the difference between an Association and a View

A

Associations use foreign key relationships to avaid having to define the view relationship
An Association can specify cardinality

34
Q

Where can an association be used

A

in all places where table names or column names are used

35
Q

How can exposed associations be used

A

In data preview, and also in subsequent CDSs. From open SQL they can be addressed thru path expressions

36
Q

Is it possible to extend an existing CDS view without modification?

A

Yes, use the EXTEND functionality

37
Q

Parameters of a CDS must be of what type?

A
Predefined or data element
examples
WITH PARAMETERS
FIRSTNAME: type bname
MYAGE: type abap.int8
38
Q

Parameters of a CDS must be of what type?

A
Predefined or data element
examples
WITH PARAMETERS
FIRSTNAME: type bname,
MYAGE: type abap.int8
39
Q

True or false, the parameters in the parameter list must be comma separated?

A

True

40
Q

How can a system variable be used as a CDS parameter?

A

Using the annotation

@Environment.SystemField: #{sys field}

41
Q

How can a system variable be used as a CDS parameter?

A

Using the annotation
@Environment.SystemField: #{sys field}
THIS ONLY WORKS IF THE CDS IS ACCESSED THRU OPEN SQL

42
Q

When a CDS uses another CDS that has input parameters, how are the parameters passed?

A

as comma separated value pairs enclosed in parentheses.
e.g.
( firstname ‘Bob’, lastname ‘Heide’)
System filled parameters DO NEED to be passed

43
Q

When Open SQL uses a CDS that has parameters, how are the parameters passed?

A

as comma separated value pairs enclosed in parentheses.
e.g
( firstname = ‘Bob’,
lastname = ‘Heide’ )
System filled parameters do not need to be passed

44
Q

How can access control be implemented for CDSs?

A

Access control is implemented by
Defining a role and granting access to the CDS
The values are as an aspect in a standard authority check

45
Q

What is the only current auth aspect that is supported

A

pfcg_auth

46
Q

For authorizations, two annotations are available in the DCL. What are they and what do they mean?

A

@EndUserText.label: ‘this is the role text’

@MappingRole: role is assigned to all users regardless of client. Only value allowed is true

47
Q

For authorizations, one annotation with three options is allowed in the DDL of the CDS. Name them and what they do.

A
@AccessControl.authorizationCheck
#CHECK means perform the access control using the assigned role.  Syntax error if no role assigned
#NOT_REQUIRED is just like #CHECK but does not give a syntax error if no role is assigned
#NOT_ALLOWED gives a syntax check warning if a DCL is assigned
48
Q

What must every CDS role contain?

A

@MappingRole: true