Monday, July 15, 2024

(OLD Question)NEB GRADE XII 2081 ( 2024 ) Computer Science Queston


 



Monday, July 8, 2024

(OLD Question Grade Improvement Exam)NEB GRADE XII 2080 ( 2023 ) Computer Science Queston

 NEB – GRADE XII

2080 (2023)
Computer Science
Grade Increment (Supplementary) Examination
Candidates are required to give their answers in their own words as far as practicable. The figures in the margin indicate full marks.

Time: 2 hrs. Full Marks: 50

Group ‘A’
Very short answer questions. 9×1=9

1. Which SQL keyword is used to retrieve data from a table? (a) SELECT (b) FROM (c) WHERE (d) JOIN 2. Which of the following principle apply to 2NF? (a) a table must have a primary key (b) all non-key attributes must be dependent on the primary key (c) all attributes must be atomic (d) a table must have at least more than two attributes 3. Which of the following is a device that connects two or more networks and can filter and forward network traffic based on its destination address? (a) switch (b) router (c) hub (d) modem 4. Which JavaScript function use to text input? (a) alert() (b) prompt() (c) confirm() (d) console.log() 5. Which of the following PHP functions is used to connect to a MySQL database? (a) mysql_connect() (b) mysqli_connect() (c) pdo_connect() (d) db_connect() 6. What is the correct way to open a file named “data.txt” in C for reading? (a) fopen(“data.txt”,”r”); (b) fopen(“data.txt”,”w”); (c) fopen(“data.txt”,”a”); (d) fopen(“data.txt”,”rb”); 7. Which of the following concepts in object-oriented programming refers to binding data and function into a single unit. (a) Encapsulation (b) Abstraction (c) Polymorphism (d) Inheritance 8. What does the term “QA” stand for in the software development process? (a) Quality Assurance (b) Quality Analysis (c) Quality Assessment (d) Quantity Assurance 9. What type of communication technology is commonly used in IoT devices? (a) Wi-Fi (b) Bluetooth (c) Zigbee (d) All of the above
Group ‘B’
Short answer questions 5×5=25

10. Describe the second normal form (2NF) with an example. OR What are the importance of database security in database management systems? Describe. 11. How do you add an event handler in JavaScript? Give an example. OR Explain the database connection PHP function for MySQL. 12. Describe the object and class in OOPs with an example. 13. Explain the agile software development methodology in brief. 14. Give any five examples of AI related applications.

Group ‘C’
Long answer questions 2×8=16

15. Compare the bus and star network topology. Which of the network cable is suitable to design star topology in the school’s network? Justify. 4+4 16. Write a program to store five employees’ records (EID, Name, post and department) and display them using structure. OR Describe file handling modes on C. Write a C program to create and write data into a file. 4+4
THE END

(XII) Marking Scheme of NEB Computer 2080(2023)

  NEB – GRADE XII

2080(2023) New Course Computer Science (4281)
Marking Schema
Full Marks: 50
Group A
(Multiple Choice Questions) 9×1=9
Correct option of Multiple-choice questions (1 Marks for correct option) Q.N. 1 (c) the $ sign Q.N. 2 (b) select Q.N. 3 (c) www Q.N. 4 (a) 192.168.1.1 Q.N. 5 (a) hide ( ) Q.N. 6 (b) mysqli_connect() Q.N. 7 (d) FILE is a structure and fpt is a pointer to the structure of FILE type Q.N. 8 (c) Testing Q.N. 9 (d) Guided Transmission Media
Group B
(Short Answer Questions) 5 × 5 = 25
Q.N.10 Explain the Relational database model with an example. (5) - Definition of relational data model – 1 mark - Use of explanation of any three terminologies; such as relation, tuple, field , primary key, domain and integrity constraints – 3 marks - Diagram for relational data model- 1 mark Based on the above partial points and concepts will be scored partial marks Q. No. 10 : OR Write SQL DDL command to execute the following task with reference to the schema given below: student_info(regno as integer, name as character(25), class integer,gender character(1), address character(25)). [5 marks] Here's a suggested marking scheme for the given task: (1) Correct syntax and table creation (2 marks) - Allot 2 marks if the CREATE TABLE statement is correct and creates a table with the specified table name, columns and data types. (2) If column names and data types match the provided schema. (1 mark) (3) If column lengths are according to the provided schema. (1 mark) (4) Overall structure and readability (1 mark) - Allot 1 mark for correctly aligning and formatting with proper indentation and spacing to the SQL statement. - An indentation is the space at the beginning of a line of writing when it starts further away from the edge of the paper than all the other lines. Note : Data type can be integer or int and character or char. Q. No. 11: Define syntax for database connectivity. Write a server side scripting code to insert data into a table student having fields (first name, last name, mark and email). Assume that server name= “localhost”, username= “root”, password="", database name= "studentDB". [5] Give any one syntax for database connection:- 1 mark Syntax: $con=new mysqli($servername,$username,$password,$database); OR $con=mysqli_connect($servername,$username,$password,$database); <?php // step 1: Database configuration. :- 1 marks for steps 1 and 2. e.g. : $servername= “localhost”; $username= “root”; $password= " "; $database= “studentDB”; // step 2: Establish a connection to the database e.g. $con=new mysqli($servername,$username,$password,$database); Note: Above steps 1 and 2 can be in a single line. //Step 3: Check if the connection was successful:- 1 mark e.g. if($con->connect_error) { die(“Connection failed:”.$con->connect_error); } //Step 4: Prepare the SQL statement for insertion:- 1 mark e.g.: $sql= "INSERT INTO student (first_name,last_name,mark,email) VALUES ("Ram", "Sah",45, "ramsah@gmail.com")"; //Step 5: Execute the SQL statement:- 1 mark for steps 5 and 6 e.g.: if($con->query($sql) = = = true) { echo "Data inserted successfully"; } else { echo “Error:”.$sql. “<br>”.$con->error; } //step 6: close the database connection e.g. : $con->close(); ?> Above partial points and concepts will be scored partial marks Q. No. 11: OR
Write a JavaScript code to calculate the factorial of a given number. [5]
1. Correct syntax and its structure – 1 mark Award 1 mark if the JavaScript code has the correct syntax and structure, including proper indentation and formatting. 2. Proper variable declaration and assignment- 1 mark Allot 1 mark if the code declares a variable to store the factorial result and assigns an initial value to it. 3. Handling of input and error conditions- 1 mark Allot 1 mark if the code correctly handles input validation and error conditions, such as checking if the input is a positive integer. 4. Looping and factorial calculation with proper display of the output- 2 marks Allot 1 mark if the code uses a loop (such as for loop or while loop) to calculate the factorial of the given number and displays the result accurately. Note: The marking scheme provided is subjective and may vary depending on the specific requirements provided by your instructor. Q. No. 12: How is an event-driven program (or OOP) differing from procedural oriented programming language? Explain. Full Marks(5)
1. Code in the module/function VS class/object – 1 mark 2. The OOPs features VS procedural language features – 2 marks 3. Code reusability/ flexibility/modification concept, data security etc. – 1 mark 4. Example of both programming languages – 1 mark Above partial points will be scored partial marks. Q. No. 13: Explain the importance of the system testing of the system development life cycle (SDLC). Full Marks(5) 1. Define the system testing – 1 mark 2. Explain the importance of system testing – 4 marks (At least four points or keywords can be included like validation and verification, Error Detection and correction, reliability and Quality Assurance, and cost and risk reduction). Above partial points will be scored partial marks. Q. No. 14: What is cloud computing? Point out the advantage and disadvantage of cloud computing Full Marks(5) 1. Definition of cloud computing and example. – 2 marks 2. List of the advantages and disadvantages of cloud computing – 3 marks Above partial points will be scored partial marks.

Group C: Long Answer Questions (2×8=16) Contents Area and Marks Schema: Q. No. 15 : What is network topology? Differentiate between guided (wire media) and unguided (wireless media) with example. Full Marks(4+4)
1. Define network topology with an example. – 2 marks 2. Six differences between guided and unguided with an example – 6 marks Above partial points will be scored partial marks. Q. No. 16: Write the advantage of pointer? Write a C program to enter the radius of a football and find the area of football by using user defined function Full Marks (8)
1. Define the pointer with syntax – 1 mark NEB XII computer Marking Scheme 2080 Page 3 2. Write the four advantages of the pointer – 2 marks 3. Declaration and preparation of a user defined function to calculate area on the basis of radius input – 3 marks 4. Execution of function with the proper display of output – 2 marks The above partial concept of a calling function, declaration of a function, and function definition in C will be scored partial marks. Q. No. 16 : OR Define structure. Write a C program using structure to input staff id, name and the salary of 50 staffs. Display staff id, name and salary of those staff whose salary range from 25 thousand to 40 thousand. Full Marks(8)
1. Define the structure Definition (2 marks) Provide a concise definition of a structure in C. For example: “In C, a structure is a user-defined data type that allows grouping together related variables of different types. It is defined using the ‘struct’ keyword followed by the structure name and a set of curly braces.” The definition is expected with either an example or key features or purpose as well. 2. Marking scheme for program preparation (6 marks)  Proper structure definition (1 mark) o Proper structure definition and member variables: Award 1 mark if the program includes a structure definition for storing staff information, including member variables for staff if, name and salary.  Input of staff information (1 mark) o Allot 1 mark if the program correctly prompts the user to input the staff id, name and salary for each of the 50 staff members o The program should store the inputted information in an array or any suitable data structure.  Display of staff information within salary range with proper filtering verification ( 3 mark) o Allot 1 mark for the proper loop setting to select each staff‟s data o Allot 1 mark for the proper condition setting for selection of the salary range between 25,000 and 40,000. o Allot 1 mark for the display of staff records matching the criteria  Overall clarity and coherence (1 mark) o The program should be well-organized, logically presented, and easy to understand. The above partial concept of array of structure and use logic in C will be scored partial marks

(OLD Question)NEB GRADE XII 2080 ( 2023 ) Computer Science Queston

 


NEB – GRADE XII
2080 (2023)
Computer Science
New Course – Regular Students
Candidates are required to give their answers in their own words as far as practicable. The figures in the margin indicate full marks. Time: 2 hrs. Full Marks: 50
Group ‘A’
Very short answer questions. 9×1=9 1. Which of the given sign is used as a shortcut for JQuery? (a) the % sign (b) the & sign (c) the $ sign (d) the @ sign 2. Which of the following is DML statement? (a) Create (b) Select (c) Create view Alter (d) Drop 3. A collection of hyperlinked documents on the internet is called (a) HTML (b) Webpage (c) www (d) email system 4. Which of the following IPv4 address valid? (a) 192.168.1.1 (b) EEE.000.33.000 (c) 257.2.5.1 (d) 202.70.71.262 5. Which jQuery method is used to hide selected elements? (a) hide() (b) hide(on) (c) invisible() (d) display(none) 6. Which function is used to connect to MySQL database? (a) mysqli_open() (b) mysqli_connect() (c) var mysqli_query() (d) $mysqli_con() 7. Which of the following is true about FILE *fpt? (a) FILE is a keyword in c for representing files and ftp is a variable of FILE type. (b) FILE is a buffered stream (c) FILE is a stream (d) FILE is a structure and fpt is a pointer to the structure of FILE type 8. Which of a SDLC phase is used to ensure quality software? (a) Implementation (b) Maintenance (c) Testing (d) System Study 9. Coaxial cable is an example of …. (a) Communication software (b) Guided Transmission Media (c) Unguided Transmission Media (d) All of the above
Group ‘B’
Short answer questions 5×5=25 10. Explain the Relational Data model with example. (5) OR Write SQL DDL commands to execute the following task with reference to the schema given below: student_info ( regno as integer, name as character(25), class integer, gender character(1), address character(25) ). 11. Define syntax for database connectivity. Write a server side scripting code to insert data into the table student having fields (first name, last name, mark and email). Assume that server name= “localhost”, username=”root”, password=” “, database name=”student DB”. (1+4) OR Write a JavaScript code to calculate the factorial of a given number. (5) 12. How is even-driven program (or OOP) differing from procedural-oriented programming? Explain. (5) 13. Explain the importance of the system testing of the system development life cycle (SDLC). (1+4) 14. What is cloud computing? Point out the advantages and disadvantage of cloud computing. (5)
Group ‘C’
Long answer questions: 2×8=16 15. What is network topology? Differentiate between guided (wire media) and unguided (wireless media) with example. (2+6) 16. Write the advantage of pointer? Write C program to enter the radius of a football and find the area of football by using user defined function. (3+5) OR Define the structure. Write a C program using structure to input staff id, name and the salary of 50 staffs. Display staff id, name and salary of those staff whose salary range from 25 thousand to 40 thousand. (2+6)
THE END

Chapter : 1 DBMS Handwritten Notes


SYLLABUS:
1.1 Introduction to data, database, Database system, DBMS

1.2 Field, Record, Objects, Primary Key, Alternate key, Candidate key

1.3 Advantages of using DBMS

1.4 DDL (Data Definition Language) and DML (Data Manipulation Language)

1.5 Database Model: Network Model, Hierarchical Model, Relational database model

1.6 Concept of Normalization: 1NF, 2NF, 3NF

1.7 Centralized Vs. Distributed Database

1.8 Database Security






Advantages of a DBMS over a flat-file system:

  1. Data integrity: A database system enforces data constraints and relationships, ensuring that the data is accurate and consistent.
  2. Data independence: A database system allows for changes to be made to the structure of the data without affecting the applications that use the data.
  3. Concurrent access: A database system allows multiple users to access the same data simultaneously, without interfering with each other.
  4. Data security: A database system provides various security mechanisms to control access to the data and prevent unauthorized access.
  5. Data sharing: A database system allows for data to be easily shared among different applications and users.
  6. Data Backup and Recovery: Database system provides various options for data backup and recovery, which makes it easy to recover data in case of any failure.









More Notes will be continued ...






2) Second Normal Form (2NF):

A relation or table is said to be in second normal form (2NF) if it is already in First Normal Form (1NF) and its all non-key attributes are fully functionally dependent on the Primary Key.

The purpose of 2NF is to eliminate partial key dependencies.

To convert the table in 1NF into 2NF, the non-key attributes which are not fully functionally dependent on the Primary Key are decomposed into separate table.

For example:

Original Table (Before 2NF):

StudentID

Class

StudentName

Subject

Marks

1

10

Ram

English

80

1

10

Ram

Math

75

2

10

Hazi

English

85

2

10

Hazi

Math

70

Primary Key: (StudentID, Subject)

Here this table is  not in 2NF  because StudentName and Class depend only on StudentID.

 

After 2NF Decomposition:

We split the table into 3 smaller tables as follows:

Table 1: Students

StudentID

StudentName

Class

1

Ram

10

2

Hazi

10

Primary Key: StudentID

 

Table 2: Subjects

SubjectID

SubjectName

101

English

102

Math

Primary Key: SubjectID

Table 3: Marks

StudentID

SubjectID

Marks

1

101

80

1

102

75

2

101

85

2

102

70

Primary Key: (StudentID, SubjectID)


3) Third Normal Form (3NF):

A relation or table is said to be in third normal form (3NF) if it is already in Second Normal Form (2NF) and it has no transitive(indirect) dependencies (non-key attributes don't depend on other non-key attributes)

In simpler terms, in 3NF, every non-key column must depend only on the primary key, not on any other columns in the table.

The purpose of 3NF is to eliminate transitive key dependencies.

For Example:

Original Table (Before 3NF):

StudentID

StudentName

Subject

SubjectCode

1

Ramesh

Mathematics

M101

2

Sita

Science

S102

3

Gopal

Mathematics

M101

Primary Key: StudentID
Here this table is not in 3NF because there's a transitive dependency: SubjectCode → Subject→ StudentID


After 3NF Decomposition:

We split the table into 2 smaller tables as follows:

Table1: Student

StudentID

StudentName

Subject

1

Ramesh

Mathematics

2

Sita

Science

3

Gopal

Mathematics

 

Table2: Subject

Subject

SubjectCode

Mathematics

M101

Science

S102

Now all transitive dependencies are removed, and each table is in 3NF. The non-key columns in each table depend only on the primary key of that table.

1.7 Centralized Vs. Distributed Database

1. Centralized Database

A centralized database is a database system where all data is stored, managed, and processed in a single location (e.g., one server or data center). All users and applications access this central repository for data operations. Examples: Traditional SQL databases like MySQL (single-server), Oracle (non-distributed setup), or a company’s internal SQL server.

Advantages:

a)       Simpler management: Single point of administration

b)       Consistency: Easier to maintain data integrity

c)       Lower infrastructure costs: No need for complex network systems between nodes

d)       Simpler backup/recovery: Single system to manage

Disadvantages:

a)       Single point of failure: Entire system fails if server goes down

b)       Scalability limitations: Limited by single server capacity

c)       Performance bottlenecks: All requests go to one server

d)       Geographic limitations: Higher latency for remote users

 

2. Distributed Database:

A distributed database is a database system where data is stored across multiple physical locations, either on different servers, data centers, or even geographically dispersed regions. These nodes work together to appear as a single database to users. Examples: Google Spanner, Cassandra, MongoDB (sharded), Amazon DynamoDB, CockroachDB.

Advantages:

a)       High availability: Failure of one node doesn't take down system

b)       Scalability: Can add more nodes to handle increased load

c)       Faster local access: Data can be located near users

d)       Fault tolerance: Redundancy protects against data loss

Disadvantages:

a)       Complexity: More difficult to design and maintain

b)       Consistency challenges: Requires coordination between nodes

c)       Higher infrastructure costs: More hardware and network requirements

d)       Transaction management: Distributed transactions are complex

 

A comparison table showing the differences between Centralized and Distributed Databases based on key factors:

Basis of Comparison

Centralized Database

Distributed Database

Location of Data

Stored in a single location/server

Stored across multiple locations/servers

System Architecture

Single system

Multiple interconnected systems (nodes)

Availability

Low – failure of central server causes system downtime

High – failure of one node doesn't bring down the entire system

Scalability

Limited to the capacity of a single machine

Easily scalable by adding more nodes

Data Access Speed

Slower for remote users due to central location

Faster local access as data can be placed closer to users

Consistency

Easier to maintain strong consistency

Harder to maintain due to data replication and synchronization

Complexity

Simple design and maintenance

Complex architecture requiring synchronization and coordination

Cost

Lower infrastructure cost

Higher due to multiple servers and network requirements

Performance

Performance bottleneck under high load

Better performance due to load distribution

Backup & Recovery

Easier – only one system to manage

More complex – needs coordinated backup across multiple locations

Examples

MySQL (single server), Oracle (non-clustered), MS SQL Server

Google Spanner, MongoDB (sharded), Cassandra, Amazon DynamoDB

 

1.8 Database Security

Data Security refers to the protective measures and protocols implemented to safeguard digital data from unauthorized access, corruption, theft, or damage throughout its lifecycle. It includes technologies, policies, and procedures designed to ensure the confidentiality, integrity, and availability (CIA triad) of data, whether at rest (stored), in transit (being transmitted), or in use (being processed).

Key Aspects of Data Security:

  1. Confidentiality: Ensuring only authorized users can access data (e.g., encryption, access controls).
  2. Integrity: Protecting data from unauthorized modification (e.g., checksums, digital signatures).
  3. Availability: Ensuring data is accessible when needed (e.g., backups, disaster recovery).

Common Data Security Measures:

  1. Encryption: Scrambling data to make it unreadable without a decryption key.
  2. Access Controls: Authentication (passwords, biometrics) and authorization (role-based permissions).
  3. Firewalls & Intrusion Detection Systems (IDS): Blocking or monitoring malicious network traffic.
  4. Data Masking & Anonymization: Hiding sensitive data in non-production environments.
  5. Regular Audits & Monitoring: Tracking access and detecting anomalies.
  6. Backups & Recovery Plans: Protecting against data loss from breaches or disasters.


Importance of Database Security in DBMS (Database Management System):

Database security plays a critical role in any DBMS because it protects valuable data assets from unauthorized access, misuse, corruption, or loss. Below are the key points that describe the importance of database security:

1.       Protects Sensitive Data: Secures confidential information like personal, financial, and health records from unauthorized access.

2.       Ensures Legal Compliance: Helps meet regulations (e.g., GDPR, HIPAA), avoiding legal penalties.

3.       Prevents Data Breaches: Reduces the risk of exposing critical or private data to outsiders.

4.       Maintains Data Integrity: Prevents unauthorized changes, ensuring data remains accurate and reliable.

5.       Ensures Data Availability: Provides continuous access to authorized users, even during failures or attacks.

6.       Controls Access: Restricts data access and actions based on user roles, preventing misuse or accidental damage.

7.       Supports Business Continuity: Enables ongoing operations during cyberattacks or system failures through secure backups.

8.       Enables Monitoring & Accountability: Tracks user activity via logs and audits to detect misuse and promote transparency.


Some Out of Syllabus but important:

DBA (Database Administrator):

A Database Administrator (DBA) is a specialized IT professional responsible for managing, maintaining, securing, and optimizing database systems to ensure efficient and reliable access to data.

Key Characteristics of a DBA:

  1. Technical Expertise:
    Strong understanding of database systems like Oracle, SQL Server, MySQL, PostgreSQL, etc.
  2. Problem Solving Skills:
    Able to quickly diagnose and resolve database issues like performance bottlenecks or crashes.
  3. Attention to Detail:
    Precision in tasks like backup schedules, security permissions, and schema changes.
  4. Security Awareness:
    Implements access controls, encryption, and auditing to safeguard data.
  5. Adaptability:
    Keeps up with evolving technologies and upgrades in DBMS platforms.
  6. Communication Skills:
    Coordinates with developers, system admins, and stakeholders to meet data requirements.

Top 6 Roles and Responsibilities of a DBA:

  1. Database Installation and Configuration
    Setting up the DBMS software and configuring it for optimal performance.
  2. Backup and Recovery:
    Scheduling regular backups and planning for disaster recovery to prevent data loss.
  3. Performance Monitoring and Tuning:
    Analysing query performance and optimizing indexes, queries, and server resources.
  4. Security Management:
    Creating user accounts, assigning roles, and enforcing access control policies.
  5. Database Design and Schema Management:
    Assisting in logical and physical database design based on application needs.
  6. Data Integrity and Availability:
    Ensuring data is accurate, consistent, and available to authorized users when needed.

DCL (Data Control Language):

Used to control access and permissions on database objects.

Common DCL Commands:

a)       GRANT – gives user access rights

b)       REVOKE – removes access rights

TCL (Transaction Control Language):

Used to manage transactions in a database.

Common TCL Commands:

a)       COMMIT: saves changes made during the transaction

b)       ROLLBACK: undoes changes if there’s an error

c)       SAVEPOINT: sets a point within a transaction to rollback to

 





IMPORTANT EXTRA QUESTIONS:

Q1) Write SQL DDL command to execute the following task with reference to the schema given below: student_info(regno as integer, name as character(25), class integer,gender character(1), address character(25)).           
Ans:

The SQL Data Definition Language (DDL) command to create the student_info table with the specified schema is as follows:

CREATE TABLE student_info (
    regno INT PRIMARY KEY,
    name VARCHAR(25),
    class INT,
    gender VARCHAR(1),
    address VARCHAR(25)
);

Output:

Student_info

regnonameclassgenderaddress
empty

Explanation of above command:

  1. Creates a new table named student_info

  2. Defines five columns with the specified data types:

    • regno as INTEGER

    • name as CHARACTER(25) (fixed-length string of 25 characters)

    • class as INTEGER

    • gender as CHARACTER(1) (single character)

    • address as CHARACTER(25) (fixed-length string of 25 characters)

Q2) {2081 GIE Set A Q.No. 10 OR}
Write the SQL DDL statement to create an employee table with the mentioned schema with following attributes.

Field

Data type

Constraints

Employee ID

INT

PRIMARY KEY

Name

CHAR(30)

Address

CHAR(20)

Gender

CHAR(2)

Post

CHAR(15)

 

Ans:

The SQL DDL (Data Definition Language) statement to create the employee table based on the given schema is as follows:

CREATE TABLE employee (

    EmployeeID INT PRIMARY KEY,

    Name VARCHAR(30),

    Address VARCHAR(20),

    Gender VARCHAR(2),

    Post VARCHAR(15)

);

Output:

Employee

EmployeeID

Name

Address

Gender

Post

empty

Explanation of above command:

Ø  EmployeeID is of type INT and is set as the Primary Key.

Ø  Name, Address, Gender, and Post use the CHAR datatype with specified lengths as per the question.

Ø  No additional constraints are given, so only the primary key is defined.


Q3) Consider the table and answer the following:

StudentID

StudentName

CourseID

CourseName

InstructorName

1

Ram

C101

Math

Mr. Sharma

2

Sita

C102

Physics

Ms. Joshi

1

Ram

C102

Physics

Ms. Joshi

 

a. Is the above table in 1NF? Justify your answer.

Ans:

Yes, the table is in First Normal Form (1NF) because all fields contain atomic (single) values and there are no repeating groups.

 

b. If the table is not in 1NF, convert it into 1NF.

Ans:

Not applicable: because the table is already in 1NF.

 

c. Is the 1NF table in 2NF? If not, convert it to 2NF and explain.

Ans:

The table is not in 2NF because:

Ø  The primary key is (StudentID, CourseID).

Ø  StudentName, CourseName, and InstructorName depend only on part of the primary key (partial dependency).

Converting above 1NF table into multiple 2NF Tables:

1. Student Table:

StudentID

StudentName

1

Ram

2

Sita

 

2. Course Table:

CourseID

CourseName

InstructorName

C101

Math

Mr. Sharma

C102

Physics

Ms. Joshi

 

3. Enrollment Table:

StudentID

CourseID

1

C101

2

C102

1

C102

 

d. Is the 2NF table in 3NF? If not, convert it to 3NF and explain.

 Ans:

Yes, the 2NF tables are also in Third Normal Form (3NF) because:

Ø  All non-key attributes depend only on the primary key.

Ø  There are no transitive (indirect) dependencies.



Heritage Publication Book's Exercise:



Old Questions from Asmita Set: