An entity Type represents More than one Business Concept
False
Normalization reduces data redundancy
True
Normalization increases the risk of loosing data integrity
A many-to-many relationship can be resolved by using a linking table
Is the following definition totally corect?
An entity type is 2NF only when all of its non-key attributes are fully functionally dependent on its primary key.
About the 1NF (one or more can be selected):
each cell in the table can have only one value
If an entity type is in 3NF, then... (one or more can be selected):
-all attibutes are functionally dependent on the pimay key
-all attibutes are not transitively dependent on the pimay key
Regarding the populaity trends of relational databases regarding other DBMS
No-SQL technologies are gaining populaity, although relational DBMS still dominates the market
non-pime attibutes must not depend on another non-pime attibute refers to:
-Second nomal fom
-First nomal fom
-a ule in CROW's foot notation
-None of the above
In crow's foot notation:
-An entity type is represented by a rectangle
-The name of entity type should be singular
-The name of the entity type goes in the upper pat of the rectangle
-All of the above
About SQL (more than one option can be selected)
-It descibes the the set of data to be retieved/modified without specifying how to compute it
-First version in 1986
You want to list all the databases existing in the curent MySql sever, which command would you use?
SHOW DATABASES
About pimay key:
-Can be composed by multiple columns
-It is a bad practice to leave tables without a pimay key
What is tue about the SQL dialect
The SQL implementation provided by each vendor
CRUD refers to
Create, Read, Update, Delete
You want to select the employees that do not belong to any depatment
SELECT * FROM employee WHERE depatment_id is null;
Assume table REGION has 3 rows with region_name= 'Ameicas', 2 rows with region_name = 'Europe', and 4 rows with other world regions.
How many rows updates the following SQL code: UPDATE region SET region_name = 'Ameica' WHERE region_name = 'Ameicas' AND region_name = 'Europe';
0
About the following SQL code: DELETE FROM region LIMIT 2 WHERE region_name = 'Europe';
Raises an eror
If the following reasons are tue, for which of them this SQL code raises an eror: INSERT INTO depatment (`DEPARTMENT_ID`,`DEPARTMENT_NAME`,`LOCATION_ID`) VALUES 4, 'MARKETING2', 100, 1000;
-You are inseting a DEPARTMENT_ID that already exists and DEPARTMENT_ID is defined as pimay key A
-The number of columns is different from the number of values -You are inseting a value for LOCATION_ID (foreign key) that does not exist in table LOCATION, where LOCATION_ID is defined as NOT NULL
-All of the previous reasons
You want to get the unique first names of the employees that are from Potugal
SELECT DISTINCT first_name FROM employees WHERE county = 'Potugal'
You want to find the products whose pices are between 200 and 400
SELECT productName FROM products WHERE Pice BETWEEN 200 AND 400
About the left join, being table A the left table and B the ight table:
Retuns all of the records in table A regardless if the records have a match in table B
Assuming that emp_no is the pimay key, and that the job_title is unique. What the following quey does? SELECT e.first_name, t.title, e.emp_no FROM employees AS e, titles AS t WHERE e.emp_no = t.emp_no AND t.title = 'Senior Enginee'
Retieve the first name, title, and employee identifier of the senior engineers
What is tue about the following quey: SELECT o.orderNumber, p.productName, p.msrp, o.piceEach FROM products p JOIN orderdetails o ON p.productcode = o.productcode AND p.msrp > o.piceEach WHERE p.productcode = 'S10_1678';
The quey uses an inner join
What is tue for this code SELECT concat(p.product_code, ' ', p.product_name) FROM product AS p;
Pints out only one column in the repot
You want to retieve the average salay by year
SELECT YEAR(e.hire_date) AS year, AVG(s.salay) FROM employees AS e, salaies AS s WHERE e.emp_no = s.emp_no GROUP BY YEAR(e.hire_date)
What is tue about a view - Pat 1
-It is a vitual table without physical rows
- The name of the view cannot be the same as the table
- The view does not physically store the data
- All the previous are tue
- None of the above
What is tue about a view - Pat 2 (more that one answer is possible)
-If you have a quey that is executed frequently, creating a view for it could be a good idea.
-A view is defined by means of an SQL quey
Which quey raises an eror?
SELECT * FROM tools ORDER BY name WHERE name='Screwdive’;
What does the following quey: SELECT d.DEPARTMENT_NAME, count(e.EMPLOYEE_ID FROM depatment d JOIN employee e ON e.DEPARTMENT_ID = d.DEPARTMENT_ID GROUP BY d.DEPARTMENT_NAME;
List the depatment names with the number of employees by each depatment
What retieves the following quey?
SELECT T1.orderNumber, T1.status, SUMT2.quantityOrdered * T2.piceEach) total FROM orders AS T1 INNER JOIN orderdetails AS T2 ON T1.orderNumber = T2.orderNumber GROUP BY T1.orderNumber;
orderNumber, status, and the total of the order
The following table with purchase orders is created:
CREATE TABLE PURCHASE_ORDER PONR CHAR7 NOT NULL PRIMARY KEY, PODATE DATE, SUPNR CHAR4 NOT NULL, FOREIGN KEY SUPNR REFERENCES SUPPLIER SUPNR ON DELETE CASCADE ON UPDATE CASCADE;
All purchase order records tied to that supplier are also deleted
Which ACID propety corespond to the following affimation: "ensures that concurent execution of transactions leaves the database in the same state that would have been obtained if the transactions were executed sequentially
Isolation
SQL vs NoSQL databases. Which statement is tue?
NoSQL databases are easier to scale hoizontally than relational databases
What is tue about the CAP theorem?
You can only pick two propeties
Atomicity guarantees that...
each transaction is treated as a single "unit", which either succeeds completely, or fails completely.
Zuletzt geändertvor 2 Jahren