Recent programs

Q.java

an anonymous user · September 16, 2021 · Java
import java.util.*;
import java.lang.*;
import java.io.*;

class A{
    protected int i=0;
    protected A(int i){this.i=i;}
    public int getl(){return i;}
}

public class Q extends A{

Practice Session

an anonymous user · September 16, 2021 · SQL
create database ankit;

Employee

an anonymous user · September 16, 2021 · SQL
-- create a table
CREATE TABLE EMPLOYEE (
  EMPID integer PRIMARY KEY, 
  NAME text, 
  SUPERVISOR integer, 
  LOCATION text, 
  SALARY integer
);

CREATE TABLE EMPLOYEEBONUS (
  EMPID integer, 

sss

an anonymous user · September 16, 2021 · SQL
WITH 
t1 as (
SELECT id,
       week_end_date,
       amt_value/units as PRICE_UNIT,
       base_amt_value/base_units as BASE_PRICE_UNIT,
       MAX(amt_value/units) OVER (PARTITION BY product_code ORDER BY week_end_date ROWS BETWEEN 11 PRECEDING AND CURRENT ROW) AS RSP_UNIT
      
       ((units-base_units)*100)/base_units as UPLIFT_PER,
FROM
germany_rms

ass3

an anonymous user · September 16, 2021 · SQL
-- create a table
create table account(acc_no int(10) primary key, branch_name varchar(20), balance int(20));
insert into account values(1001,'Akurdi',15000+1000);
insert into account values(1002,'Nigdi',11000-500);
insert into account values(1003,'Chinchwad',20000*2);
insert into account values(1004,'Wakad',10000/100);
insert into account values(1005,'Akurdi',14000%2);
insert into account values(1006,'Nigdi',17000);

SELECT * FROM account;

Worksheet

an anonymous user · September 16, 2021 · SQL
CREATE TABLE BRANCH(
 brachNo
 street
 city
 postcode
);

CREATE TABLE STAFF(
 staffNo
 fName
 lName

PythonLogin

an anonymous user · September 16, 2021 · SQL
-- create a table
CREATE TABLE IF NOT EXISTS `accounts` (
	`id` int(11) NOT NULL,
  	`username` varchar(50) NOT NULL,
  	`password` bigint(25) NOT NULL,
  	`admin` tinyint(1) NOT NULL,
    PRIMARY KEY (`id`)
);
-- insert accounts
INSERT INTO `accounts` (`id`, `username`, `password`, `admin`) VALUES (1, 'isadmin', -966697084172663693, 1);
INSERT INTO `accounts` (`id`, `username`, `password`, `admin`) VALUES (2, 'isnotadmin', 38429042894289248, 0);

test

an anonymous user · September 16, 2021 · SQL
-- create a table
CREATE TABLE students (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  gender TEXT NOT NULL,
  admin BOOLEAN NOT NULL
);
-- insert some values
INSERT INTO students VALUES (1, 'Ryan', 'M', TRUE);
INSERT INTO students VALUES (2, 'Joanna', 'F', FALSE);
-- fetch some values

gaming_sql

an anonymous user · September 16, 2021 · SQL
CREATE TABLE players (
    PlayerID int,
    UserName varchar(255),
    Country varchar(255),
    FirstName varchar(255),
    LastName varchar(255)
);

CREATE TABLE deposits (
    DepID int,
    PlayerID int,

CODE 4

DEEPASHREE_Ramesh2207 · September 16, 2021 · SQL
create table Account_Details(
         Account_ID char(5) primary key not null, 
         Customer_ID char(5) ,
         Branch_ID char(5) ,
         Account_Type char(1),
         Deposit_Amount int,
         Acc_opening_date date
);
         
insert into Account_Details values('A010','C001','B101','S','30000',2021-05-10),
('A020','C002','B102','S','23000',2021-05-19),('A030','C003','B103','C','2000',2021-05-25),

PythonLogin

an anonymous user · September 16, 2021 · SQL
-- create a table
CREATE TABLE accounts (
  'id' int(11) NOT NULL auto_increment,
  'username' varchar(50) NOT NULL,
  'password' signed(20) NOT NULL,
  'admin' boolean() NOT NULL
);
-- insert some values
INSERT INTO accounts ('id', 'username', 'password', 'admin') VALUES (1, 'testusername', '-966697084172663693', TRUE);
-- fetch some values
SELECT * FROM accounts WHERE admin = TRUE;

practice

an anonymous user · September 16, 2021 · SQL
CREATE TABLE students (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  gender TEXT NOT NULL
);
-- insert some values
INSERT INTO students VALUES (1, 'Ryan', 'M');
INSERT INTO students VALUES (2, 'Joanna','M');
-- fetch some values
SELECT * FROM students WHERE gender = 'F';

CODE 3

DEEPASHREE_Ramesh2207 · September 16, 2021 · SQL
create table Account_Details(
         Account_ID char(5) primary key not null, 
         Customer_ID char(5) ,
         Branch_ID char(5) ,
         Account_Type char(1),
         Deposit_Amount int,
         Acc_opening_date date
);
         
insert into Account_Details values('A010','C001','B101','S','30000',2021-05-10),
('A020','C002','B102','S','23000',2021-05-19),('A030','C003','B103','C','2000',2021-05-25),

Check

an anonymous user · September 16, 2021 · SQL
-- create a table
CREATE TABLE account (
  customer varchar(10),
  balance INT
);
-- insert some values
INSERT INTO account VALUES ('Ryan', 123);
INSERT INTO account VALUES ('Joanna',123);
INSERT into account values( 'Amdm', 23);

select A.customer, count(B.customer)

Check

an anonymous user · September 16, 2021 · SQL
-- create a table
CREATE TABLE account (
  customer varchar(10),
  balance INT
);
-- insert some values
INSERT INTO account VALUES ('Ryan', 123);
INSERT INTO account VALUES ('Joanna',123);
INSERT into account values( 'Amdm', 23);
-- fetch some values
-- SELECT f.a, count(f.a) from students f, students s where f.b<=s.b group by f.a

linked list and operations

rajeevsinghthakur · updated September 16, 2021 · Python
class Node:
    def __init__(self,data):
        self.data = data
        self.next = None
class linkedlist:
    def __init__(self):
        self.head = None
    def push(self,data):
        data = Node(data)
        data.next=self.head
        self.head=data

demo

an anonymous user · September 16, 2021 · SQL
CREATE TABLE empl (
empno number(5),
ename varchar2(20),
job varchar2(5),
sal number(7,2),
comm number(7,2),
deptno number(2,0)
);

mu

an anonymous user · September 16, 2021 · SQL
-- create a table
CREATE TABLE students (
  studentid INT;
);
-- insert some values
INSERT INTO students VALUES (1);
INSERT INTO students VALUES (2);
-- fetch some values
SELECT * FROM students ;

CODE1

DEEPASHREE_Ramesh2207 · September 16, 2021 · SQL
CREATE TABLE Bank_Details (
  Branch_ID char(5) PRIMARY KEY check(Branch_ID like 'B%'),Branch_Location varchar(50),Branch_city(50)
);

INSERT INTO Bank_Details VALUES('B101','Peralam','TN'),('B102','Kollumangudi','TVR'), 
                               ('B103','Camp','Mumbai'),('B104','US','West US'), 
                               ('B105','MG Road','MYLD'),('B106','Kothrude','Pune'), 
                               ('B107','Galeria','Pune'),('B108','AKLR','MYLD'), 
                           

STUDENT GRADE

Muthumari_B · September 16, 2021 · C++
#include <iostream>
using namespace std;
class student
{
    int rn,mark[10],i,t,n;
    char name[30];
    float avg;
    public:
    void getdata();
    void total();
    void average();