Depronto Infotech
Depronto Infotech
Depronto Infotech
[email protected]
7798640168
DBMS
create table Contests(
hacker_id integer,
name varchar2(50)
);
contest_id integer
);
college_id integer
);
challenge_id integer,
total_views integer,
total_unique_views integer
);
challenge_id integer,
total_submission integer,
total_accepted_submissions integer
);
( college_id)references
Colleges( college_id);
( contest_id)references
Contests( contest_id);
( challenge_id)references
challenges( challenge_id);
INSERT INTO Contests (contest_id, hacker_id, name) VALUES (2, 102, 'Monthly Hackathon');
INSERT INTO Contests (contest_id, hacker_id, name) VALUES (3, 103, 'Algorithms Competition');
-- Colleges table
-- Challenges table
-- view_stats table
INSERT INTO view_stats (challenge_id, total_views, total_unique_views) VALUES (101, 100, 50);
INSERT INTO view_stats (challenge_id, total_views, total_unique_views) VALUES (102, 150, 80);
INSERT INTO view_stats (challenge_id, total_views, total_unique_views) VALUES (103, 120, 60);
-- submission_stats table
INSERT INTO submission_stats (challenge_id, total_submission, total_accepted_submissions)
VALUES (101, 80, 70);
SUM(s.total_submissions) AS total_submissions,
SUM(s.total_accepted_submissions) AS total_accepted_submissions,
SUM(v.total_views) AS total_views,
SUM(v.total_unique_views) AS total_unique_views
FROM Contests c
OR SUM(s.total_accepted_submissions) > 0
OR SUM(v.total_views) > 0
OR SUM(v.total_unique_views) > 0
ORDER BY c.contest_id;
1. Frontent
/**
Challenge: Pressing `Increment` button should increase the counter count by one.
Pressing `Decrement` button should decrease the counter count by one.
**/
const App = () => {
const [count, setCount] = React.useState(0);
return (
<div>
<h2>Counter: {count}</h2>
<button onClick={increment}>Increment</button>
<button onClick={decrement}>Decrement</button>
</div>
);
};
Css
div {
padding: 10px;
}
button {
margin: 10px 0;
padding: 5px 10px;
}
input {
display: block;
padding: 5px;
margin-bottom: 5px;
width: 120px;
}
Html
<div id="root"></div>
Php
<?php
// Check if user is logged in, otherwise redirect to login page
session_start();
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
header("Location: login.php");
exit;
}
Login
<?php
session_start();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
</head>
<body>
<h2>Login</h2>
<form method="post" action="<?php echo
htmlspecialchars($_SERVER["PHP_SELF"]); ?>">
<label for="username">Username:</label><br>
<input type="text" id="username" name="username"><br>
<label for="password">Password:</label><br>
<input type="password" id="password" name="password"><br>
<input type="submit" value="Login">
</form>
<?php if(isset($login_err)) echo "<p style='color:red;'>$login_err</p>"; ?
>
</body>
</html>
Json
[
{
"name": "Product 1",
"price": "$10",
"image": "product1.jpg"
},
{
"name": "Product 2",
"price": "$20",
"image": "product2.jpg"
},
{
"name": "Product 3",
"price": "$30",
"image": "product3.jpg"
}
]
java
import java.util.List;
import java.util.stream.Collectors;
public class ParallelStreamExample {
public static void main(String[] args) {
// Initialize a list of data
List<Integer> numbers = List.of(1, 2, 3, 4,
5, 6, 7, 8, 9, 10);
executor.shutdown();
while (!executor.isTerminated()) {}