The Language Used in Application Programs To Request Data From The DBMS Is Referred To As The DML DDL DCL None
The Language Used in Application Programs To Request Data From The DBMS Is Referred To As The DML DDL DCL None
Which of the following is generally used for performing tasks like creating the
structure of the relations, deleting relation?
a. DML(Data Manipulation Language)
b. Query
c. Relational Schema
d. DDL(Data Definition Language)
2. Which of the following provides the ability to query information from the database
and insert tuples into, delete tuples from, and modify tuples in the database?
a. DML(Data Manipulation Language)
b. DDL(Data Definition Language)
c. Query
d. Relational Schema
3. A Database Management System is a type of _________software.
a. It is a type of system software
b. It is a kind of application software
c. It is a kind of general software
d. Both A and C
4. Rows of a relation are known as the _______.
a. Degree
b. Tuples
c. Entity
d. All of the above
5. In the relational table, which of the following can also be represented by the term
"attribute"?
a. Entity
b. Row
c. Column
d. Both B &C
6. The language used in application programs to request data from the DBMS is referred to
as the
a. DML
b. DDL
c. DCL
d. None
7. In SQL, which command is used to update existing rows in a table
A. Insert
B. Delete
C. Update
D. None of the above
8. __________is used to control privilege in the Database.
A. Data Manipulation Language
B. Data Definition Language
C. Data Query Language
D. Data Control Language
9. What is the maximum value that can be stored in NUMERIC (4,2)?
a. 9999.99
b. 99.9999
c. 99.99
d. 9.99
10. Foreign key is the one in which the ________ of one relation is referenced in another relation.
a. Foreign key
b. Primary key
c. References
d. Check constraint
11. Which of these are the types of operators?
a. Arithmetic
b. Comparison
c. Set
d. All of the above
12. SQL Server has mainly how many types of views?
a. four
b. three
c. one
d. two
Short / easy
1. Describe the differences in meaning between the terms relation and relation schema.
2. Consider the employee database of Figure 2.17. Give an expression in the relational
algebra to express each of the following queries:
a. Find the ID and name of each employee who works for "BigBank".
b. Find the ID, name, and city of residence of each employee who works for "BigBank".
c. Find the ID, name, street address, and city of residence of each employee who works
for "BigBank" and earns more than $10000.
d. Find the ID and name of each employee in this database who lives in the same city as
the company for which she or he works.
3. Consider the bank database of Figure 2.18. Give an expression in the relational
algebra for each of the following queries:
a. Find each loan number with a loan amount greater than $10000.
b. Find the ID of each depositor who has an account with a balance greater
than $6000.
c. Find the ID of each depositor who has an account with a balance greater
than $6000 at the "Uptown" branch.
4. List two reasons why null values might be introduced into a database.
5. Write the following queries in SQL, using the university schema. (We suggest you
actually run these queries on a database, using the sample data that we provide
on the website of the book, db-book.com. Instructions for setting up a database,
and loading sample data, are provided on the above website.)
a. Find the titles of courses in the Comp. Sci. department that have 3 credits
b. Find the IDs of all students who were taught by an instructor named Einstein;
make sure there are no duplicates in the results
c. Find the highest salary of any instructor.
d. Find all instructors earning the highest salary (there may be more than one
with the same salary).
e. Find the enrollment of each section that was offered in Fall 2017.
f. Find the maxium enrollment, across all sections, in Fall 2017.
g. Find the sections that had the maximum enrollment in Fall 2017.
6. Write the following queries in SQL, using the university schema.
a. Find the ID and name of each student who has taken at least one Comp. Sci.
course; make sure there are no duplicates names in the result.
b. Find the ID and name of each student who has not taken any course offered
before 2017.
c. For each department, find the maximum salary of instructors in that
department. You may assume that every department has at least one
instructor.
d. Find the lowest, across all departments, of the per-department maximum
salary computed by the preceding query.
7. Write the following inserts, deletes, or updates in SQL, using the university
schema.
a. Increase the salary of each instructor in the Comp. Sci. department by 10%.
b. Delete all courses that have never been offered (i.e., do not occur in
the section relation).
c. Insert every student whose tot_cred attribute is greater than 100 as an
instructor in the same department, with a salary of $10,000
8. Rewrite the WHERE clause
9. Using the university schema, write an SQL query to find the names of those
departments whose budget is higher than that of Philosophy. List them in
alphabetic order