NEW
Font size
Worksheetsquiz sql
Total questions: 78
Worksheet time: 39mins
Determine the Normal Form of the table:
Teachers (PK teacher_id, PK depart_id, teacher_Iname, email, depart_name)
1 NF
2 NF
3 NF
0 NF
A teacher teaches one or more subjects, each of which is taught by one or more teachers. De are:
Teachers (teacher_id (PK), name, birthdate)
Subjects (subject_code (PK), name, description)
Identify a type of the relationship between Teachers and Subjects tables.
many (teachers)-to-many (subjects)
one(teachers)-to-many(subjects)
one(teachers)-to-one(subjects)
Primary keys made up of more than one single attributes are called
Composite Primary key
Candidate Primary key
Alternate Primary key
A functional dependency is a logical relationship between or among
Attributes
Columns
Tuples
In an ER diagram an entity is represent by a
Rectangle
Oval
Triangle
Rhombus
Complete the code to drop the table Faculties:
DROP TABLE FACULTIES ;
DELETE TABLE FACULTIES ;
Complete the code to create the table Subjects (subj id (PK), name):
CREATE TABLE Subjects(
subj_id int ___________ ,
name varchar(10));
PRIMARY KEY
FOREIGN KEY
Can a Foreign key be NULL?
Yes
No
Determine the type of the relationship between Students and Groups entities by its description: "One s can be enrolled only in one group, and one group contains many students"
1-to-M
1-to-1
M-to-M
Determine the type of the relationship between Products and Orders entities by its description: "One produc can be included in many orders, and one order can include many products"
M to M
1 to 1
1 to M
Determine what functional dependency is in this table
Teachers (PK teacher_id, Iname, email, FK dep_id)
Full
Not Full
Which of the following are considered as DBMS?
PostgreSQL, Access, Oracle, MySQL
-
-
-
Complete the code for the following table Faculties (facult_id (PK), name):
______ Faculties
SET name='Information Technology'
WHERE name='IT';
UPDATE
SET
TABLE
ALTER
Determine the primary key by the description of the table: Students (stud id, Iname, fname,
stud_id
lname
fname
Complete the code to create the table Departments (dep_id (PK), name), where name attribute has constraint:
CREATE TABLE Departments dep_id int PRIMARY KEY,
name varchar(10) ________ );
NOT NULL
NULL
FOREIGN KEY
UNIQUE
The another name for a row is
Record
Column
Data
Complete the code to create the table Teachers (teach_id (PK), lastname), where lastname unique constraint:
CREATE TABLE Teachers( teach_id int PRIMARY KEY,
lastname varchar(10) _______ );
UNIQUE
NOT NULL
NULL
Doctors may prescribe several appointments for one patient. One appointment is focused on only one pa
Patients(patient_id(PK), fname, Iname, age)
Appointments(app_id(PK), time, day_of_week) Identify a table with a Foreign Key(s) for the relationship between Patients table and Appointments tab
Appointments
in the table Appointments or in the Patients table - both options are correct
associative table between Appointments and Patients tables
Patients
Complete the code to add a new column to the table Courses.
ALTER TABLE Courses _____________ credits int;
ADD COLUMN
ALTER COLUMN
NEW COLUMN
Third normal form is based on the concept of …
Transitive dependency
Partial dependency
Complete the code to drop the table Teachers:
DROP _____________ ;
TABLE Teachers
Teachers
Teachers(teacher_id)
A relation in which the intersection of each row and column contains one and only one value is
1NF
2NF
0NF
3NF
Complete the code to drop a column from the table Subjects:
ALTER TABLE Subjects _______________ name;
DROP COLUMN
DELETE COLUMN
DEL COLUMN
In ER Diagram by Chen's notation a relationship type is represented by
Rhombus
Rectangle
Oval
How many rows (maximum number) will be deleted by the following code from the table (PK), name): DELETE FROM Subjects WHERE subject_id=1;
write the number here: 1
1
2
0
Complete the code to create the table Subjects (subj_id (PK), name):
CREATE TABLE Subjects( subjid int, name varchar(10),
______________ (subj id));
PRIMARY KEY
FOREIGN KEY REFERENCES TO
FOREIGN KEY
There is a bank that serves many customers, each of which can have one / several accour savings account, a salary account, etc. Determine the type of relationship between the cu accounts entity?
one-to-many
one-to-one
many-to-many
Which of the following is not a phase of database development?
DBMS Selection
-
-
-
Which of the following is not a DDL statement?
ALTER
DROP
CREATE
INSERT
There is a bank, which serves a lot of customers, each of customer can have one/several accounts, for example, saving account, salary account, etc. Identify a table with a Foreign Key(s) for the relationship between Customers table and Accounts table.
Accounts
Customers
associative table between Customers and Accounts tables
in the Customers table or in the Accounts table - both options are correct
A relation in which the intersection of each row and column contains one and only one value is said to be in
1 NF
2 NF
3 NF
0 NF
In an diagram by Chen notation attributes are represented by
Elipse
Oval
Rectangle
Rhombus
Determine the type of the relationship between Customers and Orders entities by its description: "One cus make many orders, and one order can be made by only one customer"
1-to-M
1-to-1
M-to-M
Can a Foreign key be duplicate?
Yes
No
Complete the code to delete all rows from the following table Faculties (facult_id (PK), name):
DELETE FROM Faculties
DELETE Faculties
DEL FROM Faculties
Complete the code to add a new record with incomplete information for the following table: Teachers (teach_id (PK), firstname, lastname,
dateofbirth):
INSERT INTO Teachers (teach_id, ______________________________)
VALUES (1, 'First name', 'Last name');
firstname, lastname
fname,lname
first_name,l_name
Complete the code to create the table Departments (dep_id (PK), name, faculty_id), where faculty_id is a FK to the table Faculties:
CREATE TABLE Departments dep_id int PRIMARY KEY, name varchar(10), faculty_id int,
_______________________ (faculty_id) REFERENCES Faculties(faculty_id));
FOREIGN KEY
FOREIGN
FK
Determine the Normal Form of the table:
1NF
3NF
2NF
0NF
Complete the code to drop a column from the table Schedule:
ALTER TABLE _________________________;
Schedule DROP COLUMN
DROP COLUMN
ALTER COLUMN DROP TABLE
Key to represent relationship between tables is called
FOREIGN KEY
FOREIGN
FK
A faculty might include several departments, and a department belongs to one faculty. Identify a table with a Foreign Key(s) for the relationship between FACULTIES and DEPARTMENTS.
associative table between FACULTIES and DEPARTMENTS tables
in both FACULTIES and DEPARTMENTS tables
DEPARTMENTS
FACULTIES
Complete the code to drop the table Subjects:
________________ Subjects;
DROP TABLE
DELETE TABLE
DEL TABLE
ALTER TABLE DROP TABLE
Complete the code to drop the table Schedule :
______________ Schedule;
DROP TABLE
DELETE TABLE
DEL TABLE
ALTER TABLE DROP TABLE
Determine the type of the relationship between Products and Orders entities by its description: "One product can be included in many orders, and one order can include many products"
None of the given
1-to-1
1-to-M
M-to-M
Third normal form is based on the concept of … of…
Primary dependency
Partial dependency
Foreign dependency
Transitive dependency
In an ER diagram by Chen's notation attributes are represented by
Ellipse
Rhombus
Triangle
Rectangle
There is a company that specializes in repairing various equipment. This company takes orders from customers every day. They have a team of specialists, each of whom can perform various orders, however one order is related to only one specialist. Based on this description, determine the type of relationship between specialists entity and orders entity?
one-to-one
many-to-many
one-to-many
Which of the following language is used to specify database structure?
Data Manipulation Language
Data Management Language
Data Development Language
Data Definition Language
Determine the Normal Form of the table:
1NF
2NF
0NF
3NF
Entity Relationship model consists of a collection of basic objects called … and relationships among these objects.
None of the given
Functions
Entities
Models
Determine the Normal Form of the table:
1 NF
2 NF
3 NF
0 NF
A teacher may be assigned with exactly one position, like tutor, lecturer or professor. A position must be assigned to one or more teachers. A teacher is recorded with teacher identity code, name, address and date of birth. A position is associated with name of the position and the identity code for the position.
Identify a type of the relationship between TEACHERS and POSITIONS entities.
one (teachers)-to-one (positions)
one (teachers)-to-many (positions)
one (positions)-to-many (teachers)
many (teachers)-to-many (positions)
Determine the Normal Form of the table:
1 NF
2 NF
3 NF
0 NF
Determine what functional dependency is in this table
full
there is no right answer here
transitive
partial
Determine what functional dependency is in this table
transitive
there is no right answer here
full
partial
There is a bank which serves a lot of customers, each of customer can have one several accounts for example saving account salary account etc identify a table with a Foreign Key(s) for the
relationship between Customers table and Accounts table.
Accounts
Customers
associative table between Customers and Accounts tables
in the Customers table or in the Accounts table - both options are correct
A primary key for an entity is
A unique attribute
a random value assigned to each record
an optional feature with no significant role in database design
There is a bank, which has several departments lke i department, finance HR etc. There are a lot of employees and each of them belongs to only one department identify a table with a Foreign Keys) for the relationship between Departments table and Employees table
Departments
Employees
Department_Employees
in the Departments table or in the Employees table - both options are correct
There is a bank, which serves a lot of customers each of customer can have one severa accounts for example, saving account salary account etc identify a table with a Foreign Key(s) for the relationship betiveen Customers table and Accounts table.
Customers
Accounts
Customer_Accounts
in the Customers table or in the Accounts table - both options are correct
Complete the code to add a new column to the table Subjects:
_______________ Sutjects ADD COLUMN name varchar(25);
ALTER TABLE
CHANGE
ALTER
ADD TABLE
Determine the type of the relationship betiween Students and Reader's cards entities by its description: "One student has only one reader's card, and one readers card can belong to only one student"
1-to-1
1-to-M
M-to-M
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-M
1-to-1
M-to-M
Which of the following is not a DDL statement?
INSERT
CREATE TABLE
ALTER TABLE
DROP TABLE
A teacher may be assigned with exactiy one position, like tutor, lecturer or professor. A position must be assigned to one or more teachers. Ateacher is recorded with teacher identity code name address and date of birth. A position is associated with name of the position and the identity code for the position. identify a type of the relationship betiween TEACHERS and POSITIONS entities
One-to-One Relationship
Many-to-One Relationship
One-to-Many Relationship
Many-to-Many Relationship
What SQL structure is used to limit column values of a table?
CHECK Constraint
INDEX Structure
FOREIGN KEY Constraint
VIEW Constraint
A table with Foreign Key(s) for the relationship between FACULTIES and DEPARTMENTS is:
FACULTIES
DEPARTMENTS
FACULTY_DEPARTMENTS
in the FACULTIES table or in the DEPARTMENTS table - both options are correct
The FD X-> Y is a full dependency in a relation R if there is . attribute A that can be . X and the dependency still holds
At least one removed from
Another attribute B that can be added to X, and the dependency still holds.
Y is a subset of X
No attribute in R that can be added to X, and the dependency still holds
Complete the code to create the table Teachers (teachid (PK), lastname), where lastname attribute has the not null constraint:
CREATE TABLE Teachersf teach_id int PRIMARY KEY lastname varchar(10) __________
NULL
NOT NULL
UNIQUE
Which of the following is not a phase of database development?
Planning
DBMS Selection
Implementation
Optimization
Which SQL keyword is used to specify conditional search?
FIND
LOCATE
WHERE
SEARCH_CONDITION
Which SQL statement is used to extract data from a database?
FETCH
EXTRACT
SELECT
RETRIEVE
The column of a table is referred to as the
Row
Cell
Field
Attribute
Normalization is ...
The process of creating random data in a database.
A method to increase data redundancy for faster retrieval.
A technique to decrease data integrity in a database.
the process of arranging information stored in a database in a way, which redundancy and ambiguity
SQL
Structured Query Language
Systematic Query Logic
Sequential Query Link
Synchronized Query Layer
Table is synonymous with the term
Relation
Document
File
Collection
Complete the code for the following table Subkects(subj_id(PK),name,credits):
___________________
SET credits=credits+1;
UPDATE Subjects
ALTER TABLE Subjects
MODIFY TABLE Subjects
INCREMENT Subjects
Complete the code for the following table Groups(group_id(PK),name):
DELETE FROM Groups
_______ group_id=1;
WHERE
SET
UPDATE
INSERT
Determine what functional dependency is in this table
full
partial
there is no right answer here
transitive
