1.
Vilket eller vilka påståenden är sanna:
Correct Answer
B. Eftersom datamodellen ska utgöra ett stöd för verksamhetens affärsprocesser så måste affärsprocesserna beskrivas innan vi kan tillverka en datamodell.
Explanation
The correct answer is that the business processes must be described before we can create a data model because the data model is intended to support the business processes. This means that the data model should be based on and aligned with the way the business operates, so understanding the business processes is necessary in order to design an effective data model.
2.
Studera nedanstående bild som föreställer en ofylld blankett från skatteverket. Vad representerar bilden?
Correct Answer
B. Metadata
Explanation
The image represents metadata. Metadata refers to the information about the data, such as the date it was created, the author, or the file size. In this case, the image is a blank form from the tax authorities, and the metadata would include details about the form, such as its purpose or the version number.
3.
Vilken av följande constraints kallas även för referensintegritet:
Correct Answer
B. Foreign key
Explanation
A foreign key is a constraint that ensures referential integrity in a relational database. It is used to establish a link between two tables by referencing the primary key of one table as a foreign key in another table. This constraint ensures that the values in the foreign key column of the referencing table match the values in the primary key column of the referenced table. By enforcing this constraint, it guarantees that the data in the referencing table is consistent and maintains the integrity of the relationship between the two tables.
4.
Hur ska vi använda oss av commit när vi jobbar med SQL? Vilket av nedanstående alternativ är rätt?
Correct Answer
B. Update kund
set enamn = 'Ekholm'
where knr = 199;
commit;
Explanation
Both alternatives a and b are correct.
5.
Om vi vill se artnr, artnamn, pris för de artiklar som har ett pris som är högre än medelpriset för alla artiklar. Vilken av följande SQL-satser är då korrekt?
Correct Answer
A. Select artnr,artnamn,pris
from artikel
where pris > (select avg(pris)
from artikel);
Explanation
The correct answer is "select artnr,artnamn,pris
from artikel
where pris > (select avg(pris)
from artikel);"
This answer correctly uses the WHERE clause to filter the rows based on the condition that the price (pris) is greater than the average price (avg(pris)) of all the articles in the table. It retrieves the columns artnr, artnamn, and pris from the artikel table.
6.
Om vi vill se knr och antalet ordrar som varje kund har. Vilken av följande SQL-satser kommer att hämta korrekt information?
Correct Answer
E. Select knr,count(ordnr)
from kundorder
group by knr;
Explanation
The correct answer is "select knr,count(ordnr) from kundorder group by knr;". This query will retrieve the customer number (knr) and the count of orders (ordnr) for each customer from the table "kundorder". The "group by knr" clause ensures that the count is calculated per customer, rather than for the entire table.
7.
Vilket av följande påståenden är sant vad gäller referensintegritet?
Correct Answer
C. En främmande nyckel som inte tillåts vara NULL, måste matcha ett exakt värde i primärnyckeln i den tabell den främmande nyckeln refererar till.
Explanation
The correct answer states that a foreign key that is not allowed to be NULL must match an exact value in the primary key of the table it refers to. This means that when a foreign key is used to establish a relationship between two tables, the value of the foreign key in one table must exist as a primary key value in the referenced table. This ensures that the integrity of the relationship is maintained and prevents any inconsistencies or orphaned records.
8.
Vilket av följande alternativ gällande NULL är sant?
Correct Answer
D. NULL + 564 blir NULL
Explanation
The given statement is true because any arithmetic operation involving NULL will result in NULL. In this case, adding 564 to NULL will still result in NULL.
9.
Nedanstående PLSQL kod har en inbyggd felhanteringsdel: declare x number(5);begin select count(knr) into x from kund where 1 = 4; dbms_output.put_line('Olle');exception when no_data_found then <- Kommer aldrig kastas dbms_output.put_line('Kalle');end; Vad skrivs ut?
Correct Answer
A. Olle
Explanation
The code will raise a "no_data_found" exception because the condition "1 = 4" in the WHERE clause will never be true. Therefore, the select statement will not return any rows and the exception block will be executed. As a result, the message "Olle" will be printed using the dbms_output.put_line function. The message "Kalle" will not be printed because the exception block will handle the exception and the code will not continue to execute after the exception block.
10.
Påstående: Alla databasservrar består av:Memory (minne)Processes (bakgrundsprocesser)Storage (lagring, filer på disk) Påståendet är:
Correct Answer
A. Sant
Explanation
The given statement is true. It states that all database servers consist of memory, processes, and storage. This means that in order for a database server to function properly, it needs memory to store data and perform operations, processes to handle background tasks and queries, and storage to store data on disk.
11.
I dokumentet A framework for analysing, modelling, and designing business processes, beskriver Bo Sundgren en affärsprocess ur tre olika perspektiv. Vilka är dessa tre perspektiv? Besvara frågan genom att ange vilket av nedanstående alternativ som är korrekt:
Correct Answer
A. Vad processen gör, hur detta går till och varför man gör på det sättet.
Explanation
The three perspectives described by Bo Sundgren in the document are: what the process does, how it is carried out, and why it is done in that way.
12.
Är nedanstående tabellen RÄNTEÄNDRING en implementation av Langefors elementarmeddelande (e-message)?
Correct Answer
A. Ja
Explanation
The given correct answer is "Ja" which means "Yes" in Swedish. However, without any context or information about the table "RÄNTEÄNDRING" or the Langefors elementarmeddelande (e-message) implementation, it is difficult to provide a specific explanation. It is possible that the table "RÄNTEÄNDRING" is indeed an implementation of the Langefors elementarmeddelande and the answer "Ja" indicates that it is correct. Without further information, this is the best explanation that can be provided.
13.
Följande påstående: ” tillåter alltid DML-operationer mot underliggande bastabell” gäller för:
Correct Answer
A. Enkla vyer
Explanation
Enkla vyer tillåter alltid DML-operationer mot underliggande bastabell.
14.
Vilket av följande påståenden är sant:
Correct Answer
B. Eftersom datamodellen ska utgöra ett stöd för verksamhetens affärsprocesser så måste affärsprocesserna beskrivas innan vi kan tillverka en datamodell.
Explanation
The correct answer states that the business processes need to be described before creating a data model because the data model is intended to support the business processes. This means that understanding the business processes is essential in order to design a data model that accurately represents and supports those processes.
15.
Om vi skapar flera olika rowtriggers till en tabell som ska starta before insert på tabellen. Hur vet vi i vilken ordning dessa triggrar kommer att exekvera? Vilket av nedanstående påstående om detta är korrekt? Triggrarna kommer att exekvera:
Correct Answer
B. I en slumpvis ordning.
Explanation
The correct answer is that the triggers will execute in a random order. This means that there is no guarantee of the sequence in which the triggers will be executed when multiple row triggers are created for a table with a before insert action.
16.
PK, Primary key eller primärnyckelNär man i praktiken väljer eller utformar identifierande variabler, kan man välja mellan helt konstruerade, artificiella identifikationsbegrepp och mer eller mindre naturliga. Vilket av följande påståenden är korrekt gällande entitetsintegritet (= Primary key):
Correct Answer
A. Det viktigt att identifierare (PK) är stabila på instansnivå. D.v.s. att de inte behöver förändras under objektens (radernas) livsförlopp.
Explanation
The correct answer states that it is important for primary keys (PK) to be stable at the instance level, meaning that they should not need to be changed throughout the lifespan of the objects or rows. This is important for maintaining entity integrity, as the primary key is used to uniquely identify each record in a database table. If the primary key were to change, it could lead to inconsistencies and errors in the data. Therefore, having stable primary keys ensures the integrity and reliability of the database.
17.
Vilket av följande påståenden om relations-vyer är sant?
Correct Answer
C. En vy kan användas som en mekanism för att upprätthålla säkerhet. Detta då olika roller endast kan få rätt att komma åt vyobjekten och inte underliggande bastabeller.
Explanation
The statement states that a view can be used as a mechanism to maintain security by granting different roles access to view objects instead of underlying base tables. This means that users with different roles can be restricted from accessing the underlying data directly but can still access the data through the view. This helps in controlling and managing the security of the database.
18.
I en databas finns en kundorder som har orderdatum = 2015-02-65. Hur kan detta vara möjligt? Vilken av nedanstående förklaringar kan vara rätt:
Correct Answer
A. Det är fel datatyp på kolumnen orderdatum
Explanation
The given answer suggests that the reason for the incorrect order date in the database is that there is a wrong data type assigned to the "orderdatum" column. This means that the column is not properly configured to accept and store the correct format of the date, resulting in an invalid date being stored.
19.
Kan man säga att datatyper är constraints?
Correct Answer
A. Ja, då de medför begränsningar för den data som kan lagras i en tabell.
Explanation
The correct answer is "Ja, då de medför begränsningar för den data som kan lagras i en tabell." This is because datatyper (data types) in a database define the type of data that can be stored in a table column, and they impose constraints on the values that can be entered. For example, a column with a data type of "integer" can only store whole numbers, while a column with a data type of "varchar" can store character strings of a certain length. Therefore, datatyper can be considered as constraints because they restrict the type and format of data that can be stored in a table.
20.
Studera följande funktion som används för inloggning: Den jobbar mot kundtabellen på sid. 2. create or replace procedure loggaInreturn numberisv_kontroll number(1);beginselect count(knr)into v_kontrollfrom kundwhere knr = p_knr and password = p_password; return v_kontroll;end;/ Kommer funktionen loggaIn att exekvera utan problem vid nedanstående proceduranrop? Select loggaIn(101,'qwerty')From dual;
Correct Answer
B. Nej, det kommer inte att fungera.
Explanation
The given function loggaIn is a procedure that takes two parameters, p_knr and p_password, and returns a number. It selects the count of knr from the kund table where knr is equal to p_knr and password is equal to p_password. The result is stored in v_kontroll variable and returned. However, in the provided procedure call loggaIn(101, 'qwerty') from dual, the values 101 and 'qwerty' are not declared or defined as the parameters p_knr and p_password. Therefore, the function will not execute successfully.
21.
Vad kan vi åstadkomma med DDL-satser?
Correct Answer
B. Vi kan förändra själva tabellobjektets egenskaper
Explanation
The correct answer states that with DDL statements, we can change the properties of the table object. DDL (Data Definition Language) statements are used to define and modify the structure of database objects such as tables, views, functions, procedures, etc. These statements allow us to add, modify, or delete columns, constraints, indexes, and other properties of a table. Therefore, the answer accurately describes one of the capabilities of DDL statements.
22.
Vilket/vilka av följande påståenden är sanna för datatypen date:
Correct Answer(s)
A. Date + number = date
B. Date - date = number
C. Date - number = date
Explanation
The given answer is correct. In the data type "date", adding a number to a date will result in a new date. Similarly, subtracting one date from another will give the difference in terms of a number, representing the number of days between the two dates. Lastly, subtracting a number from a date will again result in a new date.