0% found this document useful (0 votes)
53 views8 pages

Answers of New DB Exercises

The document contains summaries and examples of database concepts and exercises from chapters 1-5 of a database textbook. Key points covered include: 1) The differences between data, databases, file systems, and database management systems. 2) Common database models like relational, hierarchical and network models. 3) The stages of database design - conceptual, logical, and physical design. 4) Entity relationship diagrams and normalization techniques. 5) Examples of SQL statements for creating tables, inserting/deleting data, and joining tables.

Uploaded by

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

Answers of New DB Exercises

The document contains summaries and examples of database concepts and exercises from chapters 1-5 of a database textbook. Key points covered include: 1) The differences between data, databases, file systems, and database management systems. 2) Common database models like relational, hierarchical and network models. 3) The stages of database design - conceptual, logical, and physical design. 4) Entity relationship diagrams and normalization techniques. 5) Examples of SQL statements for creating tables, inserting/deleting data, and joining tables.

Uploaded by

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

Answers of DB Exercises

Chapter 1 (Page 41)


1.1 Data are row facts used to produce useful information for
decision making for organizational survival and can be a
representation of facts, concepts or instructions in formalized
manner
1.2 Database is A repository of data, designed to support
efficient data storage, retrieval and maintenance and can
store binary files, documents, images, etc. and collection of
data that are related in meaningful way that can be
accessed in managerial levels which can be recorded and
have implicit meaning
Advantages of Database:

1. Minimum data redundancy


2. Improved data security
3. Increased consistency
4. Decision Making

1.3 File system is information that stored in separate files and


processed by applications
Disadvantages:
o Data Redundancy
o Data Isolation
o Integrity Problems
o Security Problems
o Concurrency Access
1.4 A computerized system that enables users to create and
maintain database to facilitate the processes of defining,
constructing, manipulating and sharing databases

1.5 Importance -> To have multiple users insert, update and


delete data at the same time to prevent the data to become
inconsistent or lost

Objectives:

• Data Availability
• Data Integrity
• Data Security
• Data Independence
1.6 One Tier, Two Tier and Three Tier Architectures
1.7 Relational, Hierarchical and Network Databases
1.8 Microsoft Access – MS SQL Server , Oracle ,etc.

1.9 Data – Hardware – Software – Procedure – Users

1.10 Relational , Hierarchical , Network , Objected Oriented , ER ,


Document , Entity attribute , Star Schema , Object relational
models

Chapter 2 (P.66)

1. D

2. C

3. E

4. C
5. B

6. A

7. D

Exercises:

1. Conceptual Design
a. Designing the database like sketching out entities to be
represented what kind of relationships exist between
them
b. Deals with the scope of the database
2. Logical Design (Data Modeling Mapping Phase)
a. Gives the result of relation schemas (ER-Class Diagram)
3. Normalization
a. Last piece of the logical design
b. To remove superfluity during the update
c. A new table is added in every normalization phase
4. Physical Design
a. Implement the database design (Using DBMS)

2. Entity Relationship Diagram (ER-Diagram)

- Visualizes the relationships between entities and its attributes

Importance:

1. Document an existing database structure


2. Debug, troubleshoot and analyze
3. Design new database
4. Gather design requirements
5. Business process re-engineering (BPR)
3. Conceptual, Logical and Physical ERDs

4. Constraints

- Used to handle business restrictions

5. Domain, Entity and Referential Integrities

6. 7. Draw ERD

Chapter 3:

1 – 2 – Mapping

Chapter 4:

Page 96

1- D

2- Draw

3- Draw

4-

The table must satisfy:

1. There’s no top to bottom ordering to the rows


2. There’s no left to right ordering to the columns
3. There are no duplicate rows
4. Every row and column intersection contains exactly one value from
the applicable domain

5- All columns are regular [Rows have no hidden components]


5- A 2NF table is only if relation in 1NF every non-key attribute is
fully dependent on primary key.

6 - The 2NF is 1NF but with no partial dependencies on primary


keys.

7- 3NF is a 2NF but has no transitive partial dependency.

8 – Normalization is a procedure in relational database design


that aims at converting relational schemas into a more
desirable form and its main goal to remove redundancy in
relations and the problems that follow it

Normalization Forms:

1 – First Normal Form (1NF)

2– Second Normal Form (2NF)


3– Third Normal Form (3NF)

Chapter 5 :

P.125
1-CREATE TABLE Employee(

ID int,

Name varchar(200),

Age int,

Email varchar(200) NOT NULL UNIQUE,

);

2- SELECT Name , Age FROM Employee;


3- CREATE TABLE Employee(

ID int primary key,

Name varchar(200),

Age int CHECK(Age>=18),

Email varchar(200) );

4- SELECT ID , name FROM Employee;

5-CREATE TABLE Employee(

ID int,

Name varchar(200)

);

6- CREATE TABLE EmployeePhone(

PhoneNo int,

Emp_Id Int,

FOREIGN KEY (Emp_Id) REFERENCES Employee(ID)

);

7- CREATE TABLE Customer (

ID int,

Name varchar(200),

Phone varchar(20),

);

8- SELECT COUNT(*) FROM Customer WHERE phone LIKE ‘6%’;


9- Same answer of Q1

10- SELECT MAX(Salary) FROM Employee;

11- CREATE TABLE Student (

ID int,

Name varchar(200),

Degree VARCHAR(5)

);

12-

a- SELECT Name, Degree FROM Student WHERE


Degree >18;
b- SELECT * FROM Student WHERE Name LIKE
‘A%’;

13- SAME QUESTION OF 11

14-

A- ALTER TABLE Student ADD Email varchar(200);


B- ALTER TABLE Student DROP COLUMN Email;

Q8:

15- CREATE TABLE Product(

PNO int,

Title varchar(50),

Price money
);

16- INSERT INTO Product (PNO,Title,Price) VALUES (1,’CHIPS’,5);

17- DELETE FROM Product WHERE Price < 10;

You might also like