Computer
Computer
1. Write SQL DDL commands to execute the following task with reference to
the schema given below.
Creating the table with primary key and not null constraints:
CREATE TABLE student info ( regno INTEGER PRIMARY KEY, name CHAR(25)
NOT NULL, class INTEGER NOT NULL, gender CHAR(1) NOT NULL, address
CHAR(25),
);
2. Define a 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:
Server name = "localhost"
Username = "root"
Password = ""
Database name = "student DB"
Database Connectivity Syntax (PHP - MySQLi)
Database Connectivity Syntax (PHP - MySQLi)
<?php
$servername = "localhost";
$username = "root";
$password = "";
$database = "student_DB";
// Create connection
$conn = new mysqli($servername, $username, $password, $database);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Close connection
$conn->close();
?>
3. Explain the Relational Database Model.
Relational database model uses tables (relations) to store data. Each table
consists of rows (records) and columns (attributes). Relationships between
tables and established through foreign keys.
Advantages: Simple to use, highly flexible, and widely adopted. SQL is used
to manage and query relational databases.
Disadvantages: Can become ine icient with very large datasets and complex
query.
4. Demonstrate any two DDL statements with an example.
Data Definition Language (DDL) commands are used to define and manage
database structures.
a. CREATE TABLE
CREATE TABLE Customers (
CustomerID INT PRIMARY KEY,
Name VARCHAR(100),
Email VARCHAR(100)
);
b. ALTER TABLE
ALTER TABLE Customers (
ADD PhoneNumber VARCHAR(15);
);
5. What are the roles of the Database Administrator (DBA)? Describe.
A database administrator (DBA) is responsible for managing, maintaining,
and securing databases. Key roles of database administrator include:
a. Installation and Configuration: Setting up database servers and
configuring databases.
b. Performance monitoring and turning: Ensuring databases perform
e iciently by optimizing queries and managing resources.
c. Backup and Recovery: Implementing backup strategies and restoring data
in case of loss.
d. Security Management: Controlling access to data, implementing security
policies, and protecting against unauthorized access.
e. Maintenance and Upgrades: Performing regular maintenance and
upgrading database software as needed.
f. Data integrity: Ensuring accuracy and consistency of data within the
database.
6. Describe the DDL statement with an example in SQL.
DDL is sometimes known as Data Description Language since its statements
can also be used to describe, comment on and place labels on database
objects.
DDL commands: CREATE, ALTER, DROP
Exampale:
CREATE TABLE Orders (
OrderDate DATE,
CustomerID INT,
Amount DECIMAL(10,2)
);
7. Di erentiate between centralized and distributed database systems.
Centralized Distributed database system
It is a database that is stored, It is a database that is spread across
located as well as maintained at a di erent physical locations.
single location only.
The data access time in the case of The data access time in the case of
multiple users is more in a multiple users is less in a
centralized database. distributed database.
The users cannot access the In a distributed database, if one
database in case of database failure database fails, users have access to
occurs. other databases.
A centralized database is less This database is very expensive.
costly.
It is easy to maintain the data and It is di icult to maintain because of
information is available at a single the distribution of data and
location. information at varied places.
Networking
11. What is transmission media? Explain any two types of transmission media.
The physical or wireless path through which data is transmitted (eg. Cables,
fiber optics, radio waves).
Coaxial cable: The core is made up of copper conductors. Its purpose is the
signal transmission. To prevent unwanted interference, a metal conductor is
braided around the insulator.
Fiber Optics: Fiber optics fibers are transparent, flexible wires composed of
glass or plastic that are just a little thicker than a human hair. It acts as a
waveguided, allowing light to travel between the fiber’s two ends.
12. What is optical fiber cable in networking? Discuss its advantages. (5)
Fiber optic cable transmits data as light pulses through or plastic fibers,
o ering high bandwidth and long-distance communication
Advantages: High bandwidth and speed, Immune to EMI, supports long-
distance communication with minimal signal loss.
Disadvantages: Expensive to install, Fragile compared to other cables.
13. What is network architecture?
14. Network architecture refers to the design and structure of a computer network,
including its physical and logical aspects. It outlines how devices and resources
are organized and how data is flows between them.
15. Explain the OSI/ISO model of networking. (7)
The OSI (Open Systems Interconnection) model is a conceptual framework that
standardizes the functions of communication systems into seven distinct
layers. Each layer is responsible for special tasks in the communication
process.
Physical Layer: Responsible for the physical connection between devices
and the transmission of raw data bits over a medium (cables, wireless).
Example: Cables, switches.
Data Link Layer: Ensures error-free data transfer and manages physical
addressing (MAC addresses).
Example: Ethernet, Wi-Fi.
Network Layer: Handles logical addressing (IP addresses) and routing of data
across networks.
Example: Routers.
Transport Layer: Ensures reliable data transfer and error correction between
devices.
Example: TCP, UDP.
Session Layer: Manages and controls the dialog (session) between two
devices.
Example: NetBIOS, RPC.
Presentation Layer: Translates, compresses, and encrypts data. Ensures that
data is in a readable format.
Example: SSL, JPEG, ASCII.
Application Layer: Provides network services to end-user applications.
Example: HTTP, FTP, SMTP.
16. What is networking? Discuss its advantages and disadvantages. (2.5+2.5)]
Networking refers to the practice of connecting multiple devices to exchange
data and share resources like files and printers.
Advantages: Resource sharing, centralized data management, communicate
to anyone from anywhere in network range, cost e ective.
Disadvantage: Security risks, complexity, high setup cost, maintenance.
17. What are the di erent types of LAN topologies? Explain with diagrams. (5)
Local Area Network is a network that connects computers and devices within
a limited geographical area, such as a home, o ice, or building. Bus topology,
Star topology, Ring Topology.
Web Technology
if (a === 0 || a === 1) {
console.log("The factorial of given number is 1");
} else {
for (let b = 2; b <= a; b++) {
fact *= b;
}
console.log("The factorial of given number is " + fact);
}
rl.close();
});
2. Write a JavaScript function to add two numbers and return the sum.
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
if (isNaN(a) || isNaN(b)) {
console.log("Please enter valid numbers.");
} else {
console.log(`The sum is: ${sum(a, b)}`);
}
function sum(a, b) {
return a + b;
}
3. Explain the database connection method in PHP.
<?php
$servername = "localhost";
$username = "root";
$password = "";
$database = "my_database";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
<label>Name:</label>
<input type="text" name="name" value="<?php echo $row['name']; ?>"><br>
<label>Email:</label>
<input type="email" name="email" value="<?php echo $row['email']; ?>"><br>
<button type="submit">Update</button>
</form>
5. Write short notes on Internet technology.
Internet technology refers to the infrastructure, protocols, and systems that
enable communication and access to data over the internet. Key aspects
include:
Protocols: These define how data is transmitted over the internet. Examples
include HTTP, TCP/IP, FTP,
Web Browsers: Software application (e.g. Chrome, Firefox) used to access
websites.
Web servers: Hardware/ software system that store and serve web pages.
HTML, CSS, JavaScript: Technologies used to create and design websites.
Cloud computing: Allows storing and accessing data on remote servers over
the internet.
6. Di erentiate between server-side and client-side scripting.
Server-side Scripting Client=side Scripting
Executes on the web server. Executes on the user’s browser.
Used for database interaction, Used for user interface and
processing form data etc. enhancing user experience.
Examples: PHP, Node.js, Python Example: JavaScript, HTML, CSS
Can interact with databases and file Cannot directly interact with server
systems. resources.
Examples of languages: PHP, Java, Examples of languages: JavaScript,
Ruby, Python. HTML, CSS.
$db->close();
?>
16. Write a server-side script to create a database, connect with it, create a
table, and insert data into it.
<?php
$server = "localhost";
$username = "root";
$password = "";
if ($conn->connect_error) {
$dbName = "my_database";
$conn->select_db($dbName);
)";
} else {
} else {
$conn->close();
?>
Programming in C
3. Describe the waterfall software development model with pros and cons. [5
Marks]
The Waterfall Model is a sequential approach in SDLC where each phase is
completed before moving to the next.
Pros:
a. Simple & Easy to Understand: Clearly defined stages and processes.
c. Good for Small Projects: Works well when requirements are well-
defined.
Cons:
4. What are the major activities performed to design the software? Describe. [5
Marks]
Software design involves several key activities:
a. Requirement Analysis: Understanding what needs to be developed.
c. Data Flow & Modeling: Creating diagrams like DFD and ER models.
7. What are the roles of a system analyst in the SDLC phase? [5 Marks]
The system analyst plays a crucial role in SDLC:
a. Requirement Gathering: Identifying user and system needs.
8. What are the importance of e-learning in the 21st century? Write the
importance of multimedia in e-learning. (3+2 Marks)
Importance of E-Learning (3 Marks):
a. Accessibility: Education is available anytime, anywhere.
9. What are the roles of AI in our real life? List out AI related systems in our
society. (1+4 Marks
Role of AI in Real Life (1 Mark):
AI automates tasks, enhances decision-making, and improves e iciency in
various fields.
AI-Related Systems in Society (Any four for 4 Marks):
a. Smart Assistants: Alexa, Siri, Google Assistant.
13. What are the advantages and disadvantages of social media? (5 Marks)
Advantages (Any two for 2.5 Marks):
a. Global Connectivity: Connects people worldwide.