0% found this document useful (0 votes)
11 views4 pages

finalExamCode2V1 (3)

The document contains a series of questions divided into multiple parts, including True/False statements, multiple choice questions, matching SQL commands, fill-in-the-blank questions, and short answer prompts related to database concepts and SQL syntax. It covers topics such as E-R diagrams, SQL commands, database normalization, and referential integrity. The document is structured for an assessment or quiz format on database management systems.

Uploaded by

yosefmuluye42
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

finalExamCode2V1 (3)

The document contains a series of questions divided into multiple parts, including True/False statements, multiple choice questions, matching SQL commands, fill-in-the-blank questions, and short answer prompts related to database concepts and SQL syntax. It covers topics such as E-R diagrams, SQL commands, database normalization, and referential integrity. The document is structured for an assessment or quiz format on database management systems.

Uploaded by

yosefmuluye42
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Part I.

True or False

Instruction: For each of the following questions write TRUE if the statement is correct or FALSE if
it is incorrect at the space provide on the answer sheet. (5 points)
1. Entity sets, attributes and Relationship sets are components of an E-R Diagram.
2. SQL is the standard database language for non-Relational database management system.
3. The data type of bit in SQL server allows 0, 1 or NULL.
4. An E-R diagram can be used to represent the conceptual design of a database.
5. Database is a collection of interrelated data.

Part II. Multiple Choices

Instruction: For each of the following questions choose the correct answer and write the letter to
your answer on the answer sheet provided. (1.5 points each)

1. Which one of the following SQL syntax is used to delete both the structure and record
stored in the table?
A. DROP TABLE table_name C. TRUNCATE TABLE table_name;
B. DELETE FROM table_name D.ALTER TABLE table_name
2. Which one of the following is used to ensure the referential integrity of the data in one
table to match values in another table?
A. Primary Key C.Check
B. Foreign key D. Composite Key
3. Identify the correct statement about A relation or table which is in first normal form.
A. A relation contain composite or multi-valued attribute is under first normal form.
A. A relation is in first normal form if every attribute in that relation is singled valued
attribute.
B. The order, in which data is stored, does not matter in first normal form.
C. If each table cell contains a single value, then the table is under first normal form.
4. One of the following is incorrect about primary key of a table
A. A primary key cannot be NULL
B. A primary key value must be unique
C. The primary key must be given a value when a new record is inserted.
B. None of the above
5. Which one of the following data type is different from the other?
A. varchar(n) B. Text C. Real D. binary(n)
6. Which one of the following is used to uniquely identify an entity from the entity set?
A. Primary key attribute B. Foreign key attribute C. Derived attribute D. None

7. Hjhkjhjkh
8. jkjlkjkljlk
Part III. Matching

Instruction: for each of the following SQL Commandsfound under column A match their types from
column B and write the letter of your answer on the answer sheet provided. Note: a given SQL type
could be used more than ones(7 points)

Column A 7. Delete
1. Alter
2. Grant Column B
3. Select A. Data Definition Language (DDL)
4. Update B. Data Query Language (DQL)
5. Insert C. Data Manipulation Language (DML)
6. Create
D. Data Control Language (DCL)

Part IV. Multiple Choices - SQL

Instruction: Based on the tables found below, choose the correct answer and write it on the space
provided at the answer sheet(2 points each).

User_Id First_name Middle_name Date_of_birth Sex


User001 Samuel Alemu 10/2/1985 M
User002 Mohammed Ali 2/2/1988 M
tblUser*note: (User_id is PK)

Book_ISB Book_title Book_Autho Price Edition


N r
1701 DBMS Elmasri 300 2000 ed
1702 C++ Kumar 200 2012 ed
tblBook*note:(Book_ISBN is PK)

NO User_Id Book_ISBN Issue_Date


1 User001 1701 5/6/2021
2 User001 1702 5/6/2021
tblBorrow*note: (No is auto number and Primary Key) (user_id and Book_ISBN are foreign key)

1. Which one of the following SQL query can be used to create tblBorrowwithout adding foreign key
constraint?
A. CREATE TABLE tblBorrow(NO bigintNOT NULLPRIMARY KEY IDENTITY(12,1), User_Id varchar(60),
Middle_name varchar(20), Last_name varchar(20),Date_of_birth date, Sex varchar(10));
B. CREATEtblBorrow TABLE (NO bigintNOT NULLPRIMARY KEY IDENTITY(1,1), User_Id varchar(60),
Middle_name varchar(20), Last_name varchar(20),Date_of_birth date, Sex varchar(10));
C. CREATE TABLE tblBorrow(NO bigintNOT NULLPRIMARY KEY IDENTITY(102,1), User_Id varchar(60),
Middle_name varchar(20), Last_name varchar(20),Date_of_birth , Sex varchar(10));
D. ALTER TABLE tblBorrow(NO bigintNOT NULLPRIMARY KEY IDENTITY(12,1), User_Id varchar(60),
Middle_name varchar(20), Last_name varchar(20),Date_of_birth date, Sex varchar(10));

2. Which one of the following SQL query can be used to create tblUser?
A. CREATE tblUserTABLE (User_Idvarchar(60) NOT NULLPRIMARY KEY, First_name varchar(20),
Middle_name varchar(20), Last_name varchar(20),Date_of_birth date, Sex varchar(10));
B. CREATE TABLE tblUser(User_Idvarchar(60) NOT NULLPRIMARY KEY, First_name varchar(20),
Middle_name varchar(20), Last_name varchar(20),Date_of_birth date, Sex varchar(10));
C. ALTER TABLE tblUser(User_Idvarchar(60) NOT NULLPRIMARY KEY, First_name varchar(20),
Middle_name varchar(20), Last_name varchar(20),Date_of_birth date, Sex varchar(10));
D. CREATE TABLE tblBook(User_Idvarchar(60) NOT NULLPRIMARY KEY, First_name varchar(20),
Middle_name varchar(20), Last_name varchar(20),Date_of_birth date, Sex varchar(10));
3. Which one of the following SQL command is used to change the book_authorElmasri to
Abebe in the table tblBook?
A. UPDATEtblBookSETBook_Author=’Abebe’
B. UPDATEtblBookSET Book_Author=’Abebe’ WHERE Book_ISBN=1701
C. UPDATEtblBookSET Book_Author=’Abebe’ WHERE Book_ISBN=Elmasri
D. UPDATEtblBookSET Book_Author=’Abebe’ WHERE Book_ISBN=1702
4. Assume tblBorrow is already created, which one of the following query can be used to add a foreign
key constraint to the attribute Book_ISBN?
A. ALTER TABLE tblBorrow
ADD FOREIGN KEY (Book_ISBN) REFERENCES tblBook(Book_ISBN);
B. ALTER TABLE tblBorrow
ADD FOREIGN KEY (Book_ISBN) REFERENCES tblBorrow (Book_ISBN);
C. Create TABLE tblBorrow
ADD FOREIGN KEY (Book_ISBN) REFERENCES tblBorrow (Book_ISBN);
D. Create TABLE tblBorrow
ADD FOREIGN KEY (Book_ISBN) REFERENCES tblBook(Book_ISBN);
5. Which one of the following query is used to retrieve 2000 edition books from tblBook
A. SELECT * FROM tblBook WHERE Edition =’2000’
B. SELECT * FROM tblBook WHERE Edition Like ‘20’
C. SELECT * FROM tblBook WHERE Edition is 2000
D. SELECT * FROM tblBook WHERE Edition <> 2000

Part V. Fill in the blank (1 point each)


Instruction: For each of the following question write the answer on the space provided
1. ____________________________ is popular conceptual design tool of 4th generation
databases.
2. The overall design of a database or the description of a database is called
___________________.
3. ________________________is an attribute in which its values can be computed from another
attribute.
4. ___________________________ is an extension of the hierarchical model and it allows many-
to-many relationships between nodes.
5. ____________________________ is used to represent week entity sets.
6. _____________________________ = Data + DBMS + Applications (UI)
Part VI. Short Answer

Instruction: Based on the tables (tblUser,tblBook and tblBorrow) found Above, give short answer for
the following questions.(3 points each)

1. Write an SQL statement to create a database called ETU_LIBRARY.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy