NEW
Font size
Worksheetsбаза
Total questions: 70
Worksheet time: 35mins
Choose the right order of the database design phases
Subject area analysis, Conceptual Design, Logical Design, Physical Design
Conceptual Design, Logical Design, Physical Design, Queries Implementation
Subject area analysis, Logical Design, Conceptual Design, Physical Design
Conceptual Design, Logical Design, Physical Design, DBMS Selection
Which one of the following sorts rows in SQL?
GROUP BY
SORT BY
ALIGN BY
ORDER BY
SQL query and data modification commands make up a(n) ____
TCL
DDL
DCL
DML
Which of the following multi-row operators can be used with a subquery?
ANY
IN
All of the given
ALL
The SQL BETWEEN operator...
Specifies which tables we are selecting from
Specifies a range of values
Specifies primary and foreign keys
Specifies which columns we are selecting from
In ER Diagram by Chen's notation a relationship type is represented by...
Rectangle
Rhombus
Ellipse
Triangle
LIKE operator uses __ and ___
percent sign (%); underscore (_)
question mark (?); asterisk (*)
underscore (_); question mark (?)
asterisk (*); percent sign (%)
The SQL DROP TABLE clause is used to ...
delete a column from the database
delete a row from the table
delete a table from the database
delete a relationship from the database
Union R1 R2 is ...
the relation containing all tuples of R1 that do not appear in R2
the relation containing all tuples that appear in R1, R2, or both
the relation containing all tuples that appear only in both R1 and R2
the relation containing all tuples of R2 that do not appear in R1
If on the chart Table A is on the left side and Table B is on the right side, a right outer join will include in its answer ...
Only the rows for which the values of the two tables' common attribute match exactly
All rows from both Table A and Table B
All the rows from Table B, with the corresponding details of Table A for those rows for which the value of the two tables' common attribute match exactly
All the rows from Table A, with the corresponding details of Table B for those rows for which the values of the two tables' common attribute match exs
Which of the following are considered as DBMS?
PostgreSQL, MS Excel, Oracle, MS SQL Server
PostgreSQL, Access, Oracle, MS Word
PostgreSQL, Access, Oracle, MySQL
PostgreSQL, Access, Oracle, MS Excel
With SQL, how do you select a column named FirstName from a table named Persons?
EXTRACT FirstName FROM Persons;
GET FirstName FROM Persons;
SELECT FirstName FROM Persons;
SELECT Persons.FirstName;
With SQL, how do you select a column named Firstname from a table named Persons?
EXTRACT Firstname FROM Persons;
GET First flame FROM Persons,
SELECT Firstname FROM Persons,
SELECT Persons.First flame;
Which SQL function is used to retrieve a maximum value?
MOST
UPPER
TOP
MAX
Which af the following is an SQL aggregate function?
BETWEEN
ALTER
CHEATER
MIN
Subqueries can be used with the following statements ...
SELECT, INSERT, UPDATE, DELETE
only INSERT, UPDATE, DELETE
only SELECT
only CREATE TABLE
The selection operation in relational algebra is identical to the __ clause in SQL
ORDER BY
SELECT
WHERE
FROM
Insert three rows into the 'employees' table.
INSERT INTO Employees
SELECT Employees
UPDATE Employees
DELETE FROM Employees
Select all employees who were hired before 2022-01-01
WHERE HireDate
ORDER BY HireDate
GROUP BY HireDate
FROM HireDate
For a relation to be in 3NF, it should not contain __ attribute that is transitively dependent on __
a non-primary key, the primary key
a primary key, a non-primary key
a non-primary key, a foreign key
a primary key, a foreign key
Which of the following is not a relational algebra operation?
Selection
Projection
Manipulation
Union
What does follow after the SQL WHERE clause?
Selection condition
Name of the table we are selecting from
Grouping attribute(s)
List of columns to be selected
A Students table contains 3 rows, a Groups table contains 2 rows. How many rows will be in the result of the following query: SELECT FROM Students CROSS JOIN Groups;
6
2
3
5
__ specifies a search condition for a group or an aggregate function.
HAVING Clause
GROUP BY Clause
WHERE Clause
FROM Clause
What keyword can be used to search for a string in a column?
FIND STRING
LIKE
HAS STRONG
CONTAINS STRING
Create a table named 'projects' with columns 'id' (serial, primary key), 'name' (text), and 'start_date' (date). Then, add a unique constraint on the 'name' column. Which SQL statement satisfies the requirement?
CREATE TABLE Projects ( id SERIAL PRIMARY KEY, name TEXT UNIQUE NOT NULL, start_date DATE NOT NULL );
CREATE TABLE Projects ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, start_date DATE );
CREATE TABLE Projects ( id SERIAL, name TEXT NOT NULL, start_date DATE NOT NULL, UNIQUE (start_date) );
CREATE TABLE Projects ( id SERIAL PRIMARY KEY, name TEXT NOT NULL, start_date DATE NOT NULL );
The result of an SQL SELECT statement is a ____
form
fila
table
report
You are given a table 'projects' with attributes 'id', 'name', 'start_date'. Write a query to find the name of the project with the most employees assigned. Which SQL statement returns the correct result?
SELECT p.name FROM Projects p JOIN Project Assignments pa ON p.id = pa.project_id GROUP BY p.name ORDER BY COUNT(pa.employee_id) DESC LIMIT 1;
SELECT name FROM Projects ORDER BY employee_id DESC LIMIT 1;
SELECT p.name FROM Projects p LEFT JOIN Project Assignments pa ON p.id = pa.project_id GROUP BY p.name ORDER BY COUNT(p.id) ASC LIMIT 1;
SELECT p.name, COUNT(pa.employee_id) FROM Projects p JOIN Project Assignments pa ON p.id = pa.project_id ORDER BY COUNT(pa.employee_id) DESC;
Create a table named 'employees' with columns 'id' (integer, primary key), 'name' (text), and 'hire_date' (date). Which SQL statement correctly defines the table?
CREATE TABLE Employees ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, hire_date DATE NOT NULL );
CREATE TABLE Employees ( id SERIAL PRIMARY KEY, name TEXT, hire_date TEXT );
CREATE TABLE Employees ( id INTEGER, name TEXT UNIQUE, hire_date DATE );
CREATE TABLE Employees ( id INTEGER PRIMARY KEY, name VARCHAR NOT NULL, hire_date TIMESTAMP NOT NULL );
Which SQL statement is used to extract data from a database?
OPEN
EXTRACT
SELECT
GET
If on the chart Table A is on the left side and Table B is on the right side, a left outer join will include in its answer...
All rows from both Table A and Table B
All the rows from Table A, with the corresponding details of Table B for those rows for which the values of the two tables' common attribute match exactly
Choose the JOIN without a join condition.
CROSS
OUTER
USING
INNER
Which of the following SQL statements will select all records with all their columns from a table called Sales?
SELECT ALL FROM Sales;
DELETE FROM Sales;
SELECT * FROM Sales WHERE Orderid < 1;
SELECT * FROM Sales;
What is meant by the term union compatibility?
When two or more tables have the same number of rows
Only when all columns of two or more tables have the same data types
Only when two or more tables have the same number of columns
When two or more tables have the same number of columns and when they have the same data types
What is meant by the term union compatibility?
When two or more tables have the same number of rows
Only when all columns of two or more tables have the same data types
Only when two or more tables have the same number of columns
When two or more tables have the same number of columns and when they have the same data types
The column of a table is a synonym for ...
Attribute
Tuple
Entity
Relationship
Determine the type of the relationship between Courses and Teachers entities by its description: one course can be taught by many teachers, and one teacher can teach many courses.
1-to-1
None of the given
1-to-M
M-to-M
A teacher may be assigned with exactly one position (like tutor, lecturer or professor). A position can be assigned to one or more teachers. A teacher is recorded with teacher identity code, name, address and date of birth. A position is recorded with name of the position and the identity code for the position. Identify a table with a Foreign Key(s) for the relationship between TEACHERS and POSITIONS.
in the TEACHER'S table or in the POSITIONS table-irrelevant
associative table between TEACHERS and POSITIONS tables
TEACHERS
POSITIONS
Which of the following statements concerning normal forms is true?
The lower the normal form number, the better the schema design is
Each normal form contains a state of independent properties, unrelated to other normal forms
A relation that is in second normal form is also in first normal form
Schemas that are in second normal form are considered the best
Entities Groups and Subjects have a many-to-many relationship. For this reason a new associative table between them should be created - Schedule table. Definitions of tables are: Groups (group_code (PK), group_name), Subjects (subject_code (PK), subject_name, description). Identify attributes in the Schedule table.
schedule_id (PK), group_code (FK), subject_code (FK)
schedule_id (PK), group_code (FK)
schedule_id (PK), subject_name (FK)
schedule_id (PK), group_name (FK), subject_name (FK)
Choose the right order of the database design phases.
Conceptual Design, Logical Design, Physical Design, DBMS Selection
Conceptual Design, Logical Design, Physical Design, Queries Implementation
Subject area analysis, Conceptual Design, Logical Design, Physical Design
Subject area analysis, Logical Design, Conceptual Design, Physical Design
Determine the type of the relationship between Students and Reader's cards entities by its description: one student has only one reader's card, and one reader's card can belong to only one student.
M-to-M
1-to-1
1-to-M
None of the given
If a relation scheme is in 3NF then it is also in ...
2NF
4NF
5NF
None of the given
The command to remove rows from CUSTOMER table is ...
DROP FROM customer;
REMOVE FROM customer;
DELETE FROM customer;
UPDATE FROM customer;
SQL query and data modification commands make up a(n) __
DDL
TCL
What type of relationship is described by the following rule? For one instance of entity A, there exists one or many instances of entity B; and for one instance of entity B, there exists one or many instances of entity A.
one-to-one
one-to-many
many-to-many
none of the given
Determine the type of the relationship between Customers and Orders entities by its description: one customer can make many orders, and one order can be made by only one customer.
1-to-1
1 to M
None of the given
M-to M
In the query SELECT address FROM users, what is the column being selected?
address
FROM
SELECT
Users
A teacher teaches one or more groups, each of which is taught by one or more teachers. A teacher is recorded with teacher's ID and teacher's recorded with group code. Identify a table with a Foreign Key(s) for the relationship between TEACHERS and GROUPS.
TEACHERS
GROUPS
in the TEACHER'S table or in the GROUPS table-irrelevant
associative table between TEACHERS and GROUPS tables
Which SQL function is used to retrieve a maximum value?
MOST()
UPPER()
MAX()
TOP()
Choose the correct order of key words in a SELECT statement
HAVING,ORDERBY,GROUPBY
HAVING, GROUPBY,ORDERBY
GROUPBY,ORDERBY,HAVING
GROUPBY,HAVING,ORDERBY
Which of the following is not a DML statement?
ALTER TABLE
INSERT
UPDATE
DELETE
The SQL DROP TABLE clause is used to ...
delete a relationship from the database
delete a column from the database
delete a table from the database
delete a row from the table
If you want to apply a second condition to your statement where both statements must be true, what keyword would you use between the conditions?
TRUE
BOTH
AND
WHERE
Which SQL function is used to count the number of rows?
COUNTOF()
SUM()
COUNT()
NUMBER()
What is the keyword you would use before adding conditions to your query?
CONDITIONS
WHAT
EQUALS
WHERE
Which SQL keyword is used to return in a query only different (unique) values?
UNIQUE
DISTINCT
*
DIFFERENT
The SQL BETWEEN operator ...
Specifies which columns we are selecting from
Specifies which tables we are selecting from
Specifies primary and foreign keys
Specifies a range of values
DBMS stands for ...
Database Basic Management System
None of the given
Database Management System
Database Administrator System
Which of the following is an SQL aggregate function?
CREATE
MIN
BETWEEN
ALTER
Choose the correct option to convert phone_number attribute from varchar to integer data type
phone_number::varchar(3)
phone_numbers
phone_number::varchar("")
phone_number to int
Which of the following SQL statements deletes all rows from the table called Sales Data?
DELETE Sales Data;
DELETE FROM Sales Data;
DELETE " FROM Sales Data;
DELETE ALL Sales Data;
Table is synonymous with the term ...
Field
Relation
Record
Column
In an ER diagram by Chen's notation attributes are represented by ...
Triangle
Rhombus
Ellipse
Rectangle
With SQL, how do you select a column named FirstName from a table named Persons?
SELECT Persons.FirstName;
EXTRACT FirstName FROM Persons;
GET FirstName FROM Persons;
SELECT FirstName FROM Persons;
SQL can be used to ...
create database structures only
all of the given can be done by SQL
query database data only
modify database data only
A primary key for an entity is ...
relationship
unique attribute
tuple
any attribute
Which of the following is a DML statement?
ALTER TABLE
SELECT
CREATE TABLE
DROP TABLE
What is used to return data that will be used in the main query as a condition to further restrict the data to be retrieved.
CHECK constraint
Foreign key
Subquery
Alternate key
Which of the SQL statements is correct?
SELECT Username WITH Password FROM Users;
SELECT Username, Password FROM Users;
SELECT Username AND Password FROM Users;
SELECT Username SELECT Password FROM Users;
